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/bootstrapper.h" | 7 #include "src/bootstrapper.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/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 5785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5796 // Save the return value in a callee-save register. | 5796 // Save the return value in a callee-save register. |
5797 Register saved_result = x19; | 5797 Register saved_result = x19; |
5798 __ Mov(saved_result, x0); | 5798 __ Mov(saved_result, x0); |
5799 __ Mov(x0, ExternalReference::isolate_address(isolate)); | 5799 __ Mov(x0, ExternalReference::isolate_address(isolate)); |
5800 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), | 5800 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), |
5801 1); | 5801 1); |
5802 __ Mov(x0, saved_result); | 5802 __ Mov(x0, saved_result); |
5803 __ B(&leave_exit_frame); | 5803 __ B(&leave_exit_frame); |
5804 } | 5804 } |
5805 | 5805 |
5806 | |
5807 static void CallApiFunctionStubHelper(MacroAssembler* masm, | 5806 static void CallApiFunctionStubHelper(MacroAssembler* masm, |
5808 const ParameterCount& argc, | 5807 const ParameterCount& argc, |
5809 bool return_first_arg, | 5808 bool return_first_arg, |
5810 bool call_data_undefined) { | 5809 bool call_data_undefined, bool is_lazy) { |
5811 // ----------- S t a t e ------------- | 5810 // ----------- S t a t e ------------- |
5812 // -- x0 : callee | 5811 // -- x0 : callee |
5813 // -- x4 : call_data | 5812 // -- x4 : call_data |
5814 // -- x2 : holder | 5813 // -- x2 : holder |
5815 // -- x1 : api_function_address | 5814 // -- x1 : api_function_address |
5816 // -- x3 : number of arguments if argc is a register | 5815 // -- x3 : number of arguments if argc is a register |
5817 // -- cp : context | 5816 // -- cp : context |
5818 // -- | 5817 // -- |
5819 // -- sp[0] : last argument | 5818 // -- sp[0] : last argument |
5820 // -- ... | 5819 // -- ... |
(...skipping 16 matching lines...) Expand all Loading... |
5837 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); | 5836 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); |
5838 STATIC_ASSERT(FCA::kIsolateIndex == 1); | 5837 STATIC_ASSERT(FCA::kIsolateIndex == 1); |
5839 STATIC_ASSERT(FCA::kHolderIndex == 0); | 5838 STATIC_ASSERT(FCA::kHolderIndex == 0); |
5840 STATIC_ASSERT(FCA::kArgsLength == 7); | 5839 STATIC_ASSERT(FCA::kArgsLength == 7); |
5841 | 5840 |
5842 DCHECK(argc.is_immediate() || x3.is(argc.reg())); | 5841 DCHECK(argc.is_immediate() || x3.is(argc.reg())); |
5843 | 5842 |
5844 // FunctionCallbackArguments: context, callee and call data. | 5843 // FunctionCallbackArguments: context, callee and call data. |
5845 __ Push(context, callee, call_data); | 5844 __ Push(context, callee, call_data); |
5846 | 5845 |
5847 // Load context from callee | 5846 if (!is_lazy) { |
5848 __ Ldr(context, FieldMemOperand(callee, JSFunction::kContextOffset)); | 5847 // Load context from callee |
| 5848 __ Ldr(context, FieldMemOperand(callee, JSFunction::kContextOffset)); |
| 5849 } |
5849 | 5850 |
5850 if (!call_data_undefined) { | 5851 if (!call_data_undefined) { |
5851 __ LoadRoot(call_data, Heap::kUndefinedValueRootIndex); | 5852 __ LoadRoot(call_data, Heap::kUndefinedValueRootIndex); |
5852 } | 5853 } |
5853 Register isolate_reg = x5; | 5854 Register isolate_reg = x5; |
5854 __ Mov(isolate_reg, ExternalReference::isolate_address(masm->isolate())); | 5855 __ Mov(isolate_reg, ExternalReference::isolate_address(masm->isolate())); |
5855 | 5856 |
5856 // FunctionCallbackArguments: | 5857 // FunctionCallbackArguments: |
5857 // return value, return value default, isolate, holder. | 5858 // return value, return value default, isolate, holder. |
5858 __ Push(call_data, call_data, isolate_reg, holder); | 5859 __ Push(call_data, call_data, isolate_reg, holder); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5923 const int spill_offset = 1 + kApiStackSpace; | 5924 const int spill_offset = 1 + kApiStackSpace; |
5924 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, | 5925 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, |
5925 stack_space_operand, spill_offset, | 5926 stack_space_operand, spill_offset, |
5926 return_value_operand, &context_restore_operand); | 5927 return_value_operand, &context_restore_operand); |
5927 } | 5928 } |
5928 | 5929 |
5929 | 5930 |
5930 void CallApiFunctionStub::Generate(MacroAssembler* masm) { | 5931 void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
5931 bool call_data_undefined = this->call_data_undefined(); | 5932 bool call_data_undefined = this->call_data_undefined(); |
5932 CallApiFunctionStubHelper(masm, ParameterCount(x3), false, | 5933 CallApiFunctionStubHelper(masm, ParameterCount(x3), false, |
5933 call_data_undefined); | 5934 call_data_undefined, false); |
5934 } | 5935 } |
5935 | 5936 |
5936 | 5937 |
5937 void CallApiAccessorStub::Generate(MacroAssembler* masm) { | 5938 void CallApiAccessorStub::Generate(MacroAssembler* masm) { |
5938 bool is_store = this->is_store(); | 5939 bool is_store = this->is_store(); |
5939 int argc = this->argc(); | 5940 int argc = this->argc(); |
5940 bool call_data_undefined = this->call_data_undefined(); | 5941 bool call_data_undefined = this->call_data_undefined(); |
| 5942 bool is_lazy = this->is_lazy(); |
5941 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5943 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
5942 call_data_undefined); | 5944 call_data_undefined, is_lazy); |
5943 } | 5945 } |
5944 | 5946 |
5945 | 5947 |
5946 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5948 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
5947 // ----------- S t a t e ------------- | 5949 // ----------- S t a t e ------------- |
5948 // -- sp[0] : name | 5950 // -- sp[0] : name |
5949 // -- sp[8 .. (8 + kArgsLength*8)] : v8::PropertyCallbackInfo::args_ | 5951 // -- sp[8 .. (8 + kArgsLength*8)] : v8::PropertyCallbackInfo::args_ |
5950 // -- ... | 5952 // -- ... |
5951 // -- x2 : api_function_address | 5953 // -- x2 : api_function_address |
5952 // ----------------------------------- | 5954 // ----------------------------------- |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5988 return_value_operand, NULL); | 5990 return_value_operand, NULL); |
5989 } | 5991 } |
5990 | 5992 |
5991 | 5993 |
5992 #undef __ | 5994 #undef __ |
5993 | 5995 |
5994 } // namespace internal | 5996 } // namespace internal |
5995 } // namespace v8 | 5997 } // namespace v8 |
5996 | 5998 |
5997 #endif // V8_TARGET_ARCH_ARM64 | 5999 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |