OSR exit should know about Int52 and Double constants
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Apr 2014 19:51:54 +0000 (19:51 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Apr 2014 19:51:54 +0000 (19:51 +0000)
commit0a6f7da7c69d47b773ef5248c6f81c4c19b064b2
treed08565da0f8648e33692019a512e63936e3d80ed
parentb456b456a6f72f364ecb1d16de1a8821349909c4
OSR exit should know about Int52 and Double constants
https://bugs.webkit.org/show_bug.cgi?id=131945

Reviewed by Oliver Hunt.

The DFG OSR exit machinery's ignorance would lead to some constants becoming
jsUndefined() after OSR exit.

The FTL OSR exit machinery's ignorance just meant that we would sometimes use a
stackmap constant rather than baking the constant into the OSRExit data structure.
So, not a big deal, but worth fixing.

Also added some helpful hacks to jsc.cpp for testing such OSR exit pathologies.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsic):
* dfg/DFGMinifiedNode.h:
(JSC::DFG::belongsInMinifiedGraph):
(JSC::DFG::MinifiedNode::hasConstantNumber):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::tryToSetConstantExitArgument):
* jsc.cpp:
(GlobalObject::finishCreation):
(functionOtherFalse):
(functionUndefined):
* runtime/Intrinsic.h:
* tests/stress/fold-to-double-constant-then-exit.js: Added.
(foo):
* tests/stress/fold-to-int52-constant-then-exit.js: Added.
(foo):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167612 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
Source/JavaScriptCore/dfg/DFGMinifiedNode.h
Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/runtime/Intrinsic.h
Source/JavaScriptCore/tests/stress/fold-to-double-constant-then-exit.js [new file with mode: 0644]
Source/JavaScriptCore/tests/stress/fold-to-int52-constant-then-exit.js [new file with mode: 0644]