Title: [152958] branches/dfgFourthTier/Source/_javascript_Core
- Revision
- 152958
- Author
- [email protected]
- Date
- 2013-07-21 20:57:32 -0700 (Sun, 21 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: branches/dfgFourthTier/Source/_javascript_Core/ChangeLog (152957 => 152958)
--- branches/dfgFourthTier/Source/_javascript_Core/ChangeLog 2013-07-22 03:36:59 UTC (rev 152957)
+++ branches/dfgFourthTier/Source/_javascript_Core/ChangeLog 2013-07-22 03:57:32 UTC (rev 152958)
@@ -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: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.cpp (152957 => 152958)
--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.cpp 2013-07-22 03:36:59 UTC (rev 152957)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.cpp 2013-07-22 03:57:32 UTC (rev 152958)
@@ -546,6 +546,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: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.h (152957 => 152958)
--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.h 2013-07-22 03:36:59 UTC (rev 152957)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.h 2013-07-22 03:57:32 UTC (rev 152958)
@@ -647,6 +647,7 @@
void invalidateCFG();
void clearReplacements();
+ void initializeNodeOwners();
void getBlocksInDepthFirstOrder(Vector<BasicBlock*>& result);
Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGNode.h (152957 => 152958)
--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGNode.h 2013-07-22 03:36:59 UTC (rev 152957)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGNode.h 2013-07-22 03:57:32 UTC (rev 152958)
@@ -1399,8 +1399,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