Chromium Code Reviews| Index: src/mips/lithium-codegen-mips.cc |
| diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc |
| index aba7516fa2650b6cfdc840b548a39467781c7724..6cc8fa7f216b1529a4436243702b68191c225e46 100644 |
| --- a/src/mips/lithium-codegen-mips.cc |
| +++ b/src/mips/lithium-codegen-mips.cc |
| @@ -2183,7 +2183,14 @@ void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| __ lw(result, ContextOperand(context, instr->slot_index())); |
| if (instr->hydrogen()->RequiresHoleCheck()) { |
| __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
| - DeoptimizeIf(eq, instr->environment(), result, Operand(at)); |
| + if (instr->hydrogen()->DeoptimizesOnHole()) { |
| + DeoptimizeIf(eq, instr->environment(), result, Operand(at)); |
| + } else { |
|
Steven
2011/12/12 13:12:44
You can also introduce a conditional move here. Co
|
| + Label is_not_hole; |
| + __ Branch(&is_not_hole, ne, result, Operand(at)); |
| + __ li(result, Operand(factory()->undefined_value())); |
| + __ bind(&is_not_hole); |
| + } |
| } |
| } |
| @@ -2191,13 +2198,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(); |
| __ lw(scratch, target); |
| __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
| - DeoptimizeIf(eq, instr->environment(), scratch, Operand(at)); |
| + |
| + if (instr->hydrogen()->DeoptimizesOnHole()) { |
| + DeoptimizeIf(eq, instr->environment(), scratch, Operand(at)); |
| + } else { |
| + __ Branch(&skip_assignment, ne, scratch, Operand(at)); |
| + } |
| } |
| + |
| __ sw(value, target); |
| if (instr->hydrogen()->NeedsWriteBarrier()) { |
| HType type = instr->hydrogen()->value()->type(); |
| @@ -2212,6 +2228,8 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
| EMIT_REMEMBERED_SET, |
| check_needed); |
| } |
| + |
| + __ bind(&skip_assignment); |
| } |