Title: [153293] trunk/Source/_javascript_Core
Revision
153293
Author
[email protected]
Date
2013-07-24 21:05:26 -0700 (Wed, 24 Jul 2013)

Log Message

fourthTier: It should be easy to figure out which blocks nodes belong to
https://bugs.webkit.org/show_bug.cgi?id=118957

Reviewed by Sam Weinig.

* dfg/DFGGraph.cpp:
(DFG):
(JSC::DFG::Graph::initializeNodeOwners):
* dfg/DFGGraph.h:
(Graph):
* dfg/DFGNode.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (153292 => 153293)


--- trunk/Source/_javascript_Core/ChangeLog	2013-07-25 04:05:25 UTC (rev 153292)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-07-25 04:05:26 UTC (rev 153293)
@@ -1,5 +1,19 @@
 2013-07-21  Filip Pizlo  <[email protected]>
 
+        fourthTier: It should be easy to figure out which blocks nodes belong to
+        https://bugs.webkit.org/show_bug.cgi?id=118957
+
+        Reviewed by Sam Weinig.
+
+        * dfg/DFGGraph.cpp:
+        (DFG):
+        (JSC::DFG::Graph::initializeNodeOwners):
+        * dfg/DFGGraph.h:
+        (Graph):
+        * dfg/DFGNode.h:
+
+2013-07-21  Filip Pizlo  <[email protected]>
+
         fourthTier: NodeExitsForward shouldn't be duplicated in NodeType
         https://bugs.webkit.org/show_bug.cgi?id=118956
 

Modified: trunk/Source/_javascript_Core/dfg/DFGGraph.cpp (153292 => 153293)


--- trunk/Source/_javascript_Core/dfg/DFGGraph.cpp	2013-07-25 04:05:25 UTC (rev 153292)
+++ trunk/Source/_javascript_Core/dfg/DFGGraph.cpp	2013-07-25 04:05:26 UTC (rev 153293)
@@ -561,6 +561,19 @@
             block->at(nodeIndex)->misc.replacement = 0;
     }
 }
+
+void Graph::initializeNodeOwners()
+{
+    for (BlockIndex blockIndex = numBlocks(); blockIndex--;) {
+        BasicBlock* block = m_blocks[blockIndex].get();
+        if (!block)
+            continue;
+        for (unsigned phiIndex = block->phis.size(); phiIndex--;)
+            block->phis[phiIndex]->misc.owner = block;
+        for (unsigned nodeIndex = block->size(); nodeIndex--;)
+            block->at(nodeIndex)->misc.owner = block;
+    }
+}
     
 } } // namespace JSC::DFG
 

Modified: trunk/Source/_javascript_Core/dfg/DFGGraph.h (153292 => 153293)


--- trunk/Source/_javascript_Core/dfg/DFGGraph.h	2013-07-25 04:05:25 UTC (rev 153292)
+++ trunk/Source/_javascript_Core/dfg/DFGGraph.h	2013-07-25 04:05:26 UTC (rev 153293)
@@ -652,6 +652,7 @@
     void invalidateCFG();
     
     void clearReplacements();
+    void initializeNodeOwners();
     
     void getBlocksInDepthFirstOrder(Vector<BasicBlock*>& result);
     

Modified: trunk/Source/_javascript_Core/dfg/DFGNode.h (153292 => 153293)


--- trunk/Source/_javascript_Core/dfg/DFGNode.h	2013-07-25 04:05:25 UTC (rev 153292)
+++ trunk/Source/_javascript_Core/dfg/DFGNode.h	2013-07-25 04:05:26 UTC (rev 153293)
@@ -1406,8 +1406,20 @@
 public:
     // Fields used by various analyses.
     AbstractValue value;
+    
+    // Miscellaneous data that is usually meaningless, but can hold some analysis results
+    // if you ask right. For example, if you do Graph::initializeNodeOwners(), misc.owner
+    // will tell you which basic block a node belongs to. You cannot rely on this persisting
+    // across transformations unless you do the maintenance work yourself. Other phases use
+    // misc.replacement, but they do so manually: first you do Graph::clearReplacements()
+    // and then you set, and use, replacement's yourself.
+    //
+    // Bottom line: don't use these fields unless you initialize them yourself, or by
+    // calling some appropriate methods that initialize them the way you want. Otherwise,
+    // these fields are meaningless.
     union {
         Node* replacement;
+        BasicBlock* owner;
     } misc;
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to