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