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 5799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5810 bool is_store = this->is_store(); | 5810 bool is_store = this->is_store(); |
5811 int argc = this->argc(); | 5811 int argc = this->argc(); |
5812 bool call_data_undefined = this->call_data_undefined(); | 5812 bool call_data_undefined = this->call_data_undefined(); |
5813 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5813 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
5814 call_data_undefined); | 5814 call_data_undefined); |
5815 } | 5815 } |
5816 | 5816 |
5817 | 5817 |
5818 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5818 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
5819 // ----------- S t a t e ------------- | 5819 // ----------- S t a t e ------------- |
5820 // -- sp[0] : name | 5820 // -- sp[0] : name |
5821 // -- sp[8 - kArgsLength*8] : PropertyCallbackArguments object | 5821 // -- sp[8 .. (8 + kArgsLength*8)] : v8::PropertyCallbackInfo::args_ |
5822 // -- ... | 5822 // -- ... |
5823 // -- x2 : api_function_address | 5823 // -- x2 : api_function_address |
5824 // ----------------------------------- | 5824 // ----------------------------------- |
5825 | 5825 |
5826 Register api_function_address = ApiGetterDescriptor::function_address(); | 5826 Register api_function_address = ApiGetterDescriptor::function_address(); |
5827 DCHECK(api_function_address.is(x2)); | 5827 DCHECK(api_function_address.is(x2)); |
5828 | 5828 |
| 5829 // v8::PropertyCallbackInfo::args_ array and name handle. |
| 5830 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; |
| 5831 |
| 5832 // Load address of v8::PropertyAccessorInfo::args_ array and name handle. |
5829 __ Mov(x0, masm->StackPointer()); // x0 = Handle<Name> | 5833 __ Mov(x0, masm->StackPointer()); // x0 = Handle<Name> |
5830 __ Add(x1, x0, 1 * kPointerSize); // x1 = PCA | 5834 __ Add(x1, x0, 1 * kPointerSize); // x1 = v8::PCI::args_ |
5831 | 5835 |
5832 const int kApiStackSpace = 1; | 5836 const int kApiStackSpace = 1; |
5833 | 5837 |
5834 // Allocate space for CallApiFunctionAndReturn can store some scratch | 5838 // Allocate space for CallApiFunctionAndReturn can store some scratch |
5835 // registeres on the stack. | 5839 // registeres on the stack. |
5836 const int kCallApiFunctionSpillSpace = 4; | 5840 const int kCallApiFunctionSpillSpace = 4; |
5837 | 5841 |
5838 FrameScope frame_scope(masm, StackFrame::MANUAL); | 5842 FrameScope frame_scope(masm, StackFrame::MANUAL); |
5839 __ EnterExitFrame(false, x10, kApiStackSpace + kCallApiFunctionSpillSpace); | 5843 __ EnterExitFrame(false, x10, kApiStackSpace + kCallApiFunctionSpillSpace); |
5840 | 5844 |
5841 // Create PropertyAccessorInfo instance on the stack above the exit frame with | 5845 // Create v8::PropertyCallbackInfo object on the stack and initialize |
5842 // x1 (internal::Object** args_) as the data. | 5846 // it's args_ field. |
5843 __ Poke(x1, 1 * kPointerSize); | 5847 __ Poke(x1, 1 * kPointerSize); |
5844 __ Add(x1, masm->StackPointer(), 1 * kPointerSize); // x1 = AccessorInfo& | 5848 __ Add(x1, masm->StackPointer(), 1 * kPointerSize); |
5845 | 5849 // x1 = v8::PropertyCallbackInfo& |
5846 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; | |
5847 | 5850 |
5848 ExternalReference thunk_ref = | 5851 ExternalReference thunk_ref = |
5849 ExternalReference::invoke_accessor_getter_callback(isolate()); | 5852 ExternalReference::invoke_accessor_getter_callback(isolate()); |
5850 | 5853 |
5851 const int spill_offset = 1 + kApiStackSpace; | 5854 const int spill_offset = 1 + kApiStackSpace; |
| 5855 // +3 is to skip prolog, return address and name handle. |
| 5856 MemOperand return_value_operand( |
| 5857 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); |
5852 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5858 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5853 kStackUnwindSpace, NULL, spill_offset, | 5859 kStackUnwindSpace, NULL, spill_offset, |
5854 MemOperand(fp, 6 * kPointerSize), NULL); | 5860 return_value_operand, NULL); |
5855 } | 5861 } |
5856 | 5862 |
5857 | 5863 |
5858 #undef __ | 5864 #undef __ |
5859 | 5865 |
5860 } // namespace internal | 5866 } // namespace internal |
5861 } // namespace v8 | 5867 } // namespace v8 |
5862 | 5868 |
5863 #endif // V8_TARGET_ARCH_ARM64 | 5869 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |