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