OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 if (arguments != NULL) { | 262 if (arguments != NULL) { |
263 // Arguments object must be allocated after the context object, in | 263 // Arguments object must be allocated after the context object, in |
264 // case the "arguments" or ".arguments" variables are in the context. | 264 // case the "arguments" or ".arguments" variables are in the context. |
265 Comment cmnt(masm_, "[ Allocate arguments object"); | 265 Comment cmnt(masm_, "[ Allocate arguments object"); |
266 if (!function_in_register) { | 266 if (!function_in_register) { |
267 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 267 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
268 } | 268 } |
269 if (is_strict(language_mode()) || !has_simple_parameters()) { | 269 if (is_strict(language_mode()) || !has_simple_parameters()) { |
270 FastNewStrictArgumentsStub stub(isolate()); | 270 FastNewStrictArgumentsStub stub(isolate()); |
271 __ CallStub(&stub); | 271 __ CallStub(&stub); |
| 272 } else if (literal()->has_duplicate_parameters()) { |
| 273 __ Push(edi); |
| 274 __ CallRuntime(Runtime::kNewSloppyArguments_Generic); |
272 } else { | 275 } else { |
273 DCHECK(edi.is(ArgumentsAccessNewDescriptor::function())); | 276 FastNewSloppyArgumentsStub stub(isolate()); |
274 // Receiver is just before the parameters on the caller's stack. | |
275 int num_parameters = info->scope()->num_parameters(); | |
276 int offset = num_parameters * kPointerSize; | |
277 __ mov(ArgumentsAccessNewDescriptor::parameter_count(), | |
278 Immediate(Smi::FromInt(num_parameters))); | |
279 __ lea(ArgumentsAccessNewDescriptor::parameter_pointer(), | |
280 Operand(ebp, StandardFrameConstants::kCallerSPOffset + offset)); | |
281 | |
282 // Arguments to ArgumentsAccessStub: | |
283 // function, parameter pointer, parameter count. | |
284 // The stub will rewrite parameter pointer and parameter count if the | |
285 // previous stack frame was an arguments adapter frame. | |
286 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( | |
287 literal()->has_duplicate_parameters()); | |
288 ArgumentsAccessStub stub(isolate(), type); | |
289 __ CallStub(&stub); | 277 __ CallStub(&stub); |
290 } | 278 } |
291 | 279 |
292 SetVar(arguments, eax, ebx, edx); | 280 SetVar(arguments, eax, ebx, edx); |
293 } | 281 } |
294 | 282 |
295 if (FLAG_trace) { | 283 if (FLAG_trace) { |
296 __ CallRuntime(Runtime::kTraceEnter); | 284 __ CallRuntime(Runtime::kTraceEnter); |
297 } | 285 } |
298 | 286 |
(...skipping 4180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4479 Assembler::target_address_at(call_target_address, | 4467 Assembler::target_address_at(call_target_address, |
4480 unoptimized_code)); | 4468 unoptimized_code)); |
4481 return OSR_AFTER_STACK_CHECK; | 4469 return OSR_AFTER_STACK_CHECK; |
4482 } | 4470 } |
4483 | 4471 |
4484 | 4472 |
4485 } // namespace internal | 4473 } // namespace internal |
4486 } // namespace v8 | 4474 } // namespace v8 |
4487 | 4475 |
4488 #endif // V8_TARGET_ARCH_X87 | 4476 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |