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

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

Issue 6625048: Strict mode arguments do not share binding with formal parameters. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 10 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
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
index 5f5de3a9f93fbf71c214ac517c6d69bd1b753535..80b275cdb0b7103582598d56e2111470f6849628 100644
--- a/src/arm/full-codegen-arm.cc
+++ b/src/arm/full-codegen-arm.cc
@@ -212,11 +212,18 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
// stack frame was an arguments adapter frame.
ArgumentsAccessStub stub(ArgumentsAccessStub::NEW_OBJECT);
__ CallStub(&stub);
- // Duplicate the value; move-to-slot operation might clobber registers.
- __ mov(r3, r0);
- Move(arguments->AsSlot(), r0, r1, r2);
- Slot* dot_arguments_slot = scope()->arguments_shadow()->AsSlot();
- Move(dot_arguments_slot, r3, r1, r2);
+
+ Variable* arguments_shadow = scope()->arguments_shadow();
+ if (arguments_shadow != NULL) {
Kevin Millikin (Chromium) 2011/03/07 11:46:48 A bit simpler (also on the other platforms): if (
Martin Maly 2011/03/07 19:09:40 Done.
+ // Duplicate the value; move-to-slot operation might clobber registers.
+ __ mov(r3, r0);
+ Move(arguments->AsSlot(), r0, r1, r2);
+ Move(arguments_shadow->AsSlot(), r3, r1, r2);
+ } else {
+ // arguments are allocated without shadow only in strict mode.
+ ASSERT(scope()->is_strict_mode());
+ Move(arguments->AsSlot(), r0, r1, r2);
+ }
}
if (FLAG_trace) {

Powered by Google App Engine
This is Rietveld 408576698