Index: src/crankshaft/x87/lithium-x87.cc |
diff --git a/src/crankshaft/x87/lithium-x87.cc b/src/crankshaft/x87/lithium-x87.cc |
index 2714f55a5575e46106164a6e1a3a0c7fc6502ed5..1844d241179df023f3d5933a5404250de478e67a 100644 |
--- a/src/crankshaft/x87/lithium-x87.cc |
+++ b/src/crankshaft/x87/lithium-x87.cc |
@@ -1981,7 +1981,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; |
} |
@@ -1996,7 +2001,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; |
} |