Math.fround() should be an intrinsic
https://bugs.webkit.org/show_bug.cgi?id=131583
Source/JavaScriptCore:
Reviewed by Geoffrey Garen.
Makes programs that use Math.fround() run up to 6x faster.
- dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
- dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsic):
(JSC::DFG::CSEPhase::performNodeCSE):
(JSC::DFG::clobberize):
(JSC::DFG::FixupPhase::fixupNode):
- dfg/DFGNodeType.h:
- dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
(JSC::DFG::safeToExecute):
- dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
- dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
(JSC::FTL::canCompile):
- ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileArithFRound):
- runtime/Intrinsic.h:
- runtime/MathObject.cpp:
(JSC::MathObject::finishCreation):
LayoutTests:
Reviewed by Geoffrey Garen.
This test runs 4.4635x faster with the intrinsic.
- js/regress/fround-expected.txt: Added.
- js/regress/fround.html: Added.
- js/regress/script-tests/fround.js: Added.