Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index acf59b4d86c14286814ebc88dc60b0367097a857..ab9438ab7ed23ef5c74ba8abdc15a20e80da2045 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -1306,6 +1306,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) { |
@@ -1670,6 +1683,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); |
} |
@@ -1679,6 +1700,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 { |
@@ -1711,7 +1733,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); |
} |
@@ -2448,6 +2472,7 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
} |
VisitForStackValue(key); |
VisitForStackValue(value); |
+ EmitSetHomeObjectIfNeeded(value, 2); |
switch (property->kind()) { |
case ObjectLiteral::Property::CONSTANT: |