Index: src/x64/full-codegen-x64.cc |
=================================================================== |
--- src/x64/full-codegen-x64.cc (revision 5712) |
+++ src/x64/full-codegen-x64.cc (working copy) |
@@ -1158,6 +1158,11 @@ |
// result_saved is false the result is in rax. |
bool result_saved = false; |
+ // Mark all computed expressions that are bound to a key that |
+ // is shadowed by a later occurrence of the same key. For the |
+ // marked expressions, no store code is emitted. |
+ expr->CalculateEmitStore(); |
+ |
for (int i = 0; i < expr->properties()->length(); i++) { |
ObjectLiteral::Property* property = expr->properties()->at(i); |
if (property->IsCompileTimeValue()) continue; |
@@ -1179,8 +1184,10 @@ |
VisitForAccumulatorValue(value); |
__ Move(rcx, key->handle()); |
__ movq(rdx, Operand(rsp, 0)); |
- Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); |
- EmitCallIC(ic, RelocInfo::CODE_TARGET); |
+ if (property->emit_store()) { |
+ Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); |
+ EmitCallIC(ic, RelocInfo::CODE_TARGET); |
+ } |
break; |
} |
// Fall through. |
@@ -1188,7 +1195,11 @@ |
__ push(Operand(rsp, 0)); // Duplicate receiver. |
VisitForStackValue(key); |
VisitForStackValue(value); |
- __ CallRuntime(Runtime::kSetProperty, 3); |
+ if (property->emit_store()) { |
+ __ CallRuntime(Runtime::kSetProperty, 3); |
+ } else { |
+ __ Drop(3); |
+ } |
break; |
case ObjectLiteral::Property::SETTER: |
case ObjectLiteral::Property::GETTER: |