summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp')
-rw-r--r--Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp b/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp
index eb04a6747..dec2e49f7 100644
--- a/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp
@@ -99,6 +99,8 @@ public:
case PutByVal:
case PutByValAlias:
case GetArrayLength:
+ case CheckArray:
+ case GetIndexedPropertyStorage:
case Phantom:
// Don't count these uses.
break;
@@ -128,6 +130,50 @@ public:
#endif
iter->second.m_structure = 0;
}
+
+ // Disable structure check hoisting for variables that cross the OSR entry that
+ // we're currently taking, and where the value currently does not have the
+ // structure we want.
+
+ for (BlockIndex blockIndex = 0; blockIndex < m_graph.m_blocks.size(); ++blockIndex) {
+ BasicBlock* block = m_graph.m_blocks[blockIndex].get();
+ if (!block)
+ continue;
+ ASSERT(block->isReachable);
+ if (!block->isOSRTarget)
+ continue;
+ if (block->bytecodeBegin != m_graph.m_osrEntryBytecodeIndex)
+ continue;
+ for (size_t i = 0; i < m_graph.m_mustHandleValues.size(); ++i) {
+ int operand = m_graph.m_mustHandleValues.operandForIndex(i);
+ NodeIndex nodeIndex = block->variablesAtHead.operand(operand);
+ if (nodeIndex == NoNode)
+ continue;
+ VariableAccessData* variable = m_graph[nodeIndex].variableAccessData();
+ HashMap<VariableAccessData*, CheckData>::iterator iter = m_map.find(variable);
+ if (iter == m_map.end())
+ continue;
+ if (!iter->second.m_structure)
+ continue;
+ JSValue value = m_graph.m_mustHandleValues[i];
+ if (!value || !value.isCell()) {
+#if DFG_ENABLE(DEBUG_PROPAGATION_VERBOSE)
+ dataLog("Zeroing the structure to hoist for %s because the OSR entry value is not a cell: %s.\n",
+ m_graph.nameOfVariableAccessData(variable), value.description());
+#endif
+ iter->second.m_structure = 0;
+ continue;
+ }
+ if (value.asCell()->structure() != iter->second.m_structure) {
+#if DFG_ENABLE(DEBUG_PROPAGATION_VERBOSE)
+ dataLog("Zeroing the structure to hoist for %s because the OSR entry value has structure %p and we wanted %p.\n",
+ m_graph.nameOfVariableAccessData(variable), value.asCell()->structure(), iter->second.m_structure);
+#endif
+ iter->second.m_structure = 0;
+ continue;
+ }
+ }
+ }
// Identify the set of variables that are live across a structure clobber.