Index: src/mips64/full-codegen-mips64.cc |
diff --git a/src/mips64/full-codegen-mips64.cc b/src/mips64/full-codegen-mips64.cc |
index e4f0c7f12492279d89f09192b3a659a408e3a757..2f6036e05eb03046705892723367607bfd1b0db8 100644 |
--- a/src/mips64/full-codegen-mips64.cc |
+++ b/src/mips64/full-codegen-mips64.cc |
@@ -248,6 +248,11 @@ void FullCodeGenerator::Generate() { |
} |
} |
+ Variable* home_object_var = scope()->home_object_var(); |
+ if (home_object_var != nullptr) { |
+ __ Push(a1); |
+ } |
+ |
ArgumentsAccessStub::HasNewTarget has_new_target = |
IsSubclassConstructor(info->function()->kind()) |
? ArgumentsAccessStub::HAS_NEW_TARGET |
@@ -314,6 +319,19 @@ void FullCodeGenerator::Generate() { |
SetVar(arguments, v0, a1, a2); |
} |
+ // Possibly set up a local binding to the [[HomeObject]]. |
+ if (home_object_var != nullptr) { |
+ Comment cmnt(masm_, "[ Home object"); |
+ __ pop(LoadDescriptor::ReceiverRegister()); |
+ Handle<Symbol> home_object_symbol(isolate()->heap()->home_object_symbol()); |
+ __ li(LoadDescriptor::NameRegister(), home_object_symbol); |
+ __ li(LoadDescriptor::SlotRegister(), |
+ Operand(SmiFromSlot(function()->HomeObjectFeedbackSlot()))); |
+ CallLoadIC(NOT_CONTEXTUAL); |
+ |
+ SetVar(home_object_var, v0, a1, a2); |
+ } |
+ |
if (FLAG_trace) { |
__ CallRuntime(Runtime::kTraceEnter, 0); |
} |
@@ -1310,26 +1328,6 @@ void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { |
} |
-void FullCodeGenerator::EmitLoadHomeObject(SuperReference* expr) { |
- Comment cnmt(masm_, "[ SuperReference "); |
- |
- __ ld(LoadDescriptor::ReceiverRegister(), |
- MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
- |
- Handle<Symbol> home_object_symbol(isolate()->heap()->home_object_symbol()); |
- __ li(LoadDescriptor::NameRegister(), home_object_symbol); |
- |
- __ li(LoadDescriptor::SlotRegister(), |
- Operand(SmiFromSlot(expr->HomeObjectFeedbackSlot()))); |
- CallLoadIC(NOT_CONTEXTUAL); |
- |
- Label done; |
- __ Branch(&done, ne, v0, Operand(isolate()->factory()->undefined_value())); |
- __ CallRuntime(Runtime::kThrowNonMethodError, 0); |
- __ bind(&done); |
-} |
- |
- |
void FullCodeGenerator::EmitSetHomeObjectIfNeeded(Expression* initializer, |
int offset) { |
if (NeedsHomeObject(initializer)) { |
@@ -1965,7 +1963,8 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { |
break; |
case NAMED_SUPER_PROPERTY: |
VisitForStackValue(property->obj()->AsSuperReference()->this_var()); |
- EmitLoadHomeObject(property->obj()->AsSuperReference()); |
+ VisitForAccumulatorValue( |
+ property->obj()->AsSuperReference()->home_object_var()); |
__ Push(result_register()); |
if (expr->is_compound()) { |
const Register scratch = a1; |
@@ -1976,7 +1975,8 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { |
case KEYED_SUPER_PROPERTY: { |
const Register scratch = a1; |
VisitForStackValue(property->obj()->AsSuperReference()->this_var()); |
- EmitLoadHomeObject(property->obj()->AsSuperReference()); |
+ VisitForAccumulatorValue( |
+ property->obj()->AsSuperReference()->home_object_var()); |
__ Move(scratch, result_register()); |
VisitForAccumulatorValue(property->key()); |
__ Push(scratch, result_register()); |
@@ -2609,7 +2609,8 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { |
case NAMED_SUPER_PROPERTY: { |
__ Push(v0); |
VisitForStackValue(prop->obj()->AsSuperReference()->this_var()); |
- EmitLoadHomeObject(prop->obj()->AsSuperReference()); |
+ VisitForAccumulatorValue( |
+ prop->obj()->AsSuperReference()->home_object_var()); |
// stack: value, this; v0: home_object |
Register scratch = a2; |
Register scratch2 = a3; |
@@ -2625,8 +2626,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { |
case KEYED_SUPER_PROPERTY: { |
__ Push(v0); |
VisitForStackValue(prop->obj()->AsSuperReference()->this_var()); |
- EmitLoadHomeObject(prop->obj()->AsSuperReference()); |
- __ Push(result_register()); |
+ VisitForStackValue(prop->obj()->AsSuperReference()->home_object_var()); |
VisitForAccumulatorValue(prop->key()); |
Register scratch = a2; |
Register scratch2 = a3; |
@@ -2847,8 +2847,7 @@ void FullCodeGenerator::VisitProperty(Property* expr) { |
EmitNamedPropertyLoad(expr); |
} else { |
VisitForStackValue(expr->obj()->AsSuperReference()->this_var()); |
- EmitLoadHomeObject(expr->obj()->AsSuperReference()); |
- __ Push(result_register()); |
+ VisitForStackValue(expr->obj()->AsSuperReference()->home_object_var()); |
EmitNamedSuperPropertyLoad(expr); |
} |
} else { |
@@ -2860,8 +2859,7 @@ void FullCodeGenerator::VisitProperty(Property* expr) { |
EmitKeyedPropertyLoad(expr); |
} else { |
VisitForStackValue(expr->obj()->AsSuperReference()->this_var()); |
- EmitLoadHomeObject(expr->obj()->AsSuperReference()); |
- __ Push(result_register()); |
+ VisitForStackValue(expr->obj()->AsSuperReference()->home_object_var()); |
VisitForStackValue(expr->key()); |
EmitKeyedSuperPropertyLoad(expr); |
} |
@@ -2924,7 +2922,7 @@ void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) { |
// Load the function from the receiver. |
const Register scratch = a1; |
SuperReference* super_ref = prop->obj()->AsSuperReference(); |
- EmitLoadHomeObject(super_ref); |
+ VisitForAccumulatorValue(super_ref->home_object_var()); |
__ mov(scratch, v0); |
VisitForAccumulatorValue(super_ref->this_var()); |
__ Push(scratch, v0, v0, scratch); |
@@ -2982,7 +2980,7 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) { |
// Load the function from the receiver. |
const Register scratch = a1; |
SuperReference* super_ref = prop->obj()->AsSuperReference(); |
- EmitLoadHomeObject(super_ref); |
+ VisitForAccumulatorValue(super_ref->home_object_var()); |
__ Move(scratch, v0); |
VisitForAccumulatorValue(super_ref->this_var()); |
__ Push(scratch, v0, v0, scratch); |
@@ -4854,7 +4852,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
case NAMED_SUPER_PROPERTY: { |
VisitForStackValue(prop->obj()->AsSuperReference()->this_var()); |
- EmitLoadHomeObject(prop->obj()->AsSuperReference()); |
+ VisitForAccumulatorValue( |
+ prop->obj()->AsSuperReference()->home_object_var()); |
__ Push(result_register()); |
const Register scratch = a1; |
__ ld(scratch, MemOperand(sp, kPointerSize)); |
@@ -4865,7 +4864,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
case KEYED_SUPER_PROPERTY: { |
VisitForStackValue(prop->obj()->AsSuperReference()->this_var()); |
- EmitLoadHomeObject(prop->obj()->AsSuperReference()); |
+ VisitForAccumulatorValue( |
+ prop->obj()->AsSuperReference()->home_object_var()); |
const Register scratch = a1; |
const Register scratch1 = a4; |
__ Move(scratch, result_register()); |