Title: [184613] trunk/Source/_javascript_Core
Revision
184613
Author
[email protected]
Date
2015-05-19 21:49:36 -0700 (Tue, 19 May 2015)

Log Message

[JSC] Speed up URL encode/decode by using bitmaps instead of strchr().
<https://webkit.org/b/145115>

Incorporate review feedback from Darin, removing some unnecessary zero checks.

Patch by Yusuke Suzuki <[email protected]> on 2015-05-19

* runtime/JSGlobalObjectFunctions.cpp:
(JSC::encode):
(JSC::decode):
(JSC::globalFuncEscape):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (184612 => 184613)


--- trunk/Source/_javascript_Core/ChangeLog	2015-05-20 04:19:14 UTC (rev 184612)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-05-20 04:49:36 UTC (rev 184613)
@@ -1,5 +1,17 @@
 2015-05-19  Yusuke Suzuki  <[email protected]>
 
+        [JSC] Speed up URL encode/decode by using bitmaps instead of strchr().
+        <https://webkit.org/b/145115>
+
+        Incorporate review feedback from Darin, removing some unnecessary zero checks.
+
+        * runtime/JSGlobalObjectFunctions.cpp:
+        (JSC::encode):
+        (JSC::decode):
+        (JSC::globalFuncEscape):
+
+2015-05-19  Andreas Kling  <[email protected]>
+
         Move AtomicStringImpl table related operations from AtomicString to AtomicStringImpl
         https://bugs.webkit.org/show_bug.cgi?id=145109
 

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp (184612 => 184613)


--- trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp	2015-05-20 04:19:14 UTC (rev 184612)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp	2015-05-20 04:49:36 UTC (rev 184613)
@@ -72,7 +72,7 @@
     const char* p = cstr.data();
     for (size_t k = 0; k < cstr.length(); k++, p++) {
         char c = *p;
-        if (c && doNotEscape.get(static_cast<LChar>(c)))
+        if (doNotEscape.get(static_cast<LChar>(c)))
             builder.append(static_cast<LChar>(c));
         else {
             builder.append(static_cast<LChar>('%'));
@@ -136,7 +136,7 @@
                     u = Lexer<UChar>::convertUnicode(p[2], p[3], p[4], p[5]);
                 }
             }
-            if (charLen && (u == 0 || u >= 128 || !doNotUnescape.get(static_cast<LChar>(u)))) {
+            if (charLen && (u >= 128 || !doNotUnescape.get(static_cast<LChar>(u)))) {
                 builder.append(u);
                 k += charLen;
                 continue;
@@ -687,7 +687,7 @@
         const LChar* c = str.characters8();
         for (unsigned k = 0; k < str.length(); k++, c++) {
             int u = c[0];
-            if (u && doNotEscape.get(static_cast<LChar>(u)))
+            if (doNotEscape.get(static_cast<LChar>(u)))
                 builder.append(*c);
             else {
                 builder.append(static_cast<LChar>('%'));
@@ -706,7 +706,7 @@
             builder.append(static_cast<LChar>('u'));
             appendByteAsHex(u >> 8, builder);
             appendByteAsHex(u & 0xFF, builder);
-        } else if (u != 0 && doNotEscape.get(static_cast<LChar>(u)))
+        } else if (doNotEscape.get(static_cast<LChar>(u)))
             builder.append(*c);
         else {
             builder.append(static_cast<LChar>('%'));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to