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

Unified Diff: src/ia32/full-codegen-ia32.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/ia32/full-codegen-ia32.cc
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
index 9a7d41ada25f2117859ca644b12d9a5dcc95c946..36238fa126ce867d38ad35dab0ea8ca91a8a7b4e 100644
--- a/src/ia32/full-codegen-ia32.cc
+++ b/src/ia32/full-codegen-ia32.cc
@@ -199,10 +199,17 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
// stack frame was an arguments adapter frame.
ArgumentsAccessStub stub(ArgumentsAccessStub::NEW_OBJECT);
__ CallStub(&stub);
- __ mov(ecx, eax); // Duplicate result.
- Move(arguments->AsSlot(), eax, ebx, edx);
- Slot* dot_arguments_slot = scope()->arguments_shadow()->AsSlot();
- Move(dot_arguments_slot, ecx, ebx, edx);
+
+ Variable* arguments_shadow = scope()->arguments_shadow();
+ if (arguments_shadow != NULL) {
+ __ mov(ecx, eax); // Duplicate result.
+ Move(arguments->AsSlot(), eax, ebx, edx);
+ Move(arguments_shadow->AsSlot(), ecx, ebx, edx);
+ } else {
+ // arguments are allocated without shadow only in strict mode.
+ ASSERT(scope()->is_strict_mode());
+ Move(arguments->AsSlot(), eax, ebx, edx);
+ }
}
if (FLAG_trace) {

Powered by Google App Engine
This is Rietveld 408576698