• benjamin@webkit.org's avatar
    Speed up the conversion from JSValue to String for bulk operations · 8063cc71
    benjamin@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=83243
    
    Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-04-05
    Reviewed by Geoffrey Garen.
    
    When making operations on primitive types, we loose some time converting
    values to JSString in order to extract the string.
    
    This patch speeds up some basic Array operations by avoiding the creation
    of intermediary JSString when possible.
    
    For the cases where we need to convert a lot of JSValue in a tight loop,
    an inline conversion is used.
    
    * runtime/ArrayPrototype.cpp:
    (JSC::arrayProtoFuncToString):
    (JSC::arrayProtoFuncToLocaleString):
    (JSC::arrayProtoFuncJoin):
    (JSC::arrayProtoFuncPush):
    (JSC::arrayProtoFuncSort):
    * runtime/CommonIdentifiers.h:
    * runtime/JSArray.cpp:
    (JSC::JSArray::sort):
    * runtime/JSString.h:
    (JSC::JSValue::toUString):
    (JSC):
    (JSC::inlineJSValueNotStringtoUString):
    (JSC::JSValue::toUStringInline):
    * runtime/JSValue.cpp:
    (JSC::JSValue::toUStringSlowCase):
    (JSC):
    * runtime/JSValue.h:
    (JSValue):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    8063cc71
CommonIdentifiers.h 3.98 KB