Chromium Code Reviews| Index: src/arm/lithium-codegen-arm.cc |
| diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
| index 25532a2d959f982176fc03bbd6d69506e18e7e62..0f350f654bf8c86ee3ccf1a21c16d2b38a30401a 100644 |
| --- a/src/arm/lithium-codegen-arm.cc |
| +++ b/src/arm/lithium-codegen-arm.cc |
| @@ -2306,7 +2306,16 @@ void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| if (instr->hydrogen()->RequiresHoleCheck()) { |
| __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
| __ cmp(result, ip); |
| - DeoptimizeIf(eq, instr->environment()); |
| + if (instr->hydrogen()->DeoptimizesOnHole()) { |
| + DeoptimizeIf(eq, instr->environment()); |
| + } else { |
|
Steven
2011/12/12 13:12:44
You can do better here and use a conditional move
|
| + Label is_not_hole; |
| + __ b(ne, &is_not_hole); |
| + |
| + __ mov(result, Operand(factory()->undefined_value())); |
| + |
| + __ bind(&is_not_hole); |
| + } |
| } |
| } |
| @@ -2314,14 +2323,22 @@ void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
| Register context = ToRegister(instr->context()); |
| Register value = ToRegister(instr->value()); |
| + Register scratch = scratch0(); |
| MemOperand target = ContextOperand(context, instr->slot_index()); |
| + |
| + Label skip_assignment; |
| + |
| if (instr->hydrogen()->RequiresHoleCheck()) { |
| - Register scratch = scratch0(); |
| __ ldr(scratch, target); |
| __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
| __ cmp(scratch, ip); |
| - DeoptimizeIf(eq, instr->environment()); |
| + if (instr->hydrogen()->DeoptimizesOnHole()) { |
| + DeoptimizeIf(eq, instr->environment()); |
| + } else { |
| + __ b(ne, &skip_assignment); |
| + } |
| } |
| + |
| __ str(value, target); |
| if (instr->hydrogen()->NeedsWriteBarrier()) { |
| HType type = instr->hydrogen()->value()->type(); |
| @@ -2330,12 +2347,14 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
| __ RecordWriteContextSlot(context, |
| target.offset(), |
| value, |
| - scratch0(), |
| + scratch, |
| kLRHasBeenSaved, |
| kSaveFPRegs, |
| EMIT_REMEMBERED_SET, |
| check_needed); |
| } |
| + |
| + __ bind(&skip_assignment); |
| } |