Index: src/x87/full-codegen-x87.cc |
diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc |
index 729655d80a1e65e6895991028071fddb8a67f787..a98ff81fe3ec5af462dd468992d2daa59c9e8b75 100644 |
--- a/src/x87/full-codegen-x87.cc |
+++ b/src/x87/full-codegen-x87.cc |
@@ -1295,6 +1295,19 @@ void FullCodeGenerator::EmitLoadHomeObject(SuperReference* expr) { |
} |
+void FullCodeGenerator::EmitSetHomeObjectIfNeeded(Expression* initializer, |
+ int offset) { |
+ if (NeedsHomeObject(initializer)) { |
+ __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); |
+ __ mov(StoreDescriptor::NameRegister(), |
+ Immediate(isolate()->factory()->home_object_symbol())); |
+ __ mov(StoreDescriptor::ValueRegister(), |
+ Operand(esp, offset * kPointerSize)); |
+ CallStoreIC(); |
+ } |
+} |
+ |
+ |
void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, |
TypeofState typeof_state, |
Label* slow) { |
@@ -1659,6 +1672,14 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
__ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); |
CallStoreIC(key->LiteralFeedbackId()); |
PrepareForBailoutForId(key->id(), NO_REGISTERS); |
+ |
+ if (NeedsHomeObject(value)) { |
+ __ mov(StoreDescriptor::ReceiverRegister(), eax); |
+ __ mov(StoreDescriptor::NameRegister(), |
+ Immediate(isolate()->factory()->home_object_symbol())); |
+ __ mov(StoreDescriptor::ValueRegister(), Operand(esp, 0)); |
+ CallStoreIC(); |
+ } |
} else { |
VisitForEffect(value); |
} |
@@ -1668,6 +1689,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
VisitForStackValue(key); |
VisitForStackValue(value); |
if (property->emit_store()) { |
+ EmitSetHomeObjectIfNeeded(value, 2); |
__ push(Immediate(Smi::FromInt(SLOPPY))); // Strict mode |
__ CallRuntime(Runtime::kSetProperty, 4); |
} else { |
@@ -1700,7 +1722,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
__ push(Operand(esp, 0)); // Duplicate receiver. |
VisitForStackValue(it->first); |
EmitAccessor(it->second->getter); |
+ EmitSetHomeObjectIfNeeded(it->second->getter, 2); |
EmitAccessor(it->second->setter); |
+ EmitSetHomeObjectIfNeeded(it->second->setter, 3); |
__ push(Immediate(Smi::FromInt(NONE))); |
__ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5); |
} |
@@ -2435,6 +2459,7 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
} |
VisitForStackValue(key); |
VisitForStackValue(value); |
+ EmitSetHomeObjectIfNeeded(value, 2); |
switch (property->kind()) { |
case ObjectLiteral::Property::CONSTANT: |