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); | |
283 } else { | 280 } else { |
284 FastNewSloppyArgumentsStub stub(isolate()); | 281 DCHECK(r1.is(ArgumentsAccessNewDescriptor::function())); |
| 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); |
285 __ CallStub(&stub); | 297 __ CallStub(&stub); |
286 } | 298 } |
287 | 299 |
288 SetVar(arguments, r0, r1, r2); | 300 SetVar(arguments, r0, r1, r2); |
289 } | 301 } |
290 | 302 |
291 if (FLAG_trace) { | 303 if (FLAG_trace) { |
292 __ CallRuntime(Runtime::kTraceEnter); | 304 __ CallRuntime(Runtime::kTraceEnter); |
293 } | 305 } |
294 | 306 |
(...skipping 4351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4646 DCHECK(interrupt_address == | 4658 DCHECK(interrupt_address == |
4647 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4659 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4648 return OSR_AFTER_STACK_CHECK; | 4660 return OSR_AFTER_STACK_CHECK; |
4649 } | 4661 } |
4650 | 4662 |
4651 | 4663 |
4652 } // namespace internal | 4664 } // namespace internal |
4653 } // namespace v8 | 4665 } // namespace v8 |
4654 | 4666 |
4655 #endif // V8_TARGET_ARCH_ARM | 4667 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |