Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index 08868f536223572d716ab69c0b6b6acf09961830..f405e330d90c029ea3a02b8c957b26f0b1b56d37 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -2317,6 +2317,11 @@ void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
Register context = ToRegister(instr->context()); |
Register result = ToRegister(instr->result()); |
__ ldr(result, ContextOperand(context, instr->slot_index())); |
+ if (instr->hydrogen()->RequiresHoleCheck()) { |
+ __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
+ __ cmp(result, ip); |
+ DeoptimizeIf(eq, instr->environment()); |
+ } |
} |
@@ -2324,6 +2329,13 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
Register context = ToRegister(instr->context()); |
Register value = ToRegister(instr->value()); |
MemOperand target = ContextOperand(context, instr->slot_index()); |
+ if (instr->hydrogen()->RequiresHoleCheck()) { |
+ Register scratch = scratch0(); |
+ __ ldr(scratch, target); |
+ __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
+ __ cmp(scratch, ip); |
+ DeoptimizeIf(eq, instr->environment()); |
+ } |
__ str(value, target); |
if (instr->hydrogen()->NeedsWriteBarrier()) { |
HType type = instr->hydrogen()->value()->type(); |