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

Unified Diff: src/x64/full-codegen-x64.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/x64/full-codegen-x64.cc
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
index 780f4b027fa6a9507ce28429f321cbd5ddf74881..b52e6bb937c1f9069aa6ea3fe2ae5c6e520b1850 100644
--- a/src/x64/full-codegen-x64.cc
+++ b/src/x64/full-codegen-x64.cc
@@ -200,11 +200,18 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
// stack frame was an arguments adapter frame.
ArgumentsAccessStub stub(ArgumentsAccessStub::NEW_OBJECT);
__ CallStub(&stub);
- // Store new arguments object in both "arguments" and ".arguments" slots.
- __ movq(rcx, rax);
- Move(arguments->AsSlot(), rax, rbx, rdx);
- Slot* dot_arguments_slot = scope()->arguments_shadow()->AsSlot();
- Move(dot_arguments_slot, rcx, rbx, rdx);
+
+ Variable* arguments_shadow = scope()->arguments_shadow();
+ if (arguments_shadow != NULL) {
+ // Store new arguments object in both "arguments" and ".arguments" slots.
+ __ movq(rcx, rax);
+ Move(arguments->AsSlot(), rax, rbx, rdx);
+ Move(arguments_shadow->AsSlot(), rcx, rbx, rdx);
+ } else {
+ // arguments are allocated without shadow only in strict mode.
+ ASSERT(scope()->is_strict_mode());
+ Move(arguments->AsSlot(), rax, rbx, rdx);
+ }
}
if (FLAG_trace) {
« src/parser.cc ('K') | « src/x64/codegen-x64.cc ('k') | test/es5conform/es5conform.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698