Title: [130418] trunk/Source/_javascript_Core
Revision
130418
Author
[email protected]
Date
2012-10-04 12:34:34 -0700 (Thu, 04 Oct 2012)

Log Message

Use copyLCharsFromUCharSource() for IdentifierLCharFromUCharTranslator translation
https://bugs.webkit.org/show_bug.cgi?id=98335

Patch by Benjamin Poulain <[email protected]> on 2012-10-04
Reviewed by Michael Saboff.

Michael Saboff added an optimized version of UChar->LChar conversion in r125846.
Use this function in JSC::Identifier.

* runtime/Identifier.cpp:
(JSC::IdentifierLCharFromUCharTranslator::translate):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (130417 => 130418)


--- trunk/Source/_javascript_Core/ChangeLog	2012-10-04 19:31:10 UTC (rev 130417)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-10-04 19:34:34 UTC (rev 130418)
@@ -1,3 +1,16 @@
+2012-10-04  Benjamin Poulain  <[email protected]>
+
+        Use copyLCharsFromUCharSource() for IdentifierLCharFromUCharTranslator translation
+        https://bugs.webkit.org/show_bug.cgi?id=98335
+
+        Reviewed by Michael Saboff.
+
+        Michael Saboff added an optimized version of UChar->LChar conversion in r125846.
+        Use this function in JSC::Identifier.
+
+        * runtime/Identifier.cpp:
+        (JSC::IdentifierLCharFromUCharTranslator::translate):
+
 2012-10-04  Michael Saboff  <[email protected]>
 
         After r130344, OpaqueJSString() creates a empty string which should be a null string

Modified: trunk/Source/_javascript_Core/runtime/Identifier.cpp (130417 => 130418)


--- trunk/Source/_javascript_Core/runtime/Identifier.cpp	2012-10-04 19:31:10 UTC (rev 130417)
+++ trunk/Source/_javascript_Core/runtime/Identifier.cpp	2012-10-04 19:34:34 UTC (rev 130418)
@@ -30,6 +30,7 @@
 #include <wtf/Assertions.h>
 #include <wtf/FastMalloc.h>
 #include <wtf/HashSet.h>
+#include <wtf/text/ASCIIFastPath.h>
 #include <wtf/text/StringHash.h>
 
 using WTF::ThreadSpecific;
@@ -80,11 +81,7 @@
     {
         LChar* d;
         StringImpl* r = StringImpl::createUninitialized(buf.length, d).leakRef();
-        for (unsigned i = 0; i != buf.length; i++) {
-            UChar c = buf.s[i];
-            ASSERT(c <= 0xff);
-            d[i] = c;
-        }
+        WTF::copyLCharsFromUCharSource(d, buf.s, buf.length);
         r->setHash(hash);
         location = r; 
     }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to