| Index: src/ia32/full-codegen-ia32.cc
|
| ===================================================================
|
| --- src/ia32/full-codegen-ia32.cc (revision 6437)
|
| +++ src/ia32/full-codegen-ia32.cc (working copy)
|
| @@ -142,7 +142,7 @@
|
| bool function_in_register = true;
|
|
|
| // Possibly allocate a local context.
|
| - int heap_slots = scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
|
| + int heap_slots = scope()->num_heap_slots();
|
| if (heap_slots > 0) {
|
| Comment cmnt(masm_, "[ Allocate local context");
|
| // Argument to NewContext is the function, which is still in edi.
|
| @@ -2339,16 +2339,21 @@
|
| // Call to a keyed property.
|
| // For a synthetic property use keyed load IC followed by function call,
|
| // for a regular property use keyed EmitCallIC.
|
| - { PreservePositionScope scope(masm()->positions_recorder());
|
| - VisitForStackValue(prop->obj());
|
| - }
|
| if (prop->is_synthetic()) {
|
| - { PreservePositionScope scope(masm()->positions_recorder());
|
| - VisitForAccumulatorValue(prop->key());
|
| - }
|
| + // Do not visit the object and key subexpressions (they are shared
|
| + // by all occurrences of the same rewritten parameter).
|
| + ASSERT(prop->obj()->AsVariableProxy() != NULL);
|
| + ASSERT(prop->obj()->AsVariableProxy()->var()->AsSlot() != NULL);
|
| + Slot* slot = prop->obj()->AsVariableProxy()->var()->AsSlot();
|
| + MemOperand operand = EmitSlotSearch(slot, edx);
|
| + __ mov(edx, operand);
|
| +
|
| + ASSERT(prop->key()->AsLiteral() != NULL);
|
| + ASSERT(prop->key()->AsLiteral()->handle()->IsSmi());
|
| + __ mov(eax, prop->key()->AsLiteral()->handle());
|
| +
|
| // Record source code position for IC call.
|
| SetSourcePosition(prop->position());
|
| - __ pop(edx); // We do not need to keep the receiver.
|
|
|
| Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
|
| EmitCallIC(ic, RelocInfo::CODE_TARGET);
|
| @@ -2359,6 +2364,9 @@
|
| __ push(FieldOperand(ecx, GlobalObject::kGlobalReceiverOffset));
|
| EmitCallWithStub(expr);
|
| } else {
|
| + { PreservePositionScope scope(masm()->positions_recorder());
|
| + VisitForStackValue(prop->obj());
|
| + }
|
| EmitKeyedCallWithIC(expr, prop->key(), RelocInfo::CODE_TARGET);
|
| }
|
| }
|
|
|