Chromium Code Reviews| Index: src/ia32/lithium-codegen-ia32.cc |
| diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
| index 23db874067c928394da6b5c1bea8389458cad2ce..5a91a2cdfccdfbb0f7b622922ccf524b468bd1ef 100644 |
| --- a/src/ia32/lithium-codegen-ia32.cc |
| +++ b/src/ia32/lithium-codegen-ia32.cc |
| @@ -2165,9 +2165,19 @@ void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| Register context = ToRegister(instr->context()); |
| Register result = ToRegister(instr->result()); |
| __ mov(result, ContextOperand(context, instr->slot_index())); |
| + |
| if (instr->hydrogen()->RequiresHoleCheck()) { |
| __ cmp(result, factory()->the_hole_value()); |
| - DeoptimizeIf(equal, instr->environment()); |
| + if (instr->hydrogen()->DeoptimizesOnHole()) { |
| + DeoptimizeIf(equal, instr->environment()); |
| + } else { |
| + Label is_not_hole; |
| + __ j(not_equal, &is_not_hole, Label::kNear); |
| + |
|
Steven
2011/12/12 13:12:44
Those blank lines do not help readability. Could y
|
| + __ mov(result, factory()->undefined_value()); |
| + |
| + __ bind(&is_not_hole); |
| + } |
| } |
| } |
| @@ -2175,11 +2185,19 @@ void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
| Register context = ToRegister(instr->context()); |
| Register value = ToRegister(instr->value()); |
| + |
| + Label skip_assignment; |
| + |
| Operand target = ContextOperand(context, instr->slot_index()); |
| if (instr->hydrogen()->RequiresHoleCheck()) { |
| __ cmp(target, factory()->the_hole_value()); |
| - DeoptimizeIf(equal, instr->environment()); |
| + if (instr->hydrogen()->DeoptimizesOnHole()) { |
| + DeoptimizeIf(equal, instr->environment()); |
| + } else { |
| + __ j(not_equal, &skip_assignment, Label::kNear); |
| + } |
| } |
| + |
| __ mov(target, value); |
| if (instr->hydrogen()->NeedsWriteBarrier()) { |
| HType type = instr->hydrogen()->value()->type(); |
| @@ -2195,6 +2213,8 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
| EMIT_REMEMBERED_SET, |
| check_needed); |
| } |
| + |
| + __ bind(&skip_assignment); |
| } |