| 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/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 __ B(&done); | 278 __ B(&done); |
| 279 | 279 |
| 280 __ Bind(&non_construct_frame); | 280 __ Bind(&non_construct_frame); |
| 281 __ LoadRoot(x0, Heap::kUndefinedValueRootIndex); | 281 __ LoadRoot(x0, Heap::kUndefinedValueRootIndex); |
| 282 | 282 |
| 283 __ Bind(&done); | 283 __ Bind(&done); |
| 284 | 284 |
| 285 SetVar(new_target_var, x0, x2, x3); | 285 SetVar(new_target_var, x0, x2, x3); |
| 286 } | 286 } |
| 287 | 287 |
| 288 // Possibly allocate RestParameters | |
| 289 int rest_index; | |
| 290 Variable* rest_param = scope()->rest_parameter(&rest_index); | |
| 291 if (rest_param) { | |
| 292 Comment cmnt(masm_, "[ Allocate rest parameter array"); | |
| 293 | |
| 294 int num_parameters = info->scope()->num_parameters(); | |
| 295 int offset = num_parameters * kPointerSize; | |
| 296 | |
| 297 __ Add(x3, fp, StandardFrameConstants::kCallerSPOffset + offset); | |
| 298 __ Mov(x2, Smi::FromInt(num_parameters)); | |
| 299 __ Mov(x1, Smi::FromInt(rest_index)); | |
| 300 __ Mov(x0, Smi::FromInt(language_mode())); | |
| 301 __ Push(x3, x2, x1, x0); | |
| 302 function_in_register_x1 = false; | |
| 303 | |
| 304 RestParamAccessStub stub(isolate()); | |
| 305 __ CallStub(&stub); | |
| 306 | |
| 307 SetVar(rest_param, x0, x1, x2); | |
| 308 } | |
| 309 | |
| 310 Variable* arguments = scope()->arguments(); | 288 Variable* arguments = scope()->arguments(); |
| 311 if (arguments != NULL) { | 289 if (arguments != NULL) { |
| 312 // Function uses arguments object. | 290 // Function uses arguments object. |
| 313 Comment cmnt(masm_, "[ Allocate arguments object"); | 291 Comment cmnt(masm_, "[ Allocate arguments object"); |
| 314 if (!function_in_register_x1) { | 292 if (!function_in_register_x1) { |
| 315 // Load this again, if it's used by the local context below. | 293 // Load this again, if it's used by the local context below. |
| 316 __ Ldr(x3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 294 __ Ldr(x3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 317 } else { | 295 } else { |
| 318 __ Mov(x3, x1); | 296 __ Mov(x3, x1); |
| 319 } | 297 } |
| (...skipping 5044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5364 } | 5342 } |
| 5365 | 5343 |
| 5366 return INTERRUPT; | 5344 return INTERRUPT; |
| 5367 } | 5345 } |
| 5368 | 5346 |
| 5369 | 5347 |
| 5370 } // namespace internal | 5348 } // namespace internal |
| 5371 } // namespace v8 | 5349 } // namespace v8 |
| 5372 | 5350 |
| 5373 #endif // V8_TARGET_ARCH_ARM64 | 5351 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |