Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 1710b609dc68740a60cb1984cdbb9223415e99f5..f4938a72975ee612de115649a93687043760f372 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -1383,6 +1383,19 @@ void FullCodeGenerator::EmitLoadHomeObject(SuperReference* expr) { |
} |
+void FullCodeGenerator::EmitSetHomeObjectIfNeeded(Expression* initializer, |
+ int offset) { |
+ if (NeedsHomeObject(initializer)) { |
+ __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); |
+ __ mov(StoreDescriptor::NameRegister(), |
+ Operand(isolate()->factory()->home_object_symbol())); |
+ __ ldr(StoreDescriptor::ValueRegister(), |
+ MemOperand(sp, offset * kPointerSize)); |
+ CallStoreIC(); |
+ } |
+} |
+ |
+ |
void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, |
TypeofState typeof_state, |
Label* slow) { |
@@ -1739,6 +1752,14 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
__ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); |
CallStoreIC(key->LiteralFeedbackId()); |
PrepareForBailoutForId(key->id(), NO_REGISTERS); |
+ |
+ if (NeedsHomeObject(value)) { |
+ __ Move(StoreDescriptor::ReceiverRegister(), r0); |
+ __ mov(StoreDescriptor::NameRegister(), |
+ Operand(isolate()->factory()->home_object_symbol())); |
+ __ ldr(StoreDescriptor::ValueRegister(), MemOperand(sp)); |
+ CallStoreIC(); |
+ } |
} else { |
VisitForEffect(value); |
} |
@@ -1750,6 +1771,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
VisitForStackValue(key); |
VisitForStackValue(value); |
if (property->emit_store()) { |
+ EmitSetHomeObjectIfNeeded(value, 2); |
__ mov(r0, Operand(Smi::FromInt(SLOPPY))); // PropertyAttributes |
__ push(r0); |
__ CallRuntime(Runtime::kSetProperty, 4); |
@@ -1787,7 +1809,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
__ push(r0); |
VisitForStackValue(it->first); |
EmitAccessor(it->second->getter); |
+ EmitSetHomeObjectIfNeeded(it->second->getter, 2); |
EmitAccessor(it->second->setter); |
+ EmitSetHomeObjectIfNeeded(it->second->setter, 3); |
__ mov(r0, Operand(Smi::FromInt(NONE))); |
__ push(r0); |
__ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5); |
@@ -2534,6 +2558,7 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
__ push(scratch); |
VisitForStackValue(key); |
VisitForStackValue(value); |
+ EmitSetHomeObjectIfNeeded(value, 2); |
switch (property->kind()) { |
case ObjectLiteral::Property::CONSTANT: |