Index: src/crankshaft/mips/lithium-mips.cc |
diff --git a/src/crankshaft/mips/lithium-mips.cc b/src/crankshaft/mips/lithium-mips.cc |
index 544b6612f725929837610b0f8a56269353ff6a95..26d422a710b35689df5cbcbdee88bbf1300b1809 100644 |
--- a/src/crankshaft/mips/lithium-mips.cc |
+++ b/src/crankshaft/mips/lithium-mips.cc |
@@ -1922,7 +1922,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; |
} |
@@ -1936,7 +1941,11 @@ LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { |
context = UseRegister(instr->context()); |
value = UseRegister(instr->value()); |
} |
- return new (zone()) LStoreContextSlot(context, value); |
+ LInstruction* result = new(zone()) LStoreContextSlot(context, value); |
+ if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { |
+ result = AssignEnvironment(result); |
+ } |
+ return result; |
} |