Title: [153269] trunk/Source/_javascript_Core
Revision
153269
Author
[email protected]
Date
2013-07-24 21:04:32 -0700 (Wed, 24 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: trunk/Source/_javascript_Core/ChangeLog (153268 => 153269)


--- trunk/Source/_javascript_Core/ChangeLog	2013-07-25 04:04:29 UTC (rev 153268)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-07-25 04:04:32 UTC (rev 153269)
@@ -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: trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp (153268 => 153269)


--- trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp	2013-07-25 04:04:29 UTC (rev 153268)
+++ trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp	2013-07-25 04:04:32 UTC (rev 153269)
@@ -1634,7 +1634,6 @@
             
     case Phantom:
     case InlineStart:
-    case Nop:
     case CountExecution:
         break;
         

Modified: trunk/Source/_javascript_Core/dfg/DFGArgumentsSimplificationPhase.cpp (153268 => 153269)


--- trunk/Source/_javascript_Core/dfg/DFGArgumentsSimplificationPhase.cpp	2013-07-25 04:04:29 UTC (rev 153268)
+++ trunk/Source/_javascript_Core/dfg/DFGArgumentsSimplificationPhase.cpp	2013-07-25 04:04:32 UTC (rev 153269)
@@ -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: trunk/Source/_javascript_Core/dfg/DFGCPSRethreadingPhase.cpp (153268 => 153269)


--- trunk/Source/_javascript_Core/dfg/DFGCPSRethreadingPhase.cpp	2013-07-25 04:04:29 UTC (rev 153268)
+++ trunk/Source/_javascript_Core/dfg/DFGCPSRethreadingPhase.cpp	2013-07-25 04:04:32 UTC (rev 153269)
@@ -99,8 +99,6 @@
                         break;
                     }
                     break;
-                case Nop:
-                    continue;
                 default:
                     break;
                 }

Modified: trunk/Source/_javascript_Core/dfg/DFGCSEPhase.cpp (153268 => 153269)


--- trunk/Source/_javascript_Core/dfg/DFGCSEPhase.cpp	2013-07-25 04:04:29 UTC (rev 153268)
+++ trunk/Source/_javascript_Core/dfg/DFGCSEPhase.cpp	2013-07-25 04:04:32 UTC (rev 153269)
@@ -1185,8 +1185,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: trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp (153268 => 153269)


--- trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2013-07-25 04:04:29 UTC (rev 153268)
+++ trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2013-07-25 04:04:32 UTC (rev 153269)
@@ -867,7 +867,6 @@
         }
 
         case GetArrayLength:
-        case Nop:
         case Phi:
         case ForwardInt32ToDouble:
         case PhantomPutStructure:

Modified: trunk/Source/_javascript_Core/dfg/DFGGraph.h (153268 => 153269)


--- trunk/Source/_javascript_Core/dfg/DFGGraph.h	2013-07-25 04:04:29 UTC (rev 153268)
+++ trunk/Source/_javascript_Core/dfg/DFGGraph.h	2013-07-25 04:04:32 UTC (rev 153269)
@@ -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: trunk/Source/_javascript_Core/dfg/DFGNode.h (153268 => 153269)


--- trunk/Source/_javascript_Core/dfg/DFGNode.h	2013-07-25 04:04:29 UTC (rev 153268)
+++ trunk/Source/_javascript_Core/dfg/DFGNode.h	2013-07-25 04:04:32 UTC (rev 153269)
@@ -1085,8 +1085,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: trunk/Source/_javascript_Core/dfg/DFGNodeType.h (153268 => 153269)


--- trunk/Source/_javascript_Core/dfg/DFGNodeType.h	2013-07-25 04:04:29 UTC (rev 153268)
+++ trunk/Source/_javascript_Core/dfg/DFGNodeType.h	2013-07-25 04:04:32 UTC (rev 153269)
@@ -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: trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp (153268 => 153269)


--- trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp	2013-07-25 04:04:29 UTC (rev 153268)
+++ trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp	2013-07-25 04:04:32 UTC (rev 153269)
@@ -545,7 +545,6 @@
             
         // These gets ignored because it doesn't do anything.
         case InlineStart:
-        case Nop:
         case CountExecution:
         case PhantomLocal:
         case Flush:

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp (153268 => 153269)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2013-07-25 04:04:29 UTC (rev 153268)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2013-07-25 04:04:32 UTC (rev 153269)
@@ -4840,7 +4840,6 @@
         noResult(node);
         break;
 
-    case Nop:
     case LastNodeType:
         RELEASE_ASSERT_NOT_REACHED();
         break;

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp (153268 => 153269)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2013-07-25 04:04:29 UTC (rev 153268)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2013-07-25 04:04:32 UTC (rev 153269)
@@ -4698,10 +4698,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