OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 FastNewRestParameterStub stub(isolate()); | 267 FastNewRestParameterStub stub(isolate()); |
268 __ CallStub(&stub); | 268 __ CallStub(&stub); |
269 function_in_register_x1 = false; | 269 function_in_register_x1 = false; |
270 SetVar(rest_param, x0, x1, x2); | 270 SetVar(rest_param, x0, x1, x2); |
271 } | 271 } |
272 | 272 |
273 Variable* arguments = scope()->arguments(); | 273 Variable* arguments = scope()->arguments(); |
274 if (arguments != NULL) { | 274 if (arguments != NULL) { |
275 // Function uses arguments object. | 275 // Function uses arguments object. |
276 Comment cmnt(masm_, "[ Allocate arguments object"); | 276 Comment cmnt(masm_, "[ Allocate arguments object"); |
277 DCHECK(x1.is(ArgumentsAccessNewDescriptor::function())); | |
278 if (!function_in_register_x1) { | 277 if (!function_in_register_x1) { |
279 // Load this again, if it's used by the local context below. | 278 // Load this again, if it's used by the local context below. |
280 __ Ldr(x1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 279 __ Ldr(x1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
281 } | 280 } |
282 // Receiver is just before the parameters on the caller's stack. | 281 if (is_strict(language_mode()) || !has_simple_parameters()) { |
283 int num_parameters = info->scope()->num_parameters(); | 282 FastNewStrictArgumentsStub stub(isolate()); |
284 int offset = num_parameters * kPointerSize; | 283 __ CallStub(&stub); |
285 __ Mov(ArgumentsAccessNewDescriptor::parameter_count(), | 284 } else { |
286 Smi::FromInt(num_parameters)); | 285 DCHECK(x1.is(ArgumentsAccessNewDescriptor::function())); |
287 __ Add(ArgumentsAccessNewDescriptor::parameter_pointer(), fp, | 286 // Receiver is just before the parameters on the caller's stack. |
288 StandardFrameConstants::kCallerSPOffset + offset); | 287 int num_parameters = info->scope()->num_parameters(); |
| 288 int offset = num_parameters * kPointerSize; |
| 289 __ Mov(ArgumentsAccessNewDescriptor::parameter_count(), |
| 290 Smi::FromInt(num_parameters)); |
| 291 __ Add(ArgumentsAccessNewDescriptor::parameter_pointer(), fp, |
| 292 StandardFrameConstants::kCallerSPOffset + offset); |
289 | 293 |
290 // Arguments to ArgumentsAccessStub: | 294 // Arguments to ArgumentsAccessStub: |
291 // function, parameter pointer, parameter count. | 295 // function, parameter pointer, parameter count. |
292 // The stub will rewrite parameter pointer and parameter count if the | 296 // The stub will rewrite parameter pointer and parameter count if the |
293 // previous stack frame was an arguments adapter frame. | 297 // previous stack frame was an arguments adapter frame. |
294 bool is_unmapped = is_strict(language_mode()) || !has_simple_parameters(); | 298 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( |
295 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( | 299 literal()->has_duplicate_parameters()); |
296 is_unmapped, literal()->has_duplicate_parameters()); | 300 ArgumentsAccessStub stub(isolate(), type); |
297 ArgumentsAccessStub stub(isolate(), type); | 301 __ CallStub(&stub); |
298 __ CallStub(&stub); | 302 } |
299 | 303 |
300 SetVar(arguments, x0, x1, x2); | 304 SetVar(arguments, x0, x1, x2); |
301 } | 305 } |
302 | 306 |
303 if (FLAG_trace) { | 307 if (FLAG_trace) { |
304 __ CallRuntime(Runtime::kTraceEnter); | 308 __ CallRuntime(Runtime::kTraceEnter); |
305 } | 309 } |
306 | 310 |
307 // Visit the declarations and body unless there is an illegal | 311 // Visit the declarations and body unless there is an illegal |
308 // redeclaration. | 312 // redeclaration. |
(...skipping 4381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4690 } | 4694 } |
4691 | 4695 |
4692 return INTERRUPT; | 4696 return INTERRUPT; |
4693 } | 4697 } |
4694 | 4698 |
4695 | 4699 |
4696 } // namespace internal | 4700 } // namespace internal |
4697 } // namespace v8 | 4701 } // namespace v8 |
4698 | 4702 |
4699 #endif // V8_TARGET_ARCH_ARM64 | 4703 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |