diff options
Diffstat (limited to 'Source/JavaScriptCore')
-rw-r--r-- | Source/JavaScriptCore/dfg/DFGNodeFlags.h | 2 | ||||
-rw-r--r-- | Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGNodeFlags.h b/Source/JavaScriptCore/dfg/DFGNodeFlags.h index 5e41bfc6b..463451c39 100644 --- a/Source/JavaScriptCore/dfg/DFGNodeFlags.h +++ b/Source/JavaScriptCore/dfg/DFGNodeFlags.h @@ -54,7 +54,7 @@ namespace JSC { namespace DFG { #define NodeBackPropMask 0x3C00 #define NodeUseBottom 0x000 -#define NodeUsedAsNumber 0x400 // The result of this computation may be used in a context that observes fractional results. +#define NodeUsedAsNumber 0x400 // The result of this computation may be used in a context that observes fractional, or bigger-than-int32, results. #define NodeNeedsNegZero 0x800 // The result of this computation may be used in a context that observes -0. #define NodeUsedAsOther 0x1000 // The result of this computation may be used in a context that distinguishes between NaN and other things (like undefined). #define NodeUsedAsValue (NodeUsedAsNumber | NodeNeedsNegZero | NodeUsedAsOther) diff --git a/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp b/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp index 5b6c28ff7..4226fcc6a 100644 --- a/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp +++ b/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp @@ -211,7 +211,13 @@ private: case SetLocal: { VariableAccessData* variableAccessData = node.variableAccessData(); changed |= variableAccessData->predict(m_graph[node.child1()].prediction()); - changed |= m_graph[node.child1()].mergeFlags(variableAccessData->flags()); + + // Assume conservatively that a SetLocal implies that the value may flow through a loop, + // and so we would have overflow leading to the program "observing" numbers even if all + // users of the value are doing toInt32. It might be worthwhile to revisit this at some + // point and actually check if the data flow involves loops, but right now I don't think + // we have evidence that this would be beneficial for benchmarks. + changed |= m_graph[node.child1()].mergeFlags(variableAccessData->flags() | NodeUsedAsNumber); break; } |