Title: [197725] trunk/Source/_javascript_Core
Revision
197725
Author
[email protected]
Date
2016-03-07 21:56:53 -0800 (Mon, 07 Mar 2016)

Log Message

[JSC] Small clean up of how we use SSA's valuesAtHead
https://bugs.webkit.org/show_bug.cgi?id=155152

Patch by Benjamin Poulain <[email protected]> on 2016-03-07
Reviewed by Filip Pizlo.

liveAtHead and valuesAtHead contain the same nodes,
we do not need the extra look up.

This also opens the way to use the same kind of liveness
analysis as Air (where live values at head do not use a set).

* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::beginBasicBlock):
(JSC::DFG::InPlaceAbstractState::merge):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (197724 => 197725)


--- trunk/Source/_javascript_Core/ChangeLog	2016-03-08 05:39:26 UTC (rev 197724)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-03-08 05:56:53 UTC (rev 197725)
@@ -1,3 +1,20 @@
+2016-03-07  Benjamin Poulain  <[email protected]>
+
+        [JSC] Small clean up of how we use SSA's valuesAtHead
+        https://bugs.webkit.org/show_bug.cgi?id=155152
+
+        Reviewed by Filip Pizlo.
+
+        liveAtHead and valuesAtHead contain the same nodes,
+        we do not need the extra look up.
+
+        This also opens the way to use the same kind of liveness
+        analysis as Air (where live values at head do not use a set).
+
+        * dfg/DFGInPlaceAbstractState.cpp:
+        (JSC::DFG::InPlaceAbstractState::beginBasicBlock):
+        (JSC::DFG::InPlaceAbstractState::merge):
+
 2016-03-07  Brian Burg  <[email protected]>
 
         Web Inspector: the protocol generator should generate factory method stubs for protocol types

Modified: trunk/Source/_javascript_Core/dfg/DFGInPlaceAbstractState.cpp (197724 => 197725)


--- trunk/Source/_javascript_Core/dfg/DFGInPlaceAbstractState.cpp	2016-03-08 05:39:26 UTC (rev 197724)
+++ trunk/Source/_javascript_Core/dfg/DFGInPlaceAbstractState.cpp	2016-03-08 05:56:53 UTC (rev 197725)
@@ -62,10 +62,8 @@
     m_variables = basicBlock->valuesAtHead;
     
     if (m_graph.m_form == SSA) {
-        HashMap<Node*, AbstractValue>::iterator iter = basicBlock->ssa->valuesAtHead.begin();
-        HashMap<Node*, AbstractValue>::iterator end = basicBlock->ssa->valuesAtHead.end();
-        for (; iter != end; ++iter)
-            forNode(iter->key) = iter->value;
+        for (auto& entry : basicBlock->ssa->valuesAtHead)
+            forNode(entry.key) = entry.value;
     }
     basicBlock->cfaShouldRevisit = false;
     basicBlock->cfaHasVisited = true;
@@ -300,17 +298,16 @@
     case SSA: {
         for (size_t i = from->valuesAtTail.size(); i--;)
             changed |= to->valuesAtHead[i].merge(from->valuesAtTail[i]);
-        
-        HashSet<Node*>::iterator iter = to->ssa->liveAtHead.begin();
-        HashSet<Node*>::iterator end = to->ssa->liveAtHead.end();
-        for (; iter != end; ++iter) {
-            Node* node = *iter;
+
+        for (auto& entry : to->ssa->valuesAtHead) {
+            Node* node = entry.key;
             if (verbose)
-                dataLog("      Merging for ", node, ": from ", from->ssa->valuesAtTail.find(node)->value, " to ", to->ssa->valuesAtHead.find(node)->value, "\n");
-            changed |= to->ssa->valuesAtHead.find(node)->value.merge(
+                dataLog("      Merging for ", node, ": from ", from->ssa->valuesAtTail.find(node)->value, " to ", entry.value, "\n");
+            changed |= entry.value.merge(
                 from->ssa->valuesAtTail.find(node)->value);
+
             if (verbose)
-                dataLog("         Result: ", to->ssa->valuesAtHead.find(node)->value, "\n");
+                dataLog("         Result: ", entry.value, "\n");
         }
         break;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to