| 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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 5530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5541 bool is_store = this->is_store(); | 5541 bool is_store = this->is_store(); |
| 5542 int argc = this->argc(); | 5542 int argc = this->argc(); |
| 5543 bool call_data_undefined = this->call_data_undefined(); | 5543 bool call_data_undefined = this->call_data_undefined(); |
| 5544 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5544 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
| 5545 call_data_undefined); | 5545 call_data_undefined); |
| 5546 } | 5546 } |
| 5547 | 5547 |
| 5548 | 5548 |
| 5549 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5549 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
| 5550 // ----------- S t a t e ------------- | 5550 // ----------- S t a t e ------------- |
| 5551 // -- sp[0] : name | 5551 // -- sp[0] : name |
| 5552 // -- sp[4 .. (4 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_ | 5552 // -- sp[4 - kArgsLength*4] : PropertyCallbackArguments object |
| 5553 // -- ... | 5553 // -- ... |
| 5554 // -- a2 : api_function_address | 5554 // -- a2 : api_function_address |
| 5555 // ----------------------------------- | 5555 // ----------------------------------- |
| 5556 | 5556 |
| 5557 Register api_function_address = ApiGetterDescriptor::function_address(); | 5557 Register api_function_address = ApiGetterDescriptor::function_address(); |
| 5558 DCHECK(api_function_address.is(a2)); | 5558 DCHECK(api_function_address.is(a2)); |
| 5559 | 5559 |
| 5560 // v8::PropertyCallbackInfo::args_ array and name handle. | 5560 __ mov(a0, sp); // a0 = Handle<Name> |
| 5561 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; | 5561 __ Addu(a1, a0, Operand(1 * kPointerSize)); // a1 = PCA |
| 5562 | |
| 5563 // Load address of v8::PropertyAccessorInfo::args_ array and name handle. | |
| 5564 __ mov(a0, sp); // a0 = Handle<Name> | |
| 5565 __ Addu(a1, a0, Operand(1 * kPointerSize)); // a1 = v8::PCI::args_ | |
| 5566 | 5562 |
| 5567 const int kApiStackSpace = 1; | 5563 const int kApiStackSpace = 1; |
| 5568 FrameScope frame_scope(masm, StackFrame::MANUAL); | 5564 FrameScope frame_scope(masm, StackFrame::MANUAL); |
| 5569 __ EnterExitFrame(false, kApiStackSpace); | 5565 __ EnterExitFrame(false, kApiStackSpace); |
| 5570 | 5566 |
| 5571 // Create v8::PropertyCallbackInfo object on the stack and initialize | 5567 // Create PropertyAccessorInfo instance on the stack above the exit frame with |
| 5572 // it's args_ field. | 5568 // a1 (internal::Object** args_) as the data. |
| 5573 __ sw(a1, MemOperand(sp, 1 * kPointerSize)); | 5569 __ sw(a1, MemOperand(sp, 1 * kPointerSize)); |
| 5574 __ Addu(a1, sp, Operand(1 * kPointerSize)); // a1 = v8::PropertyCallbackInfo& | 5570 __ Addu(a1, sp, Operand(1 * kPointerSize)); // a1 = AccessorInfo& |
| 5571 |
| 5572 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; |
| 5575 | 5573 |
| 5576 ExternalReference thunk_ref = | 5574 ExternalReference thunk_ref = |
| 5577 ExternalReference::invoke_accessor_getter_callback(isolate()); | 5575 ExternalReference::invoke_accessor_getter_callback(isolate()); |
| 5578 | |
| 5579 // +3 is to skip prolog, return address and name handle. | |
| 5580 MemOperand return_value_operand( | |
| 5581 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); | |
| 5582 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5576 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
| 5583 kStackUnwindSpace, kInvalidStackOffset, | 5577 kStackUnwindSpace, kInvalidStackOffset, |
| 5584 return_value_operand, NULL); | 5578 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5585 } | 5579 } |
| 5586 | 5580 |
| 5587 | 5581 |
| 5588 #undef __ | 5582 #undef __ |
| 5589 | 5583 |
| 5590 } // namespace internal | 5584 } // namespace internal |
| 5591 } // namespace v8 | 5585 } // namespace v8 |
| 5592 | 5586 |
| 5593 #endif // V8_TARGET_ARCH_MIPS | 5587 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |