| Index: src/full-codegen/ia32/full-codegen-ia32.cc
|
| diff --git a/src/full-codegen/ia32/full-codegen-ia32.cc b/src/full-codegen/ia32/full-codegen-ia32.cc
|
| index c3467062e161e59d34dc7a795c1f0d71f0b46c09..66ada7986ec6a794e1ebfa3cf2b80b7778bc70b7 100644
|
| --- a/src/full-codegen/ia32/full-codegen-ia32.cc
|
| +++ b/src/full-codegen/ia32/full-codegen-ia32.cc
|
| @@ -1195,10 +1195,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));
|
| @@ -1224,9 +1223,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);
|
| @@ -1248,19 +1247,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
|
|
|