Title: [210752] trunk/Source/_javascript_Core
Revision
210752
Author
ryanhad...@apple.com
Date
2017-01-13 17:03:17 -0800 (Fri, 13 Jan 2017)

Log Message

Unreviewed, rolling out r210735.

This change introduced LayoutTest and JSC test flakiness.

Reverted changeset:

"Reserve capacity for StringBuilder in unescape"
https://bugs.webkit.org/show_bug.cgi?id=167008
http://trac.webkit.org/changeset/210735

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (210751 => 210752)


--- trunk/Source/_javascript_Core/ChangeLog	2017-01-14 00:46:12 UTC (rev 210751)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-01-14 01:03:17 UTC (rev 210752)
@@ -1,3 +1,15 @@
+2017-01-13  Ryan Haddad  <ryanhad...@apple.com>
+
+        Unreviewed, rolling out r210735.
+
+        This change introduced LayoutTest and JSC test flakiness.
+
+        Reverted changeset:
+
+        "Reserve capacity for StringBuilder in unescape"
+        https://bugs.webkit.org/show_bug.cgi?id=167008
+        http://trac.webkit.org/changeset/210735
+
 2017-01-13  Saam Barati  <sbar...@apple.com>
 
         Initialize the ArraySpecies watchpoint as Clear and transition to IsWatched once slice is called for the first time

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp (210751 => 210752)


--- trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp	2017-01-14 00:46:12 UTC (rev 210751)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp	2017-01-14 01:03:17 UTC (rev 210752)
@@ -814,24 +814,22 @@
 EncodedJSValue JSC_HOST_CALL globalFuncUnescape(ExecState* exec)
 {
     return JSValue::encode(toStringView(exec, exec->argument(0), [&] (StringView view) {
-        unsigned k = 0;
-        unsigned length = view.length();
-
         StringBuilder builder;
-        builder.reserveCapacity(length);
+        int k = 0;
+        int len = view.length();
 
         if (view.is8Bit()) {
             const LChar* characters = view.characters8();
             LChar convertedLChar;
-            while (k < length) {
+            while (k < len) {
                 const LChar* c = characters + k;
-                if (c[0] == '%' && k <= length - 6 && c[1] == 'u') {
+                if (c[0] == '%' && k <= len - 6 && c[1] == 'u') {
                     if (isASCIIHexDigit(c[2]) && isASCIIHexDigit(c[3]) && isASCIIHexDigit(c[4]) && isASCIIHexDigit(c[5])) {
                         builder.append(Lexer<UChar>::convertUnicode(c[2], c[3], c[4], c[5]));
                         k += 6;
                         continue;
                     }
-                } else if (c[0] == '%' && k <= length - 3 && isASCIIHexDigit(c[1]) && isASCIIHexDigit(c[2])) {
+                } else if (c[0] == '%' && k <= len - 3 && isASCIIHexDigit(c[1]) && isASCIIHexDigit(c[2])) {
                     convertedLChar = LChar(Lexer<LChar>::convertHex(c[1], c[2]));
                     c = &convertedLChar;
                     k += 2;
@@ -842,16 +840,16 @@
         } else {
             const UChar* characters = view.characters16();
 
-            while (k < length) {
+            while (k < len) {
                 const UChar* c = characters + k;
                 UChar convertedUChar;
-                if (c[0] == '%' && k <= length - 6 && c[1] == 'u') {
+                if (c[0] == '%' && k <= len - 6 && c[1] == 'u') {
                     if (isASCIIHexDigit(c[2]) && isASCIIHexDigit(c[3]) && isASCIIHexDigit(c[4]) && isASCIIHexDigit(c[5])) {
                         convertedUChar = Lexer<UChar>::convertUnicode(c[2], c[3], c[4], c[5]);
                         c = &convertedUChar;
                         k += 5;
                     }
-                } else if (c[0] == '%' && k <= length - 3 && isASCIIHexDigit(c[1]) && isASCIIHexDigit(c[2])) {
+                } else if (c[0] == '%' && k <= len - 3 && isASCIIHexDigit(c[1]) && isASCIIHexDigit(c[2])) {
                     convertedUChar = UChar(Lexer<UChar>::convertHex(c[1], c[2]));
                     c = &convertedUChar;
                     k += 2;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to