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