Title: [152439] branches/dfgFourthTier/Source/_javascript_Core
Revision
152439
Author
[email protected]
Date
2013-07-07 21:40:52 -0700 (Sun, 07 Jul 2013)

Log Message

fourthTier: Graph::clearAndDerefChild() makes no sense anymore, and neither does Nop
https://bugs.webkit.org/show_bug.cgi?id=118452

Reviewed by Sam Weinig.
        
Noticed that ArgumentsSimplificationPhase was converting something to a Nop and then
resetting its children using clearAndDerefChild(). Using Nop instead of Phantom is a
holdover from back when we needed a no-MustGenerate no-op. We don't anymore. Using
clearAndDerefChild() was necessary back when we did eager reference counting. We
don't need to do that anymore, and in fact clearAndDerefChild() appeared to not do
any reference counting, so it was badly named to begin with.

* dfg/DFGAbstractState.cpp:
(JSC::DFG::AbstractState::executeEffects):
* dfg/DFGArgumentsSimplificationPhase.cpp:
(JSC::DFG::ArgumentsSimplificationPhase::run):
* dfg/DFGCPSRethreadingPhase.cpp:
(JSC::DFG::CPSRethreadingPhase::freeUnnecessaryNodes):
* dfg/DFGCSEPhase.cpp:
(JSC::DFG::CSEPhase::performNodeCSE):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.h:
(Graph):
* dfg/DFGNode.h:
(JSC::DFG::Node::willHaveCodeGenOrOSR):
* dfg/DFGNodeType.h:
(DFG):
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):

Modified Paths

Diff

Modified: branches/dfgFourthTier/Source/_javascript_Core/ChangeLog (152438 => 152439)


--- branches/dfgFourthTier/Source/_javascript_Core/ChangeLog	2013-07-07 06:46:39 UTC (rev 152438)
+++ branches/dfgFourthTier/Source/_javascript_Core/ChangeLog	2013-07-08 04:40:52 UTC (rev 152439)
@@ -1,3 +1,40 @@
+2013-07-07  Filip Pizlo  <[email protected]>
+
+        fourthTier: Graph::clearAndDerefChild() makes no sense anymore, and neither does Nop
+        https://bugs.webkit.org/show_bug.cgi?id=118452
+
+        Reviewed by Sam Weinig.
+        
+        Noticed that ArgumentsSimplificationPhase was converting something to a Nop and then
+        resetting its children using clearAndDerefChild(). Using Nop instead of Phantom is a
+        holdover from back when we needed a no-MustGenerate no-op. We don't anymore. Using
+        clearAndDerefChild() was necessary back when we did eager reference counting. We
+        don't need to do that anymore, and in fact clearAndDerefChild() appeared to not do
+        any reference counting, so it was badly named to begin with.
+
+        * dfg/DFGAbstractState.cpp:
+        (JSC::DFG::AbstractState::executeEffects):
+        * dfg/DFGArgumentsSimplificationPhase.cpp:
+        (JSC::DFG::ArgumentsSimplificationPhase::run):
+        * dfg/DFGCPSRethreadingPhase.cpp:
+        (JSC::DFG::CPSRethreadingPhase::freeUnnecessaryNodes):
+        * dfg/DFGCSEPhase.cpp:
+        (JSC::DFG::CSEPhase::performNodeCSE):
+        * dfg/DFGFixupPhase.cpp:
+        (JSC::DFG::FixupPhase::fixupNode):
+        * dfg/DFGGraph.h:
+        (Graph):
+        * dfg/DFGNode.h:
+        (JSC::DFG::Node::willHaveCodeGenOrOSR):
+        * dfg/DFGNodeType.h:
+        (DFG):
+        * dfg/DFGPredictionPropagationPhase.cpp:
+        (JSC::DFG::PredictionPropagationPhase::propagate):
+        * dfg/DFGSpeculativeJIT32_64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * dfg/DFGSpeculativeJIT64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+
 2013-07-04  Filip Pizlo  <[email protected]>
 
         fourthTier: FTL should better report its compile-times and it should be able to run in a mode where it doesn't spend time generating OSR exits

Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGAbstractState.cpp (152438 => 152439)


--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGAbstractState.cpp	2013-07-07 06:46:39 UTC (rev 152438)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGAbstractState.cpp	2013-07-08 04:40:52 UTC (rev 152439)
@@ -1610,7 +1610,6 @@
             
     case Phantom:
     case InlineStart:
-    case Nop:
     case CountExecution:
         break;
         

Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGArgumentsSimplificationPhase.cpp (152438 => 152439)


--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGArgumentsSimplificationPhase.cpp	2013-07-07 06:46:39 UTC (rev 152438)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGArgumentsSimplificationPhase.cpp	2013-07-08 04:40:52 UTC (rev 152439)
@@ -648,9 +648,8 @@
                     if (m_createsArguments.contains(node->codeOrigin.inlineCallFrame))
                         continue;
                     
-                    node->setOpAndDefaultFlags(Nop);
-                    m_graph.clearAndDerefChild1(node);
-                    m_graph.clearAndDerefChild2(node);
+                    node->setOpAndDefaultFlags(Phantom);
+                    node->children.reset();
                     break;
                 }
                     

Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGCPSRethreadingPhase.cpp (152438 => 152439)


--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGCPSRethreadingPhase.cpp	2013-07-07 06:46:39 UTC (rev 152438)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGCPSRethreadingPhase.cpp	2013-07-08 04:40:52 UTC (rev 152439)
@@ -99,8 +99,6 @@
                         break;
                     }
                     break;
-                case Nop:
-                    continue;
                 default:
                     break;
                 }

Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGCSEPhase.cpp (152438 => 152439)


--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGCSEPhase.cpp	2013-07-07 06:46:39 UTC (rev 152438)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGCSEPhase.cpp	2013-07-08 04:40:52 UTC (rev 152439)
@@ -1182,8 +1182,7 @@
             node->convertToPhantom();
             Node* dataNode = replacement->child1().node();
             ASSERT(dataNode->hasResult());
-            m_graph.clearAndDerefChild1(node);
-            node->children.child1() = Edge(dataNode);
+            node->child1() = Edge(dataNode);
             m_graph.dethread();
             m_changed = true;
             break;

Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGFixupPhase.cpp (152438 => 152439)


--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2013-07-07 06:46:39 UTC (rev 152438)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2013-07-08 04:40:52 UTC (rev 152439)
@@ -900,7 +900,6 @@
         }
 
         case GetArrayLength:
-        case Nop:
         case Phi:
         case ForwardInt32ToDouble:
         case PhantomPutStructure:

Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.h (152438 => 152439)


--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.h	2013-07-07 06:46:39 UTC (rev 152438)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.h	2013-07-08 04:40:52 UTC (rev 152439)
@@ -100,16 +100,6 @@
         changeEdge(edge, newEdge);
     }
     
-    void clearAndDerefChild(Node* node, unsigned index)
-    {
-        if (!node->children.child(index))
-            return;
-        node->children.setChild(index, Edge());
-    }
-    void clearAndDerefChild1(Node* node) { clearAndDerefChild(node, 0); }
-    void clearAndDerefChild2(Node* node) { clearAndDerefChild(node, 1); }
-    void clearAndDerefChild3(Node* node) { clearAndDerefChild(node, 2); }
-    
     void performSubstitution(Node* node)
     {
         if (node->flags() & NodeHasVarArgs) {

Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGNode.h (152438 => 152439)


--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGNode.h	2013-07-07 06:46:39 UTC (rev 152438)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGNode.h	2013-07-08 04:40:52 UTC (rev 152439)
@@ -1083,8 +1083,6 @@
         case DoubleAsInt32:
         case PhantomArguments:
             return true;
-        case Nop:
-            return false;
         case Phantom:
             return child1().useKindUnchecked() != UntypedUse || child2().useKindUnchecked() != UntypedUse || child3().useKindUnchecked() != UntypedUse;
         default:

Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGNodeType.h (152438 => 152439)


--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGNodeType.h	2013-07-07 06:46:39 UTC (rev 152438)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGNodeType.h	2013-07-08 04:40:52 UTC (rev 152439)
@@ -63,7 +63,6 @@
     macro(MovHint, NodeDoesNotExit) \
     macro(ZombieHint, NodeDoesNotExit) \
     macro(Phantom, NodeMustGenerate) \
-    macro(Nop, NodeDoesNotExit) \
     macro(Phi, NodeDoesNotExit | NodeRelevantToOSR) \
     macro(Flush, NodeMustGenerate | NodeDoesNotExit) \
     macro(PhantomLocal, NodeMustGenerate | NodeDoesNotExit) \

Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp (152438 => 152439)


--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp	2013-07-07 06:46:39 UTC (rev 152438)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp	2013-07-08 04:40:52 UTC (rev 152439)
@@ -534,7 +534,6 @@
             
         // These gets ignored because it doesn't do anything.
         case InlineStart:
-        case Nop:
         case CountExecution:
         case PhantomLocal:
         case Flush:

Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp (152438 => 152439)


--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2013-07-07 06:46:39 UTC (rev 152438)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2013-07-08 04:40:52 UTC (rev 152439)
@@ -4828,7 +4828,6 @@
         noResult(node);
         break;
 
-    case Nop:
     case LastNodeType:
         RELEASE_ASSERT_NOT_REACHED();
         break;

Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp (152438 => 152439)


--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2013-07-07 06:46:39 UTC (rev 152438)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2013-07-08 04:40:52 UTC (rev 152439)
@@ -4689,10 +4689,6 @@
         noResult(node);
         break;
         
-    case Nop:
-        RELEASE_ASSERT_NOT_REACHED();
-        break;
-        
     case LastNodeType:
         RELEASE_ASSERT_NOT_REACHED();
         break;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to