| 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 2080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2091 | 2091 |
| 2092 // Prepare for tail call only if the debugger is not active. | 2092 // Prepare for tail call only if the debugger is not active. |
| 2093 Label done; | 2093 Label done; |
| 2094 ExternalReference debug_is_active = | 2094 ExternalReference debug_is_active = |
| 2095 ExternalReference::debug_is_active_address(masm->isolate()); | 2095 ExternalReference::debug_is_active_address(masm->isolate()); |
| 2096 __ Mov(scratch1, Operand(debug_is_active)); | 2096 __ Mov(scratch1, Operand(debug_is_active)); |
| 2097 __ Ldrb(scratch1, MemOperand(scratch1)); | 2097 __ Ldrb(scratch1, MemOperand(scratch1)); |
| 2098 __ Cmp(scratch1, Operand(0)); | 2098 __ Cmp(scratch1, Operand(0)); |
| 2099 __ B(ne, &done); | 2099 __ B(ne, &done); |
| 2100 | 2100 |
| 2101 // Drop possible interpreter handler/stub frame. |
| 2102 { |
| 2103 Label no_interpreter_frame; |
| 2104 __ Ldr(scratch3, MemOperand(fp, StandardFrameConstants::kMarkerOffset)); |
| 2105 __ Cmp(scratch3, Operand(Smi::FromInt(StackFrame::STUB))); |
| 2106 __ B(ne, &no_interpreter_frame); |
| 2107 __ Ldr(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 2108 __ bind(&no_interpreter_frame); |
| 2109 } |
| 2110 |
| 2101 // Check if next frame is an arguments adaptor frame. | 2111 // Check if next frame is an arguments adaptor frame. |
| 2102 Label no_arguments_adaptor, formal_parameter_count_loaded; | 2112 Label no_arguments_adaptor, formal_parameter_count_loaded; |
| 2103 __ Ldr(scratch2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 2113 __ Ldr(scratch2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 2104 __ Ldr(scratch3, | 2114 __ Ldr(scratch3, |
| 2105 MemOperand(scratch2, StandardFrameConstants::kContextOffset)); | 2115 MemOperand(scratch2, StandardFrameConstants::kContextOffset)); |
| 2106 __ Cmp(scratch3, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 2116 __ Cmp(scratch3, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 2107 __ B(ne, &no_arguments_adaptor); | 2117 __ B(ne, &no_arguments_adaptor); |
| 2108 | 2118 |
| 2109 // Drop arguments adaptor frame and load arguments count. | 2119 // Drop arguments adaptor frame and load arguments count. |
| 2110 __ mov(fp, scratch2); | 2120 __ mov(fp, scratch2); |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2566 | 2576 |
| 2567 // Called Construct on an Object that doesn't have a [[Construct]] internal | 2577 // Called Construct on an Object that doesn't have a [[Construct]] internal |
| 2568 // method. | 2578 // method. |
| 2569 __ bind(&non_constructor); | 2579 __ bind(&non_constructor); |
| 2570 __ Jump(masm->isolate()->builtins()->ConstructedNonConstructable(), | 2580 __ Jump(masm->isolate()->builtins()->ConstructedNonConstructable(), |
| 2571 RelocInfo::CODE_TARGET); | 2581 RelocInfo::CODE_TARGET); |
| 2572 } | 2582 } |
| 2573 | 2583 |
| 2574 | 2584 |
| 2575 // static | 2585 // static |
| 2576 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { | 2586 void Builtins::Generate_InterpreterPushArgsAndCallImpl( |
| 2587 MacroAssembler* masm, TailCallMode tail_call_mode) { |
| 2577 // ----------- S t a t e ------------- | 2588 // ----------- S t a t e ------------- |
| 2578 // -- x0 : the number of arguments (not including the receiver) | 2589 // -- x0 : the number of arguments (not including the receiver) |
| 2579 // -- x2 : the address of the first argument to be pushed. Subsequent | 2590 // -- x2 : the address of the first argument to be pushed. Subsequent |
| 2580 // arguments should be consecutive above this, in the same order as | 2591 // arguments should be consecutive above this, in the same order as |
| 2581 // they are to be pushed onto the stack. | 2592 // they are to be pushed onto the stack. |
| 2582 // -- x1 : the target to call (can be any Object). | 2593 // -- x1 : the target to call (can be any Object). |
| 2583 // ----------------------------------- | 2594 // ----------------------------------- |
| 2584 | 2595 |
| 2585 // Find the address of the last argument. | 2596 // Find the address of the last argument. |
| 2586 __ add(x3, x0, Operand(1)); // Add one for receiver. | 2597 __ add(x3, x0, Operand(1)); // Add one for receiver. |
| 2587 __ lsl(x3, x3, kPointerSizeLog2); | 2598 __ lsl(x3, x3, kPointerSizeLog2); |
| 2588 __ sub(x4, x2, x3); | 2599 __ sub(x4, x2, x3); |
| 2589 | 2600 |
| 2590 // Push the arguments. | 2601 // Push the arguments. |
| 2591 Label loop_header, loop_check; | 2602 Label loop_header, loop_check; |
| 2592 __ Mov(x5, jssp); | 2603 __ Mov(x5, jssp); |
| 2593 __ Claim(x3, 1); | 2604 __ Claim(x3, 1); |
| 2594 __ B(&loop_check); | 2605 __ B(&loop_check); |
| 2595 __ Bind(&loop_header); | 2606 __ Bind(&loop_header); |
| 2596 // TODO(rmcilroy): Push two at a time once we ensure we keep stack aligned. | 2607 // TODO(rmcilroy): Push two at a time once we ensure we keep stack aligned. |
| 2597 __ Ldr(x3, MemOperand(x2, -kPointerSize, PostIndex)); | 2608 __ Ldr(x3, MemOperand(x2, -kPointerSize, PostIndex)); |
| 2598 __ Str(x3, MemOperand(x5, -kPointerSize, PreIndex)); | 2609 __ Str(x3, MemOperand(x5, -kPointerSize, PreIndex)); |
| 2599 __ Bind(&loop_check); | 2610 __ Bind(&loop_check); |
| 2600 __ Cmp(x2, x4); | 2611 __ Cmp(x2, x4); |
| 2601 __ B(gt, &loop_header); | 2612 __ B(gt, &loop_header); |
| 2602 | 2613 |
| 2603 // Call the target. | 2614 // Call the target. |
| 2604 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 2615 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, |
| 2616 tail_call_mode), |
| 2617 RelocInfo::CODE_TARGET); |
| 2605 } | 2618 } |
| 2606 | 2619 |
| 2607 | 2620 |
| 2608 // static | 2621 // static |
| 2609 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { | 2622 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { |
| 2610 // ----------- S t a t e ------------- | 2623 // ----------- S t a t e ------------- |
| 2611 // -- x0 : argument count (not including receiver) | 2624 // -- x0 : argument count (not including receiver) |
| 2612 // -- x3 : new target | 2625 // -- x3 : new target |
| 2613 // -- x1 : constructor to call | 2626 // -- x1 : constructor to call |
| 2614 // -- x2 : address of the first argument | 2627 // -- x2 : address of the first argument |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2811 } | 2824 } |
| 2812 } | 2825 } |
| 2813 | 2826 |
| 2814 | 2827 |
| 2815 #undef __ | 2828 #undef __ |
| 2816 | 2829 |
| 2817 } // namespace internal | 2830 } // namespace internal |
| 2818 } // namespace v8 | 2831 } // namespace v8 |
| 2819 | 2832 |
| 2820 #endif // V8_TARGET_ARCH_ARM | 2833 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |