Title: [108652] trunk/Source/_javascript_Core
Revision
108652
Author
[email protected]
Date
2012-02-23 11:45:38 -0800 (Thu, 23 Feb 2012)

Log Message

DFG's logic for emitting a Flush is too convoluted and contains an inaccurate comment
https://bugs.webkit.org/show_bug.cgi?id=79334

Reviewed by Oliver Hunt.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::getLocal):
(JSC::DFG::ByteCodeParser::getArgument):
(JSC::DFG::ByteCodeParser::flush):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (108651 => 108652)


--- trunk/Source/_javascript_Core/ChangeLog	2012-02-23 19:43:07 UTC (rev 108651)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-02-23 19:45:38 UTC (rev 108652)
@@ -1,3 +1,15 @@
+2012-02-22  Filip Pizlo  <[email protected]>
+
+        DFG's logic for emitting a Flush is too convoluted and contains an inaccurate comment
+        https://bugs.webkit.org/show_bug.cgi?id=79334
+
+        Reviewed by Oliver Hunt.
+
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::getLocal):
+        (JSC::DFG::ByteCodeParser::getArgument):
+        (JSC::DFG::ByteCodeParser::flush):
+
 2012-02-23  Gavin Barraclough  <[email protected]>
 
         Object.isSealed / Object.isFrozen don't work for native objects

Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (108651 => 108652)


--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2012-02-23 19:43:07 UTC (rev 108651)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2012-02-23 19:45:38 UTC (rev 108652)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -176,6 +176,7 @@
                 }
                 nodePtr = &flushChild;
             }
+            ASSERT(nodePtr->op != Flush);
             if (nodePtr->op == GetLocal)
                 return nodeIndex;
             ASSERT(nodePtr->op == SetLocal);
@@ -225,6 +226,9 @@
                 }
                 nodePtr = &flushChild;
             }
+            
+            ASSERT(nodePtr->op != Flush);
+            
             if (nodePtr->op == SetArgument) {
                 // We're getting an argument in the first basic block; link
                 // the GetLocal to the SetArgument.
@@ -282,13 +286,10 @@
         
         if (nodeIndex != NoNode) {
             Node& node = m_graph[nodeIndex];
-            if (node.op == Flush || node.op == SetArgument) {
-                // If a local has already been flushed, or if it's an argument in the
-                // first basic block, then there is really no need to flush it. In fact
-                // emitting a Flush instruction could just confuse things, since the
-                // getArgument() code assumes that we never see a Flush of a SetArgument.
-                return;
-            }
+            if (node.op == Flush)
+                nodeIndex = node.child1().index();
+            
+            ASSERT(m_graph[nodeIndex].op != Flush);
         
             addToGraph(Flush, OpInfo(node.variableAccessData()), nodeIndex);
             return;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to