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

Side by Side 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, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 __ lea(edx, 192 __ lea(edx,
193 Operand(ebp, StandardFrameConstants::kCallerSPOffset + offset)); 193 Operand(ebp, StandardFrameConstants::kCallerSPOffset + offset));
194 __ push(edx); 194 __ push(edx);
195 __ push(Immediate(Smi::FromInt(scope()->num_parameters()))); 195 __ push(Immediate(Smi::FromInt(scope()->num_parameters())));
196 // Arguments to ArgumentsAccessStub: 196 // Arguments to ArgumentsAccessStub:
197 // function, receiver address, parameter count. 197 // function, receiver address, parameter count.
198 // The stub will rewrite receiver and parameter count if the previous 198 // The stub will rewrite receiver and parameter count if the previous
199 // stack frame was an arguments adapter frame. 199 // stack frame was an arguments adapter frame.
200 ArgumentsAccessStub stub(ArgumentsAccessStub::NEW_OBJECT); 200 ArgumentsAccessStub stub(ArgumentsAccessStub::NEW_OBJECT);
201 __ CallStub(&stub); 201 __ CallStub(&stub);
202 __ mov(ecx, eax); // Duplicate result. 202
203 Move(arguments->AsSlot(), eax, ebx, edx); 203 Variable* arguments_shadow = scope()->arguments_shadow();
204 Slot* dot_arguments_slot = scope()->arguments_shadow()->AsSlot(); 204 if (arguments_shadow != NULL) {
205 Move(dot_arguments_slot, ecx, ebx, edx); 205 __ mov(ecx, eax); // Duplicate result.
206 Move(arguments->AsSlot(), eax, ebx, edx);
207 Move(arguments_shadow->AsSlot(), ecx, ebx, edx);
208 } else {
209 // arguments are allocated without shadow only in strict mode.
210 ASSERT(scope()->is_strict_mode());
211 Move(arguments->AsSlot(), eax, ebx, edx);
212 }
206 } 213 }
207 214
208 if (FLAG_trace) { 215 if (FLAG_trace) {
209 __ CallRuntime(Runtime::kTraceEnter, 0); 216 __ CallRuntime(Runtime::kTraceEnter, 0);
210 } 217 }
211 218
212 // Visit the declarations and body unless there is an illegal 219 // Visit the declarations and body unless there is an illegal
213 // redeclaration. 220 // redeclaration.
214 if (scope()->HasIllegalRedeclaration()) { 221 if (scope()->HasIllegalRedeclaration()) {
215 Comment cmnt(masm_, "[ Declarations"); 222 Comment cmnt(masm_, "[ Declarations");
(...skipping 4039 matching lines...) Expand 10 before | Expand all | Expand 10 after
4255 // And return. 4262 // And return.
4256 __ ret(0); 4263 __ ret(0);
4257 } 4264 }
4258 4265
4259 4266
4260 #undef __ 4267 #undef __
4261 4268
4262 } } // namespace v8::internal 4269 } } // namespace v8::internal
4263 4270
4264 #endif // V8_TARGET_ARCH_IA32 4271 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698