| Index: src/ia32/full-codegen-ia32.cc
|
| diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
|
| index 04fb4830c7ee8297e4cfa226d51327e29bb4eb62..bfae9a83fd656127dbf21e5b8d9806966539a96d 100644
|
| --- a/src/ia32/full-codegen-ia32.cc
|
| +++ b/src/ia32/full-codegen-ia32.cc
|
| @@ -1278,6 +1278,34 @@ void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) {
|
| }
|
|
|
|
|
| +void FullCodeGenerator::VisitSuperReference(SuperReference* expr) {
|
| + Comment cnmt(masm_, "[ SuperReference ");
|
| +
|
| + Label super_lookup_failure;
|
| + __ mov(LoadIC::ReceiverRegister(),
|
| + Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
|
| +
|
| + Handle<Symbol> home_object_symbol(isolate()->heap()->home_object_symbol());
|
| + __ mov(LoadIC::NameRegister(), home_object_symbol);
|
| +
|
| + CallLoadIC(NOT_CONTEXTUAL,
|
| + expr->HomeObjectFeedbackId());
|
| +
|
| + __ cmp(eax, isolate()->factory()->undefined_value());
|
| + __ j(equal, &super_lookup_failure);
|
| + __ mov(eax, FieldOperand(eax, HeapObject::kMapOffset));
|
| + __ mov(eax, FieldOperand(eax, Map::kPrototypeOffset));
|
| + Label done;
|
| + __ jmp(&done);
|
| + __ bind(&super_lookup_failure);
|
| + __ push(Immediate(isolate()->factory()->empty_string()));
|
| + __ CallRuntime(Runtime::kThrowReferenceError, 1);
|
| + __ bind(&done);
|
| + context()->Plug(eax);
|
| +}
|
| +
|
| +
|
| +
|
| void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
|
| TypeofState typeof_state,
|
| Label* slow) {
|
| @@ -2220,6 +2248,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
|
| SetSourcePosition(prop->position());
|
| Literal* key = prop->key()->AsLiteral();
|
| DCHECK(!key->value()->IsSmi());
|
| +
|
| __ mov(LoadIC::NameRegister(), Immediate(key->value()));
|
| if (FLAG_vector_ics) {
|
| __ mov(LoadIC::SlotRegister(),
|
| @@ -2568,8 +2597,15 @@ void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) {
|
| EmitNamedPropertyLoad(callee->AsProperty());
|
| PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG);
|
| // Push the target function under the receiver.
|
| - __ push(Operand(esp, 0));
|
| - __ mov(Operand(esp, kPointerSize), eax);
|
| + if (callee->AsProperty()->IsSuperAccess()) {
|
| + __ mov(Operand(esp, 0), eax);
|
| + SuperReference* super_ref =
|
| + callee->AsProperty()->obj()->AsSuperReference();
|
| + VisitForStackValue(super_ref->this_var());
|
| + } else {
|
| + __ push(Operand(esp, 0));
|
| + __ mov(Operand(esp, kPointerSize), eax);
|
| + }
|
| }
|
|
|
| EmitCall(expr, call_type);
|
| @@ -2592,8 +2628,14 @@ void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr,
|
| PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG);
|
|
|
| // Push the target function under the receiver.
|
| - __ push(Operand(esp, 0));
|
| - __ mov(Operand(esp, kPointerSize), eax);
|
| + if (callee->AsProperty()->IsSuperAccess()) {
|
| + __ mov(Operand(esp, 0), eax);
|
| + SuperReference* super_ref = callee->AsProperty()->obj()->AsSuperReference();
|
| + VisitForStackValue(super_ref->this_var());
|
| + } else {
|
| + __ push(Operand(esp, 0));
|
| + __ mov(Operand(esp, kPointerSize), eax);
|
| + }
|
|
|
| EmitCall(expr, CallIC::METHOD);
|
| }
|
|
|