Title: [152151] branches/dfgFourthTier/Source/_javascript_Core
- Revision
- 152151
- Author
- [email protected]
- Date
- 2013-06-27 20:31:57 -0700 (Thu, 27 Jun 2013)
Log Message
Make Graph::substituteGetLocal() out-of-line
Rubber stamped by Geoffrey Garen.
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::substituteGetLocal):
(DFG):
* dfg/DFGGraph.h:
(Graph):
Modified Paths
Diff
Modified: branches/dfgFourthTier/Source/_javascript_Core/ChangeLog (152150 => 152151)
--- branches/dfgFourthTier/Source/_javascript_Core/ChangeLog 2013-06-28 02:28:21 UTC (rev 152150)
+++ branches/dfgFourthTier/Source/_javascript_Core/ChangeLog 2013-06-28 03:31:57 UTC (rev 152151)
@@ -1,5 +1,17 @@
2013-06-27 Filip Pizlo <[email protected]>
+ Make Graph::substituteGetLocal() out-of-line
+
+ Rubber stamped by Geoffrey Garen.
+
+ * dfg/DFGGraph.cpp:
+ (JSC::DFG::Graph::substituteGetLocal):
+ (DFG):
+ * dfg/DFGGraph.h:
+ (Graph):
+
+2013-06-27 Filip Pizlo <[email protected]>
+
fourthTier: DFG should know how to find natural loops
https://bugs.webkit.org/show_bug.cgi?id=118152
Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.cpp (152150 => 152151)
--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.cpp 2013-06-28 02:28:21 UTC (rev 152150)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.cpp 2013-06-28 03:31:57 UTC (rev 152151)
@@ -450,6 +450,41 @@
m_naturalLoops.invalidate();
}
+void Graph::substituteGetLocal(BasicBlock& block, unsigned startIndexInBlock, VariableAccessData* variableAccessData, Node* newGetLocal)
+{
+ if (variableAccessData->isCaptured()) {
+ // Let CSE worry about this one.
+ return;
+ }
+ for (unsigned indexInBlock = startIndexInBlock; indexInBlock < block.size(); ++indexInBlock) {
+ Node* node = block[indexInBlock];
+ bool shouldContinue = true;
+ switch (node->op()) {
+ case SetLocal: {
+ if (node->local() == variableAccessData->local())
+ shouldContinue = false;
+ break;
+ }
+
+ case GetLocal: {
+ if (node->variableAccessData() != variableAccessData)
+ continue;
+ substitute(block, indexInBlock, node, newGetLocal);
+ Node* oldTailNode = block.variablesAtTail.operand(variableAccessData->local());
+ if (oldTailNode == node)
+ block.variablesAtTail.operand(variableAccessData->local()) = newGetLocal;
+ shouldContinue = false;
+ break;
+ }
+
+ default:
+ break;
+ }
+ if (!shouldContinue)
+ break;
+ }
+}
+
} } // namespace JSC::DFG
#endif
Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.h (152150 => 152151)
--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.h 2013-06-28 02:28:21 UTC (rev 152150)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.h 2013-06-28 03:31:57 UTC (rev 152151)
@@ -642,40 +642,7 @@
// any GetLocals in the basic block.
// FIXME: it may be appropriate, in the future, to generalize this to handle GetLocals
// introduced anywhere in the basic block.
- void substituteGetLocal(BasicBlock& block, unsigned startIndexInBlock, VariableAccessData* variableAccessData, Node* newGetLocal)
- {
- if (variableAccessData->isCaptured()) {
- // Let CSE worry about this one.
- return;
- }
- for (unsigned indexInBlock = startIndexInBlock; indexInBlock < block.size(); ++indexInBlock) {
- Node* node = block[indexInBlock];
- bool shouldContinue = true;
- switch (node->op()) {
- case SetLocal: {
- if (node->local() == variableAccessData->local())
- shouldContinue = false;
- break;
- }
-
- case GetLocal: {
- if (node->variableAccessData() != variableAccessData)
- continue;
- substitute(block, indexInBlock, node, newGetLocal);
- Node* oldTailNode = block.variablesAtTail.operand(variableAccessData->local());
- if (oldTailNode == node)
- block.variablesAtTail.operand(variableAccessData->local()) = newGetLocal;
- shouldContinue = false;
- break;
- }
-
- default:
- break;
- }
- if (!shouldContinue)
- break;
- }
- }
+ void substituteGetLocal(BasicBlock& block, unsigned startIndexInBlock, VariableAccessData* variableAccessData, Node* newGetLocal);
void invalidateCFG();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes