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..788348104110b5bfec90e9ed627c194171fe03b9 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -2165,9 +2165,17 @@ 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); |
+ __ mov(result, factory()->undefined_value()); |
+ __ bind(&is_not_hole); |
+ } |
} |
} |
@@ -2175,11 +2183,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 +2211,8 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
EMIT_REMEMBERED_SET, |
check_needed); |
} |
+ |
+ __ bind(&skip_assignment); |
} |