Index: src/full-codegen/x87/full-codegen-x87.cc |
diff --git a/src/full-codegen/x87/full-codegen-x87.cc b/src/full-codegen/x87/full-codegen-x87.cc |
index fadbf4d449a0723649e525e20eaac7b004e42cc5..0d2a44c536eae42e62532710466e7b858ae14545 100644 |
--- a/src/full-codegen/x87/full-codegen-x87.cc |
+++ b/src/full-codegen/x87/full-codegen-x87.cc |
@@ -1187,10 +1187,9 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, |
while (s != NULL) { |
if (s->num_heap_slots() > 0) { |
if (s->calls_sloppy_eval()) { |
- // Check that extension is NULL. |
- __ cmp(ContextOperand(context, Context::EXTENSION_INDEX), |
- Immediate(0)); |
- __ j(not_equal, slow); |
+ // Check that extension is "the hole". |
+ __ JumpIfNotRoot(ContextOperand(context, Context::EXTENSION_INDEX), |
+ Heap::kTheHoleValueRootIndex, slow); |
} |
// Load next context in chain. |
__ mov(temp, ContextOperand(context, Context::PREVIOUS_INDEX)); |
@@ -1216,9 +1215,9 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, |
__ cmp(FieldOperand(temp, HeapObject::kMapOffset), |
Immediate(isolate()->factory()->native_context_map())); |
__ j(equal, &fast, Label::kNear); |
- // Check that extension is NULL. |
- __ cmp(ContextOperand(temp, Context::EXTENSION_INDEX), Immediate(0)); |
- __ j(not_equal, slow); |
+ // Check that extension is "the hole". |
+ __ JumpIfNotRoot(ContextOperand(temp, Context::EXTENSION_INDEX), |
+ Heap::kTheHoleValueRootIndex, slow); |
// Load next context in chain. |
__ mov(temp, ContextOperand(temp, Context::PREVIOUS_INDEX)); |
__ jmp(&next); |
@@ -1240,19 +1239,18 @@ MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
for (Scope* s = scope(); s != var->scope(); s = s->outer_scope()) { |
if (s->num_heap_slots() > 0) { |
if (s->calls_sloppy_eval()) { |
- // Check that extension is NULL. |
- __ cmp(ContextOperand(context, Context::EXTENSION_INDEX), |
- Immediate(0)); |
- __ j(not_equal, slow); |
+ // Check that extension is "the hole". |
+ __ JumpIfNotRoot(ContextOperand(context, Context::EXTENSION_INDEX), |
+ Heap::kTheHoleValueRootIndex, slow); |
} |
__ mov(temp, ContextOperand(context, Context::PREVIOUS_INDEX)); |
// Walk the rest of the chain without clobbering esi. |
context = temp; |
} |
} |
- // Check that last extension is NULL. |
- __ cmp(ContextOperand(context, Context::EXTENSION_INDEX), Immediate(0)); |
- __ j(not_equal, slow); |
+ // Check that last extension is "the hole". |
+ __ JumpIfNotRoot(ContextOperand(context, Context::EXTENSION_INDEX), |
+ Heap::kTheHoleValueRootIndex, slow); |
// This function is used only for loads, not stores, so it's safe to |
// return an esi-based operand (the write barrier cannot be allowed to |