DFG graph dump for GetScopedVar should show the correct prediction
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Feb 2012 22:27:32 +0000 (22:27 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Feb 2012 22:27:32 +0000 (22:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77530

Reviewed by Geoff Garen.

GetScopedVar has a heap prediction, not a variable prediction. But it does
have a variable. Hence we need to check for heap predictions before checking
for variable predictions.

* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106497 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGGraph.cpp

index 4b89a05..7b4634d 100644 (file)
@@ -1,3 +1,17 @@
+2012-02-01  Filip Pizlo  <fpizlo@apple.com>
+
+        DFG graph dump for GetScopedVar should show the correct prediction
+        https://bugs.webkit.org/show_bug.cgi?id=77530
+
+        Reviewed by Geoff Garen.
+        
+        GetScopedVar has a heap prediction, not a variable prediction. But it does
+        have a variable. Hence we need to check for heap predictions before checking
+        for variable predictions.
+
+        * dfg/DFGGraph.cpp:
+        (JSC::DFG::Graph::dump):
+
 2012-02-01  Mark Hahnenberg  <mhahnenberg@apple.com>
 
         Replace JSArray destructor with finalizer
index 97f5802..e01bea1 100644 (file)
@@ -261,10 +261,10 @@ void Graph::dump(NodeIndex nodeIndex, CodeBlock* codeBlock)
     if (!skipped) {
         if (node.hasVariableAccessData())
             printf("  predicting %s, double ratio %lf%s", predictionToString(node.variableAccessData()->prediction()), node.variableAccessData()->doubleVoteRatio(), node.variableAccessData()->shouldUseDoubleFormat() ? ", forcing double" : "");
-        else if (node.hasVarNumber())
-            printf("  predicting %s", predictionToString(getGlobalVarPrediction(node.varNumber())));
         else if (node.hasHeapPrediction())
             printf("  predicting %s", predictionToString(node.getHeapPrediction()));
+        else if (node.hasVarNumber())
+            printf("  predicting %s", predictionToString(getGlobalVarPrediction(node.varNumber())));
     }
     
     printf("\n");