Chromium Code Reviews| Index: src/x64/lithium-codegen-x64.cc |
| diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
| index 293a1db6150d5825390f27df9c5bb67062f0aa82..302bb22bedb6157ac894287aef46f67c834c2312 100644 |
| --- a/src/x64/lithium-codegen-x64.cc |
| +++ b/src/x64/lithium-codegen-x64.cc |
| @@ -2069,7 +2069,16 @@ void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| __ movq(result, ContextOperand(context, instr->slot_index())); |
| if (instr->hydrogen()->RequiresHoleCheck()) { |
| __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
| - 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); |
| + |
|
fschneider
2011/12/13 16:15:00
Remove extra blank line.
|
| + __ movq(result, factory()->undefined_value(), RelocInfo::NONE); |
| + |
|
fschneider
2011/12/13 16:15:00
Also no need for blank line here.
|
| + __ bind(&is_not_hole); |
| + } |
| } |
| } |
| @@ -2077,12 +2086,20 @@ void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
| Register context = ToRegister(instr->context()); |
| Register value = ToRegister(instr->value()); |
| + |
| Operand target = ContextOperand(context, instr->slot_index()); |
| + |
| + Label skip_assignment; |
| if (instr->hydrogen()->RequiresHoleCheck()) { |
| __ CompareRoot(target, Heap::kTheHoleValueRootIndex); |
| - DeoptimizeIf(equal, instr->environment()); |
| + if (instr->hydrogen()->DeoptimizesOnHole()) { |
| + DeoptimizeIf(equal, instr->environment()); |
| + } else { |
| + __ j(not_equal, &skip_assignment, Label::kNear); |
| + } |
| } |
| __ movq(target, value); |
| + |
| if (instr->hydrogen()->NeedsWriteBarrier()) { |
| HType type = instr->hydrogen()->value()->type(); |
| SmiCheck check_needed = |
| @@ -2097,6 +2114,8 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
| EMIT_REMEMBERED_SET, |
| check_needed); |
| } |
| + |
| + __ bind(&skip_assignment); |
| } |