Get rid of forward exit on DoubleAsInt32
[WebKit-https.git] / Source / JavaScriptCore / dfg / DFGFixupPhase.cpp
index 77076df8ac03d2d75f6c2e28b286d70cb3f0f937..d792064a248259bd6391a9bfa1380cc9376d65f2 100644 (file)
@@ -233,11 +233,14 @@ private:
         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 @@ private:
                 
                 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());