haikuwebkit/PerformanceTests/BigIntBench/big-int-simple-div.js

16 lines
267 B
JavaScript
Raw Permalink Normal View History

[BigInt] Add ValueDiv into DFG https://bugs.webkit.org/show_bug.cgi?id=186178 Reviewed by Yusuke Suzuki. JSTests: * stress/big-int-div-jit-osr.js: Added. * stress/big-int-div-jit-untyped.js: Added. * stress/value-div-fixup-int32-big-int.js: Added. PerformanceTests: * BigIntBench/big-int-simple-div.js: Added. * BigIntBench/value-div-type-propagation.js: Added. Source/JavaScriptCore: This patch is introducing a new node type called ValueDiv. This node is responsible to handle Untyped and Bigint specialization of division operator, while the ArithDiv variant handles Number/Boolean cases. BigInt specialization generates following speedup into simple benchmark: noSpec changes big-int-simple-div 10.6013+-0.4682 ^ 8.4518+-0.0943 ^ definitely 1.2543x faster * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGBackwardsPropagationPhase.cpp: (JSC::DFG::BackwardsPropagationPhase::propagate): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::makeDivSafe): (JSC::DFG::ByteCodeParser::parseBlock): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupArithDiv): (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGNode.h: (JSC::DFG::Node::arithNodeFlags): * dfg/DFGNodeType.h: * dfg/DFGOperations.cpp: * dfg/DFGOperations.h: * dfg/DFGPredictionPropagationPhase.cpp: * dfg/DFGSafeToExecute.h: (JSC::DFG::safeToExecute): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileValueDiv): (JSC::DFG::SpeculativeJIT::compileArithDiv): * dfg/DFGSpeculativeJIT.h: * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGValidate.cpp: * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileNode): (JSC::FTL::DFG::LowerDFGToB3::compileValueDiv): (JSC::FTL::DFG::LowerDFGToB3::compileArithDiv): (JSC::FTL::DFG::LowerDFGToB3::compileArithBitNot): Canonical link: https://commits.webkit.org/207237@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239158 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-13 12:26:01 +00:00
function bigInt(a, b) {
let c = a / b;
return a + c / b;
}
noInline(bigInt);
for (let i = 0; i < 100000; i++) {
bigInt(0b1111n, 0b1010n);
}
let out;
for (let i = 0; i < 100000; i++) {
out = bigInt(0xffffffffffffffffffn, 0xaaffffffffffffffffffn);
}