Add support for Math.imul
https://bugs.webkit.org/show_bug.cgi?id=115143
Reviewed by Filip Pizlo.
Source/JavaScriptCore:
Add support for Math.imul, a thunk generator for Math.imul,
and an intrinsic.
Fairly self explanatory set of changes, DFG intrinsics simply
leverages the existing ValueToInt32 nodes.
- create_hash_table:
- dfg/DFGAbstractState.cpp:
(JSC::DFG::AbstractState::executeEffects):
- dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):
- dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsic):
(JSC::DFG::CSEPhase::performNodeCSE):
(JSC::DFG::FixupPhase::fixupNode):
(DFG):
- dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
- dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithIMul):
(SpeculativeJIT):
- dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
- dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
(JSC::imulThunkGenerator):
(JSC):
(JSC):
- runtime/Intrinsic.h:
- runtime/MathObject.cpp:
(JSC):
(JSC::mathProtoFuncIMul):
(JSC::thunkGeneratorForIntrinsic):
LayoutTests:
Add a bunch of tests for Math.imul
- fast/js/Object-getOwnPropertyNames-expected.txt:
- fast/js/imul-expected.txt: Added.
- fast/js/imul.html: Added.
- fast/js/regress/imul-double-only-expected.txt: Added.
- fast/js/regress/imul-double-only.html: Added.
- fast/js/regress/imul-int-only-expected.txt: Added.
- fast/js/regress/imul-int-only.html: Added.
- fast/js/regress/imul-mixed-expected.txt: Added.
- fast/js/regress/imul-mixed.html: Added.
- fast/js/regress/script-tests/imul-double-only.js: Added.
(f):
- fast/js/regress/script-tests/imul-int-only.js: Added.
(f):
- fast/js/regress/script-tests/imul-mixed.js: Added.
(f):
- fast/js/script-tests/Object-getOwnPropertyNames.js:
- fast/js/script-tests/imul.js: Added.
(testIMul):