diff options
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp')
-rw-r--r-- | Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp b/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp index a8eb9ee5c..68d5534e0 100644 --- a/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp +++ b/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp @@ -91,7 +91,16 @@ private: break; } - // FIXME: This would be a great place to remove CheckStructure's. + case CheckStructure: + case ForwardCheckStructure: { + AbstractValue& value = m_state.forNode(node.child1()); + StructureAbstractValue& structureValue = value.m_futurePossibleStructure; + if (structureValue.isSubsetOf(node.structureSet()) + && structureValue.hasSingleton() + && isCellSpeculation(value.m_type)) + node.convertToStructureTransitionWatchpoint(structureValue.singleton()); + break; + } default: break; @@ -103,9 +112,7 @@ private: } m_state.execute(indexInBlock); - if (!node.shouldGenerate() - || m_state.didClobber() - || node.hasConstant()) + if (!node.shouldGenerate() || m_state.didClobber() || node.hasConstant()) continue; JSValue value = m_state.forNode(nodeIndex).value(); if (!value) |