Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: src/arm/full-codegen-arm.cc

Issue 4004006: Fix a bug that prevents constants from overwriting function values in object ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/arm/full-codegen-arm.cc
===================================================================
--- src/arm/full-codegen-arm.cc (revision 5712)
+++ src/arm/full-codegen-arm.cc (working copy)
@@ -1169,6 +1169,11 @@
// result_saved is false the result is in r0.
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;
@@ -1190,8 +1195,10 @@
VisitForAccumulatorValue(value);
__ mov(r2, Operand(key->handle()));
__ ldr(r1, MemOperand(sp));
- 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.
@@ -1201,7 +1208,11 @@
__ push(r0);
VisitForStackValue(key);
VisitForStackValue(value);
- __ CallRuntime(Runtime::kSetProperty, 3);
+ if (property->emit_store()) {
+ __ CallRuntime(Runtime::kSetProperty, 3);
+ } else {
+ __ Drop(3);
+ }
break;
case ObjectLiteral::Property::GETTER:
case ObjectLiteral::Property::SETTER:
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/ast.h » ('j') | src/ia32/full-codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698