OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 5589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5600 bool is_store = this->is_store(); | 5600 bool is_store = this->is_store(); |
5601 int argc = this->argc(); | 5601 int argc = this->argc(); |
5602 bool call_data_undefined = this->call_data_undefined(); | 5602 bool call_data_undefined = this->call_data_undefined(); |
5603 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5603 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
5604 call_data_undefined); | 5604 call_data_undefined); |
5605 } | 5605 } |
5606 | 5606 |
5607 | 5607 |
5608 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5608 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
5609 // ----------- S t a t e ------------- | 5609 // ----------- S t a t e ------------- |
5610 // -- sp[0] : name | 5610 // -- sp[0] : name |
5611 // -- sp[8 .. (8 + kArgsLength*8)] : v8::PropertyCallbackInfo::args_ | 5611 // -- sp[4 - kArgsLength*4] : PropertyCallbackArguments object |
5612 // -- ... | 5612 // -- ... |
5613 // -- a2 : api_function_address | 5613 // -- a2 : api_function_address |
5614 // ----------------------------------- | 5614 // ----------------------------------- |
5615 | 5615 |
5616 Register api_function_address = ApiGetterDescriptor::function_address(); | 5616 Register api_function_address = ApiGetterDescriptor::function_address(); |
5617 DCHECK(api_function_address.is(a2)); | 5617 DCHECK(api_function_address.is(a2)); |
5618 | 5618 |
5619 // v8::PropertyCallbackInfo::args_ array and name handle. | 5619 __ mov(a0, sp); // a0 = Handle<Name> |
5620 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; | 5620 __ Daddu(a1, a0, Operand(1 * kPointerSize)); // a1 = PCA |
5621 | |
5622 // Load address of v8::PropertyAccessorInfo::args_ array and name handle. | |
5623 __ mov(a0, sp); // a0 = Handle<Name> | |
5624 __ Daddu(a1, a0, Operand(1 * kPointerSize)); // a1 = v8::PCI::args_ | |
5625 | 5621 |
5626 const int kApiStackSpace = 1; | 5622 const int kApiStackSpace = 1; |
5627 FrameScope frame_scope(masm, StackFrame::MANUAL); | 5623 FrameScope frame_scope(masm, StackFrame::MANUAL); |
5628 __ EnterExitFrame(false, kApiStackSpace); | 5624 __ EnterExitFrame(false, kApiStackSpace); |
5629 | 5625 |
5630 // Create v8::PropertyCallbackInfo object on the stack and initialize | 5626 // Create PropertyAccessorInfo instance on the stack above the exit frame with |
5631 // it's args_ field. | 5627 // a1 (internal::Object** args_) as the data. |
5632 __ sd(a1, MemOperand(sp, 1 * kPointerSize)); | 5628 __ sd(a1, MemOperand(sp, 1 * kPointerSize)); |
5633 __ Daddu(a1, sp, Operand(1 * kPointerSize)); | 5629 __ Daddu(a1, sp, Operand(1 * kPointerSize)); // a1 = AccessorInfo& |
5634 // a1 = v8::PropertyCallbackInfo& | 5630 |
| 5631 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; |
5635 | 5632 |
5636 ExternalReference thunk_ref = | 5633 ExternalReference thunk_ref = |
5637 ExternalReference::invoke_accessor_getter_callback(isolate()); | 5634 ExternalReference::invoke_accessor_getter_callback(isolate()); |
5638 | |
5639 // +3 is to skip prolog, return address and name handle. | |
5640 MemOperand return_value_operand( | |
5641 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); | |
5642 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5635 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5643 kStackUnwindSpace, kInvalidStackOffset, | 5636 kStackUnwindSpace, kInvalidStackOffset, |
5644 return_value_operand, NULL); | 5637 MemOperand(fp, 6 * kPointerSize), NULL); |
5645 } | 5638 } |
5646 | 5639 |
5647 | 5640 |
5648 #undef __ | 5641 #undef __ |
5649 | 5642 |
5650 } // namespace internal | 5643 } // namespace internal |
5651 } // namespace v8 | 5644 } // namespace v8 |
5652 | 5645 |
5653 #endif // V8_TARGET_ARCH_MIPS64 | 5646 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |