ToThis should have a fast path based on type info flags
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Apr 2016 20:33:47 +0000 (20:33 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Apr 2016 20:33:47 +0000 (20:33 +0000)
commit137397639de3b474baa0d2f43151006537c2aee7
treeddfb876c7b7f2ed1ef1cf28c9f9204a558708ceb
parent4df724dea21cf600e038332114996f7cf023e907
ToThis should have a fast path based on type info flags
https://bugs.webkit.org/show_bug.cgi?id=156712

Reviewed by Geoffrey Garen.

Prior to this change, if we couldn't nail down the type of ToThis to something easy, we'd emit code
that would take slow path if the argument was not a final object. We'd end up taking that slow path
a lot.

This adds a type info flag for ToThis having non-obvious behavior and changes the DFG and FTL paths
to test this flag. This is a sub-1% speed-up on SunSpider and Octane.

* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileToThis):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::create):
* runtime/JSLexicalEnvironment.h:
(JSC::JSLexicalEnvironment::create):
* runtime/JSString.h:
* runtime/JSTypeInfo.h:
(JSC::TypeInfo::overridesGetOwnPropertySlot):
(JSC::TypeInfo::interceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero):
(JSC::TypeInfo::structureIsImmortal):
(JSC::TypeInfo::overridesToThis):
(JSC::TypeInfo::overridesGetPropertyNames):
(JSC::TypeInfo::prohibitsPropertyCaching):
(JSC::TypeInfo::getOwnPropertySlotIsImpure):
* runtime/StrictEvalActivation.h:
(JSC::StrictEvalActivation::create):
* runtime/Symbol.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.h
Source/JavaScriptCore/runtime/JSLexicalEnvironment.h
Source/JavaScriptCore/runtime/JSString.h
Source/JavaScriptCore/runtime/JSTypeInfo.h
Source/JavaScriptCore/runtime/StrictEvalActivation.h
Source/JavaScriptCore/runtime/Symbol.h