Index: src/mips/full-codegen-mips.cc |
diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc |
index 9535de2da8d5a1a52a99494458595a8c9b7cafac..4ad81029567fabc12fd333920413af428f071326 100644 |
--- a/src/mips/full-codegen-mips.cc |
+++ b/src/mips/full-codegen-mips.cc |
@@ -1330,6 +1330,19 @@ void FullCodeGenerator::EmitLoadHomeObject(SuperReference* expr) { |
} |
+void FullCodeGenerator::EmitSetHomeObjectIfNeeded(Expression* initializer, |
+ int offset) { |
+ if (NeedsHomeObject(initializer)) { |
+ __ lw(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); |
+ __ li(StoreDescriptor::NameRegister(), |
+ Operand(isolate()->factory()->home_object_symbol())); |
+ __ lw(StoreDescriptor::ValueRegister(), |
+ MemOperand(sp, offset * kPointerSize)); |
+ CallStoreIC(); |
+ } |
+} |
+ |
+ |
void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, |
TypeofState typeof_state, |
Label* slow) { |
@@ -1686,6 +1699,14 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
__ lw(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); |
CallStoreIC(key->LiteralFeedbackId()); |
PrepareForBailoutForId(key->id(), NO_REGISTERS); |
+ |
+ if (NeedsHomeObject(value)) { |
+ __ Move(StoreDescriptor::ReceiverRegister(), v0); |
+ __ li(StoreDescriptor::NameRegister(), |
+ Operand(isolate()->factory()->home_object_symbol())); |
+ __ lw(StoreDescriptor::ValueRegister(), MemOperand(sp)); |
+ CallStoreIC(); |
+ } |
} else { |
VisitForEffect(value); |
} |
@@ -1697,6 +1718,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
VisitForStackValue(key); |
VisitForStackValue(value); |
if (property->emit_store()) { |
+ EmitSetHomeObjectIfNeeded(value, 2); |
__ li(a0, Operand(Smi::FromInt(SLOPPY))); // PropertyAttributes. |
__ push(a0); |
__ CallRuntime(Runtime::kSetProperty, 4); |
@@ -1733,7 +1755,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
__ push(a0); |
VisitForStackValue(it->first); |
EmitAccessor(it->second->getter); |
+ EmitSetHomeObjectIfNeeded(it->second->getter, 2); |
EmitAccessor(it->second->setter); |
+ EmitSetHomeObjectIfNeeded(it->second->setter, 3); |
__ li(a0, Operand(Smi::FromInt(NONE))); |
__ push(a0); |
__ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5); |
@@ -2472,6 +2496,7 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
__ push(scratch); |
VisitForStackValue(key); |
VisitForStackValue(value); |
+ EmitSetHomeObjectIfNeeded(value, 2); |
switch (property->kind()) { |
case ObjectLiteral::Property::CONSTANT: |