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 5691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5702 // Save the return value in a callee-save register. | 5702 // Save the return value in a callee-save register. |
5703 Register saved_result = x19; | 5703 Register saved_result = x19; |
5704 __ Mov(saved_result, x0); | 5704 __ Mov(saved_result, x0); |
5705 __ Mov(x0, ExternalReference::isolate_address(isolate)); | 5705 __ Mov(x0, ExternalReference::isolate_address(isolate)); |
5706 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), | 5706 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), |
5707 1); | 5707 1); |
5708 __ Mov(x0, saved_result); | 5708 __ Mov(x0, saved_result); |
5709 __ B(&leave_exit_frame); | 5709 __ B(&leave_exit_frame); |
5710 } | 5710 } |
5711 | 5711 |
5712 | |
5713 static void CallApiFunctionStubHelper(MacroAssembler* masm, | 5712 static void CallApiFunctionStubHelper(MacroAssembler* masm, |
5714 const ParameterCount& argc, | 5713 const ParameterCount& argc, |
5715 bool return_first_arg, | 5714 bool return_first_arg, |
5716 bool call_data_undefined) { | 5715 bool call_data_undefined, bool is_lazy) { |
5717 // ----------- S t a t e ------------- | 5716 // ----------- S t a t e ------------- |
5718 // -- x0 : callee | 5717 // -- x0 : callee |
5719 // -- x4 : call_data | 5718 // -- x4 : call_data |
5720 // -- x2 : holder | 5719 // -- x2 : holder |
5721 // -- x1 : api_function_address | 5720 // -- x1 : api_function_address |
5722 // -- x3 : number of arguments if argc is a register | 5721 // -- x3 : number of arguments if argc is a register |
5723 // -- cp : context | 5722 // -- cp : context |
5724 // -- | 5723 // -- |
5725 // -- sp[0] : last argument | 5724 // -- sp[0] : last argument |
5726 // -- ... | 5725 // -- ... |
(...skipping 16 matching lines...) Expand all Loading... |
5743 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); | 5742 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); |
5744 STATIC_ASSERT(FCA::kIsolateIndex == 1); | 5743 STATIC_ASSERT(FCA::kIsolateIndex == 1); |
5745 STATIC_ASSERT(FCA::kHolderIndex == 0); | 5744 STATIC_ASSERT(FCA::kHolderIndex == 0); |
5746 STATIC_ASSERT(FCA::kArgsLength == 7); | 5745 STATIC_ASSERT(FCA::kArgsLength == 7); |
5747 | 5746 |
5748 DCHECK(argc.is_immediate() || x3.is(argc.reg())); | 5747 DCHECK(argc.is_immediate() || x3.is(argc.reg())); |
5749 | 5748 |
5750 // FunctionCallbackArguments: context, callee and call data. | 5749 // FunctionCallbackArguments: context, callee and call data. |
5751 __ Push(context, callee, call_data); | 5750 __ Push(context, callee, call_data); |
5752 | 5751 |
5753 // Load context from callee | 5752 if (!is_lazy) { |
5754 __ Ldr(context, FieldMemOperand(callee, JSFunction::kContextOffset)); | 5753 // Load context from callee |
| 5754 __ Ldr(context, FieldMemOperand(callee, JSFunction::kContextOffset)); |
| 5755 } |
5755 | 5756 |
5756 if (!call_data_undefined) { | 5757 if (!call_data_undefined) { |
5757 __ LoadRoot(call_data, Heap::kUndefinedValueRootIndex); | 5758 __ LoadRoot(call_data, Heap::kUndefinedValueRootIndex); |
5758 } | 5759 } |
5759 Register isolate_reg = x5; | 5760 Register isolate_reg = x5; |
5760 __ Mov(isolate_reg, ExternalReference::isolate_address(masm->isolate())); | 5761 __ Mov(isolate_reg, ExternalReference::isolate_address(masm->isolate())); |
5761 | 5762 |
5762 // FunctionCallbackArguments: | 5763 // FunctionCallbackArguments: |
5763 // return value, return value default, isolate, holder. | 5764 // return value, return value default, isolate, holder. |
5764 __ Push(call_data, call_data, isolate_reg, holder); | 5765 __ Push(call_data, call_data, isolate_reg, holder); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5829 const int spill_offset = 1 + kApiStackSpace; | 5830 const int spill_offset = 1 + kApiStackSpace; |
5830 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, | 5831 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, |
5831 stack_space_operand, spill_offset, | 5832 stack_space_operand, spill_offset, |
5832 return_value_operand, &context_restore_operand); | 5833 return_value_operand, &context_restore_operand); |
5833 } | 5834 } |
5834 | 5835 |
5835 | 5836 |
5836 void CallApiFunctionStub::Generate(MacroAssembler* masm) { | 5837 void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
5837 bool call_data_undefined = this->call_data_undefined(); | 5838 bool call_data_undefined = this->call_data_undefined(); |
5838 CallApiFunctionStubHelper(masm, ParameterCount(x3), false, | 5839 CallApiFunctionStubHelper(masm, ParameterCount(x3), false, |
5839 call_data_undefined); | 5840 call_data_undefined, false); |
5840 } | 5841 } |
5841 | 5842 |
5842 | 5843 |
5843 void CallApiAccessorStub::Generate(MacroAssembler* masm) { | 5844 void CallApiAccessorStub::Generate(MacroAssembler* masm) { |
5844 bool is_store = this->is_store(); | 5845 bool is_store = this->is_store(); |
5845 int argc = this->argc(); | 5846 int argc = this->argc(); |
5846 bool call_data_undefined = this->call_data_undefined(); | 5847 bool call_data_undefined = this->call_data_undefined(); |
| 5848 bool is_lazy = this->is_lazy(); |
5847 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5849 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
5848 call_data_undefined); | 5850 call_data_undefined, is_lazy); |
5849 } | 5851 } |
5850 | 5852 |
5851 | 5853 |
5852 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5854 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
5853 // ----------- S t a t e ------------- | 5855 // ----------- S t a t e ------------- |
5854 // -- sp[0] : name | 5856 // -- sp[0] : name |
5855 // -- sp[8 .. (8 + kArgsLength*8)] : v8::PropertyCallbackInfo::args_ | 5857 // -- sp[8 .. (8 + kArgsLength*8)] : v8::PropertyCallbackInfo::args_ |
5856 // -- ... | 5858 // -- ... |
5857 // -- x2 : api_function_address | 5859 // -- x2 : api_function_address |
5858 // ----------------------------------- | 5860 // ----------------------------------- |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5894 return_value_operand, NULL); | 5896 return_value_operand, NULL); |
5895 } | 5897 } |
5896 | 5898 |
5897 | 5899 |
5898 #undef __ | 5900 #undef __ |
5899 | 5901 |
5900 } // namespace internal | 5902 } // namespace internal |
5901 } // namespace v8 | 5903 } // namespace v8 |
5902 | 5904 |
5903 #endif // V8_TARGET_ARCH_ARM64 | 5905 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |