Get rid of forward exit on DoubleAsInt32
https://bugs.webkit.org/show_bug.cgi?id=125552
PerformanceTests/SunSpider:
Reviewed by Oliver Hunt.
Use SunSpider as a kind of spot-check for the
no-architecture-specific-optimization paths in the compiler.
* no-architecture-specific-optimizations.yaml: Added.
Source/JavaScriptCore:
Reviewed by Oliver Hunt.
The forward exit was just there so that we wouldn't have to keep the inputs alive up to
the DoubleAsInt32. That's dumb. Forward exits are a complicated piece of machinery and
we shouldn't have it just for a bit of liveness micro-optimization.
Also add a bunch of machinery to test this case on X86.
* assembler/AbstractMacroAssembler.h:
(JSC::optimizeForARMv7s):
(JSC::optimizeForARM64):
(JSC::optimizeForX86):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileDoubleAsInt32):
* runtime/Options.h:
* tests/stress/double-as-int32.js: Added.
(foo):
(test):
Tools:
Reviewed by Oliver Hunt.
Add some support for testing the generic (non-X86) paths on X86 by disabling
architecture-specific optimizations (ASO's).
* Scripts/run-javascriptcore-tests:
* Scripts/run-jsc-stress-tests:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160411 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp b/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
index 77076df..d792064 100644
--- a/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
@@ -233,11 +233,14 @@
case ArithMod: {
if (Node::shouldSpeculateInt32ForArithmetic(node->child1().node(), node->child2().node())
&& node->canSpeculateInt32()) {
- if (isX86() || isARM64() || isARMv7s()) {
+ if (optimizeForX86() || optimizeForARM64() || optimizeForARMv7s()) {
fixEdge<Int32Use>(node->child1());
fixEdge<Int32Use>(node->child2());
break;
}
+ Edge child1 = node->child1();
+ Edge child2 = node->child2();
+
injectInt32ToDoubleNode(node->child1());
injectInt32ToDoubleNode(node->child2());
@@ -248,6 +251,8 @@
node->setOp(DoubleAsInt32);
node->children.initialize(Edge(newDivision, KnownNumberUse), Edge(), Edge());
+
+ m_insertionSet.insertNode(m_indexInBlock + 1, SpecNone, Phantom, node->codeOrigin, child1, child2);
break;
}
fixEdge<NumberUse>(node->child1());