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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 if (arguments != NULL) { | 270 if (arguments != NULL) { |
271 // Function uses arguments object. | 271 // Function uses arguments object. |
272 Comment cmnt(masm_, "[ Allocate arguments object"); | 272 Comment cmnt(masm_, "[ Allocate arguments object"); |
273 if (!function_in_register_r1) { | 273 if (!function_in_register_r1) { |
274 // Load this again, if it's used by the local context below. | 274 // Load this again, if it's used by the local context below. |
275 __ ldr(r1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 275 __ ldr(r1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
276 } | 276 } |
277 if (is_strict(language_mode()) || !has_simple_parameters()) { | 277 if (is_strict(language_mode()) || !has_simple_parameters()) { |
278 FastNewStrictArgumentsStub stub(isolate()); | 278 FastNewStrictArgumentsStub stub(isolate()); |
279 __ CallStub(&stub); | 279 __ CallStub(&stub); |
| 280 } else if (literal()->has_duplicate_parameters()) { |
| 281 __ Push(r1); |
| 282 __ CallRuntime(Runtime::kNewSloppyArguments_Generic); |
280 } else { | 283 } else { |
281 DCHECK(r1.is(ArgumentsAccessNewDescriptor::function())); | 284 FastNewSloppyArgumentsStub stub(isolate()); |
282 // Receiver is just before the parameters on the caller's stack. | |
283 int num_parameters = info->scope()->num_parameters(); | |
284 int offset = num_parameters * kPointerSize; | |
285 __ mov(ArgumentsAccessNewDescriptor::parameter_count(), | |
286 Operand(Smi::FromInt(num_parameters))); | |
287 __ add(ArgumentsAccessNewDescriptor::parameter_pointer(), fp, | |
288 Operand(StandardFrameConstants::kCallerSPOffset + offset)); | |
289 | |
290 // Arguments to ArgumentsAccessStub: | |
291 // function, parameter pointer, parameter count. | |
292 // The stub will rewrite parameter pointer and parameter count if the | |
293 // previous stack frame was an arguments adapter frame. | |
294 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( | |
295 literal()->has_duplicate_parameters()); | |
296 ArgumentsAccessStub stub(isolate(), type); | |
297 __ CallStub(&stub); | 285 __ CallStub(&stub); |
298 } | 286 } |
299 | 287 |
300 SetVar(arguments, r0, r1, r2); | 288 SetVar(arguments, r0, r1, r2); |
301 } | 289 } |
302 | 290 |
303 if (FLAG_trace) { | 291 if (FLAG_trace) { |
304 __ CallRuntime(Runtime::kTraceEnter); | 292 __ CallRuntime(Runtime::kTraceEnter); |
305 } | 293 } |
306 | 294 |
(...skipping 4351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4658 DCHECK(interrupt_address == | 4646 DCHECK(interrupt_address == |
4659 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4647 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4660 return OSR_AFTER_STACK_CHECK; | 4648 return OSR_AFTER_STACK_CHECK; |
4661 } | 4649 } |
4662 | 4650 |
4663 | 4651 |
4664 } // namespace internal | 4652 } // namespace internal |
4665 } // namespace v8 | 4653 } // namespace v8 |
4666 | 4654 |
4667 #endif // V8_TARGET_ARCH_ARM | 4655 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |