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

Log Message

fourthTier: CFA should consider live-at-head for clobbering and dumping
https://bugs.webkit.org/show_bug.cgi?id=118857

Reviewed by Mark Hahnenberg.

- clobberStructures() was not considering nodes live-at-head when in SSA
  form. This means it would fail to clobber some structures.

- dump() was not considering nodes live-at-head when in SSA form. This
  means it wouldn't dump everything that you might be interested in.

- AbstractState::m_currentNode is a useless variable and we should get
  rid of it.

* dfg/DFGAbstractState.cpp:
(JSC::DFG::AbstractState::AbstractState):
(JSC::DFG::AbstractState::beginBasicBlock):
(JSC::DFG::AbstractState::reset):
(JSC::DFG::AbstractState::startExecuting):
(JSC::DFG::AbstractState::clobberStructures):
(JSC::DFG::AbstractState::dump):
* dfg/DFGAbstractState.h:
(AbstractState):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (153279 => 153280)


--- trunk/Source/_javascript_Core/ChangeLog	2013-07-25 04:04:55 UTC (rev 153279)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-07-25 04:04:57 UTC (rev 153280)
@@ -1,3 +1,29 @@
+2013-07-18  Filip Pizlo  <[email protected]>
+
+        fourthTier: CFA should consider live-at-head for clobbering and dumping
+        https://bugs.webkit.org/show_bug.cgi?id=118857
+
+        Reviewed by Mark Hahnenberg.
+        
+        - clobberStructures() was not considering nodes live-at-head when in SSA
+          form. This means it would fail to clobber some structures.
+        
+        - dump() was not considering nodes live-at-head when in SSA form. This
+          means it wouldn't dump everything that you might be interested in.
+        
+        - AbstractState::m_currentNode is a useless variable and we should get
+          rid of it.
+
+        * dfg/DFGAbstractState.cpp:
+        (JSC::DFG::AbstractState::AbstractState):
+        (JSC::DFG::AbstractState::beginBasicBlock):
+        (JSC::DFG::AbstractState::reset):
+        (JSC::DFG::AbstractState::startExecuting):
+        (JSC::DFG::AbstractState::clobberStructures):
+        (JSC::DFG::AbstractState::dump):
+        * dfg/DFGAbstractState.h:
+        (AbstractState):
+
 2013-07-16  Filip Pizlo  <[email protected]>
 
         fourthTier: Add a phase to create loop pre-headers

Modified: trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp (153279 => 153280)


--- trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp	2013-07-25 04:04:55 UTC (rev 153279)
+++ trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp	2013-07-25 04:04:57 UTC (rev 153280)
@@ -42,7 +42,6 @@
     , m_graph(graph)
     , m_variables(m_codeBlock->numParameters(), graph.m_localVars)
     , m_block(0)
-    , m_currentNode(0)
 {
 }
 
@@ -90,7 +89,6 @@
     m_isValid = true;
     m_foundConstants = false;
     m_branchDirection = InvalidBranchDirection;
-    m_currentNode = 0;
 }
 
 static void setLiveValues(HashMap<Node*, AbstractValue>& values, HashSet<Node*>& live)
@@ -262,7 +260,6 @@
     m_block = 0;
     m_isValid = false;
     m_branchDirection = InvalidBranchDirection;
-    m_currentNode = 0;
 }
 
 AbstractState::BooleanResult AbstractState::booleanResult(Node* node, AbstractValue& value)
@@ -295,13 +292,7 @@
     
     node->setCanExit(false);
     
-    if (!node->shouldGenerate()) {
-        m_currentNode = 0;
-        return false;
-    }
-    
-    m_currentNode = node;
-    return true;
+    return node->shouldGenerate();
 }
 
 bool AbstractState::startExecuting(unsigned indexInBlock)
@@ -1771,6 +1762,12 @@
         return;
     for (size_t i = indexInBlock + 1; i--;)
         forNode(m_block->at(i)).clobberStructures();
+    if (m_graph.m_form == SSA) {
+        HashSet<Node*>::iterator iter = m_block->ssa->liveAtHead.begin();
+        HashSet<Node*>::iterator end = m_block->ssa->liveAtHead.end();
+        for (; iter != end; ++iter)
+            forNode(*iter).clobberStructures();
+    }
     for (size_t i = m_variables.numberOfArguments(); i--;)
         m_variables.argument(i).clobberStructures();
     for (size_t i = m_variables.numberOfLocals(); i--;)
@@ -1983,18 +1980,24 @@
 
 void AbstractState::dump(PrintStream& out)
 {
-    bool first = true;
+    CommaPrinter comma(" ");
+    if (m_graph.m_form == SSA) {
+        HashSet<Node*>::iterator iter = m_block->ssa->liveAtHead.begin();
+        HashSet<Node*>::iterator end = m_block->ssa->liveAtHead.end();
+        for (; iter != end; ++iter) {
+            Node* node = *iter;
+            AbstractValue& value = forNode(node);
+            if (value.isClear())
+                continue;
+            out.print(comma, node, ":", value);
+        }
+    }
     for (size_t i = 0; i < m_block->size(); ++i) {
         Node* node = m_block->at(i);
         AbstractValue& value = forNode(node);
         if (value.isClear())
             continue;
-        if (first)
-            first = false;
-        else
-            out.printf(" ");
-        out.printf("@%lu:", static_cast<unsigned long>(node->index()));
-        value.dump(out);
+        out.print(comma, node, ":", value);
     }
 }
 

Modified: trunk/Source/_javascript_Core/dfg/DFGAbstractState.h (153279 => 153280)


--- trunk/Source/_javascript_Core/dfg/DFGAbstractState.h	2013-07-25 04:04:55 UTC (rev 153279)
+++ trunk/Source/_javascript_Core/dfg/DFGAbstractState.h	2013-07-25 04:04:57 UTC (rev 153280)
@@ -313,7 +313,6 @@
     
     Operands<AbstractValue> m_variables;
     BasicBlock* m_block;
-    Node* m_currentNode;
     
     bool m_haveStructures;
     bool m_foundConstants;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to