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 5560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5571 __ mov(s0, v0); | 5571 __ mov(s0, v0); |
5572 __ mov(a0, v0); | 5572 __ mov(a0, v0); |
5573 __ PrepareCallCFunction(1, s1); | 5573 __ PrepareCallCFunction(1, s1); |
5574 __ li(a0, Operand(ExternalReference::isolate_address(isolate))); | 5574 __ li(a0, Operand(ExternalReference::isolate_address(isolate))); |
5575 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), | 5575 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), |
5576 1); | 5576 1); |
5577 __ mov(v0, s0); | 5577 __ mov(v0, s0); |
5578 __ jmp(&leave_exit_frame); | 5578 __ jmp(&leave_exit_frame); |
5579 } | 5579 } |
5580 | 5580 |
5581 | |
5582 static void CallApiFunctionStubHelper(MacroAssembler* masm, | 5581 static void CallApiFunctionStubHelper(MacroAssembler* masm, |
5583 const ParameterCount& argc, | 5582 const ParameterCount& argc, |
5584 bool return_first_arg, | 5583 bool return_first_arg, |
5585 bool call_data_undefined) { | 5584 bool call_data_undefined, bool is_lazy) { |
5586 // ----------- S t a t e ------------- | 5585 // ----------- S t a t e ------------- |
5587 // -- a0 : callee | 5586 // -- a0 : callee |
5588 // -- a4 : call_data | 5587 // -- a4 : call_data |
5589 // -- a2 : holder | 5588 // -- a2 : holder |
5590 // -- a1 : api_function_address | 5589 // -- a1 : api_function_address |
5591 // -- a3 : number of arguments if argc is a register | 5590 // -- a3 : number of arguments if argc is a register |
5592 // -- cp : context | 5591 // -- cp : context |
5593 // -- | 5592 // -- |
5594 // -- sp[0] : last argument | 5593 // -- sp[0] : last argument |
5595 // -- ... | 5594 // -- ... |
(...skipping 15 matching lines...) Expand all Loading... |
5611 STATIC_ASSERT(FCA::kReturnValueOffset == 3); | 5610 STATIC_ASSERT(FCA::kReturnValueOffset == 3); |
5612 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); | 5611 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); |
5613 STATIC_ASSERT(FCA::kIsolateIndex == 1); | 5612 STATIC_ASSERT(FCA::kIsolateIndex == 1); |
5614 STATIC_ASSERT(FCA::kHolderIndex == 0); | 5613 STATIC_ASSERT(FCA::kHolderIndex == 0); |
5615 STATIC_ASSERT(FCA::kArgsLength == 7); | 5614 STATIC_ASSERT(FCA::kArgsLength == 7); |
5616 | 5615 |
5617 DCHECK(argc.is_immediate() || a3.is(argc.reg())); | 5616 DCHECK(argc.is_immediate() || a3.is(argc.reg())); |
5618 | 5617 |
5619 // Save context, callee and call data. | 5618 // Save context, callee and call data. |
5620 __ Push(context, callee, call_data); | 5619 __ Push(context, callee, call_data); |
5621 // Load context from callee. | 5620 if (!is_lazy) { |
5622 __ ld(context, FieldMemOperand(callee, JSFunction::kContextOffset)); | 5621 // Load context from callee. |
| 5622 __ ld(context, FieldMemOperand(callee, JSFunction::kContextOffset)); |
| 5623 } |
5623 | 5624 |
5624 Register scratch = call_data; | 5625 Register scratch = call_data; |
5625 if (!call_data_undefined) { | 5626 if (!call_data_undefined) { |
5626 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); | 5627 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); |
5627 } | 5628 } |
5628 // Push return value and default return value. | 5629 // Push return value and default return value. |
5629 __ Push(scratch, scratch); | 5630 __ Push(scratch, scratch); |
5630 __ li(scratch, Operand(ExternalReference::isolate_address(masm->isolate()))); | 5631 __ li(scratch, Operand(ExternalReference::isolate_address(masm->isolate()))); |
5631 // Push isolate and holder. | 5632 // Push isolate and holder. |
5632 __ Push(scratch, holder); | 5633 __ Push(scratch, holder); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5697 } | 5698 } |
5698 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, | 5699 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, |
5699 stack_space_offset, return_value_operand, | 5700 stack_space_offset, return_value_operand, |
5700 &context_restore_operand); | 5701 &context_restore_operand); |
5701 } | 5702 } |
5702 | 5703 |
5703 | 5704 |
5704 void CallApiFunctionStub::Generate(MacroAssembler* masm) { | 5705 void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
5705 bool call_data_undefined = this->call_data_undefined(); | 5706 bool call_data_undefined = this->call_data_undefined(); |
5706 CallApiFunctionStubHelper(masm, ParameterCount(a3), false, | 5707 CallApiFunctionStubHelper(masm, ParameterCount(a3), false, |
5707 call_data_undefined); | 5708 call_data_undefined, false); |
5708 } | 5709 } |
5709 | 5710 |
5710 | 5711 |
5711 void CallApiAccessorStub::Generate(MacroAssembler* masm) { | 5712 void CallApiAccessorStub::Generate(MacroAssembler* masm) { |
5712 bool is_store = this->is_store(); | 5713 bool is_store = this->is_store(); |
5713 int argc = this->argc(); | 5714 int argc = this->argc(); |
5714 bool call_data_undefined = this->call_data_undefined(); | 5715 bool call_data_undefined = this->call_data_undefined(); |
| 5716 bool is_lazy = this->is_lazy(); |
5715 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5717 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
5716 call_data_undefined); | 5718 call_data_undefined, is_lazy); |
5717 } | 5719 } |
5718 | 5720 |
5719 | 5721 |
5720 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5722 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
5721 // ----------- S t a t e ------------- | 5723 // ----------- S t a t e ------------- |
5722 // -- sp[0] : name | 5724 // -- sp[0] : name |
5723 // -- sp[8 .. (8 + kArgsLength*8)] : v8::PropertyCallbackInfo::args_ | 5725 // -- sp[8 .. (8 + kArgsLength*8)] : v8::PropertyCallbackInfo::args_ |
5724 // -- ... | 5726 // -- ... |
5725 // -- a2 : api_function_address | 5727 // -- a2 : api_function_address |
5726 // ----------------------------------- | 5728 // ----------------------------------- |
(...skipping 29 matching lines...) Expand all Loading... |
5756 return_value_operand, NULL); | 5758 return_value_operand, NULL); |
5757 } | 5759 } |
5758 | 5760 |
5759 | 5761 |
5760 #undef __ | 5762 #undef __ |
5761 | 5763 |
5762 } // namespace internal | 5764 } // namespace internal |
5763 } // namespace v8 | 5765 } // namespace v8 |
5764 | 5766 |
5765 #endif // V8_TARGET_ARCH_MIPS64 | 5767 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |