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/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 __ Push(allocation_site, argc, constructor, new_target); | 364 __ Push(allocation_site, argc, constructor, new_target); |
365 // sp[0]: new.target | 365 // sp[0]: new.target |
366 // sp[1]: Constructor function. | 366 // sp[1]: Constructor function. |
367 // sp[2]: number of arguments (smi-tagged) | 367 // sp[2]: number of arguments (smi-tagged) |
368 // sp[3]: allocation site | 368 // sp[3]: allocation site |
369 | 369 |
370 // Try to allocate the object without transitioning into C code. If any of | 370 // Try to allocate the object without transitioning into C code. If any of |
371 // the preconditions is not met, the code bails out to the runtime call. | 371 // the preconditions is not met, the code bails out to the runtime call. |
372 Label rt_call, allocated; | 372 Label rt_call, allocated; |
373 if (FLAG_inline_new) { | 373 if (FLAG_inline_new) { |
374 ExternalReference debug_step_in_fp = | |
375 ExternalReference::debug_step_in_fp_address(isolate); | |
376 __ Mov(x2, Operand(debug_step_in_fp)); | |
377 __ Ldr(x2, MemOperand(x2)); | |
378 __ Cbnz(x2, &rt_call); | |
379 | |
380 // Verify that the new target is a JSFunction. | 374 // Verify that the new target is a JSFunction. |
381 __ JumpIfNotObjectType(new_target, x10, x11, JS_FUNCTION_TYPE, &rt_call); | 375 __ JumpIfNotObjectType(new_target, x10, x11, JS_FUNCTION_TYPE, &rt_call); |
382 | 376 |
383 // Load the initial map and verify that it is in fact a map. | 377 // Load the initial map and verify that it is in fact a map. |
384 Register init_map = x2; | 378 Register init_map = x2; |
385 __ Ldr(init_map, | 379 __ Ldr(init_map, |
386 FieldMemOperand(new_target, | 380 FieldMemOperand(new_target, |
387 JSFunction::kPrototypeOrInitialMapOffset)); | 381 JSFunction::kPrototypeOrInitialMapOffset)); |
388 __ JumpIfSmi(init_map, &rt_call); | 382 __ JumpIfSmi(init_map, &rt_call); |
389 __ JumpIfNotObjectType(init_map, x10, x11, MAP_TYPE, &rt_call); | 383 __ JumpIfNotObjectType(init_map, x10, x11, MAP_TYPE, &rt_call); |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 __ Push(x11, x10); | 684 __ Push(x11, x10); |
691 __ Bind(&entry); | 685 __ Bind(&entry); |
692 __ Cmp(x4, x2); | 686 __ Cmp(x4, x2); |
693 __ B(gt, &loop); | 687 __ B(gt, &loop); |
694 // Because we copied values 2 by 2 we may have copied one extra value. | 688 // Because we copied values 2 by 2 we may have copied one extra value. |
695 // Drop it if that is the case. | 689 // Drop it if that is the case. |
696 __ B(eq, &done_copying_arguments); | 690 __ B(eq, &done_copying_arguments); |
697 __ Drop(1); | 691 __ Drop(1); |
698 __ Bind(&done_copying_arguments); | 692 __ Bind(&done_copying_arguments); |
699 | 693 |
700 // Handle step in. | |
701 Label skip_step_in; | |
702 ExternalReference debug_step_in_fp = | |
703 ExternalReference::debug_step_in_fp_address(masm->isolate()); | |
704 __ Mov(x2, Operand(debug_step_in_fp)); | |
705 __ Ldr(x2, MemOperand(x2)); | |
706 __ Cbz(x2, &skip_step_in); | |
707 | |
708 __ Push(x0, x1, x1); | |
709 __ CallRuntime(Runtime::kHandleStepInForDerivedConstructors, 1); | |
710 __ Pop(x1, x0); | |
711 | |
712 __ bind(&skip_step_in); | |
713 | |
714 // Call the function. | 694 // Call the function. |
715 // x0: number of arguments | 695 // x0: number of arguments |
716 // x1: constructor function | 696 // x1: constructor function |
717 ParameterCount actual(x0); | 697 ParameterCount actual(x0); |
718 __ InvokeFunction(x1, actual, CALL_FUNCTION, NullCallWrapper()); | 698 __ InvokeFunction(x1, actual, CALL_FUNCTION, NullCallWrapper()); |
719 | 699 |
720 // Restore the context from the frame. | 700 // Restore the context from the frame. |
721 // x0: result | 701 // x0: result |
722 // jssp[0]: number of arguments (smi-tagged) | 702 // jssp[0]: number of arguments (smi-tagged) |
723 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 703 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2018 } | 1998 } |
2019 } | 1999 } |
2020 | 2000 |
2021 | 2001 |
2022 #undef __ | 2002 #undef __ |
2023 | 2003 |
2024 } // namespace internal | 2004 } // namespace internal |
2025 } // namespace v8 | 2005 } // namespace v8 |
2026 | 2006 |
2027 #endif // V8_TARGET_ARCH_ARM | 2007 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |