Optimize GetByVal when subscript is a rope string.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 May 2014 00:53:29 +0000 (00:53 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 May 2014 00:53:29 +0000 (00:53 +0000)
commitc95c2e5bdb718699bff865ed66df337eb26aec30
treecffd55485792e898dff0bcc1bf7f328612aba54b
parent512caf917fdeb6c22144fdd7b35e57bdff0d8cc0
Optimize GetByVal when subscript is a rope string.
<https://webkit.org/b/132590>

Use JSString::toIdentifier() in the various GetByVal implementations
to try and avoid allocating extra strings.

Added canUseFastGetOwnProperty() and wrap calls to fastGetOwnProperty()
in that, to avoid calling JSString::value() which always resolves ropes
into new strings and de-optimizes subsequent toIdentifier() calls.

My iMac says ~9% progression on Dromaeo/dom-attr.html

Reviewed by Phil Pizlo.

* dfg/DFGOperations.cpp:
* jit/JITOperations.cpp:
(JSC::getByVal):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::getByVal):
* runtime/JSCell.h:
* runtime/JSCellInlines.h:
(JSC::JSCell::fastGetOwnProperty):
(JSC::JSCell::canUseFastGetOwnProperty):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168335 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGOperations.cpp
Source/JavaScriptCore/jit/JITOperations.cpp
Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
Source/JavaScriptCore/runtime/JSCell.h
Source/JavaScriptCore/runtime/JSCellInlines.h