Index: src/crankshaft/ia32/lithium-ia32.cc |
diff --git a/src/crankshaft/ia32/lithium-ia32.cc b/src/crankshaft/ia32/lithium-ia32.cc |
index ca47998bff58d73d013e26fc4a4a8b05056c59b5..7272a9112face14682439be4ba3d1b87601f597b 100644 |
--- a/src/crankshaft/ia32/lithium-ia32.cc |
+++ b/src/crankshaft/ia32/lithium-ia32.cc |
@@ -1985,7 +1985,12 @@ LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { |
LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { |
LOperand* context = UseRegisterAtStart(instr->value()); |
- return DefineAsRegister(new (zone()) LLoadContextSlot(context)); |
+ LInstruction* result = |
+ DefineAsRegister(new(zone()) LLoadContextSlot(context)); |
+ if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { |
+ result = AssignEnvironment(result); |
+ } |
+ return result; |
} |
@@ -2000,7 +2005,11 @@ LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { |
value = UseRegister(instr->value()); |
temp = NULL; |
} |
- return new (zone()) LStoreContextSlot(context, value, temp); |
+ LInstruction* result = new(zone()) LStoreContextSlot(context, value, temp); |
+ if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { |
+ result = AssignEnvironment(result); |
+ } |
+ return result; |
} |