| 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 5466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5477 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), | 5477 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), |
| 5478 1); | 5478 1); |
| 5479 __ mov(v0, s0); | 5479 __ mov(v0, s0); |
| 5480 __ jmp(&leave_exit_frame); | 5480 __ jmp(&leave_exit_frame); |
| 5481 } | 5481 } |
| 5482 | 5482 |
| 5483 | 5483 |
| 5484 static void CallApiFunctionStubHelper(MacroAssembler* masm, | 5484 static void CallApiFunctionStubHelper(MacroAssembler* masm, |
| 5485 const ParameterCount& argc, | 5485 const ParameterCount& argc, |
| 5486 bool return_first_arg, | 5486 bool return_first_arg, |
| 5487 bool call_data_undefined) { | 5487 bool call_data_undefined, bool is_lazy) { |
| 5488 // ----------- S t a t e ------------- | 5488 // ----------- S t a t e ------------- |
| 5489 // -- a0 : callee | 5489 // -- a0 : callee |
| 5490 // -- a4 : call_data | 5490 // -- a4 : call_data |
| 5491 // -- a2 : holder | 5491 // -- a2 : holder |
| 5492 // -- a1 : api_function_address | 5492 // -- a1 : api_function_address |
| 5493 // -- a3 : number of arguments if argc is a register | 5493 // -- a3 : number of arguments if argc is a register |
| 5494 // -- cp : context | 5494 // -- cp : context |
| 5495 // -- | 5495 // -- |
| 5496 // -- sp[0] : last argument | 5496 // -- sp[0] : last argument |
| 5497 // -- ... | 5497 // -- ... |
| (...skipping 15 matching lines...) Expand all Loading... |
| 5513 STATIC_ASSERT(FCA::kReturnValueOffset == 3); | 5513 STATIC_ASSERT(FCA::kReturnValueOffset == 3); |
| 5514 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); | 5514 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); |
| 5515 STATIC_ASSERT(FCA::kIsolateIndex == 1); | 5515 STATIC_ASSERT(FCA::kIsolateIndex == 1); |
| 5516 STATIC_ASSERT(FCA::kHolderIndex == 0); | 5516 STATIC_ASSERT(FCA::kHolderIndex == 0); |
| 5517 STATIC_ASSERT(FCA::kArgsLength == 7); | 5517 STATIC_ASSERT(FCA::kArgsLength == 7); |
| 5518 | 5518 |
| 5519 DCHECK(argc.is_immediate() || a3.is(argc.reg())); | 5519 DCHECK(argc.is_immediate() || a3.is(argc.reg())); |
| 5520 | 5520 |
| 5521 // Save context, callee and call data. | 5521 // Save context, callee and call data. |
| 5522 __ Push(context, callee, call_data); | 5522 __ Push(context, callee, call_data); |
| 5523 // Load context from callee. | 5523 if (!is_lazy) { |
| 5524 __ ld(context, FieldMemOperand(callee, JSFunction::kContextOffset)); | 5524 // Load context from callee. |
| 5525 __ ld(context, FieldMemOperand(callee, JSFunction::kContextOffset)); |
| 5526 } |
| 5525 | 5527 |
| 5526 Register scratch = call_data; | 5528 Register scratch = call_data; |
| 5527 if (!call_data_undefined) { | 5529 if (!call_data_undefined) { |
| 5528 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); | 5530 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); |
| 5529 } | 5531 } |
| 5530 // Push return value and default return value. | 5532 // Push return value and default return value. |
| 5531 __ Push(scratch, scratch); | 5533 __ Push(scratch, scratch); |
| 5532 __ li(scratch, Operand(ExternalReference::isolate_address(masm->isolate()))); | 5534 __ li(scratch, Operand(ExternalReference::isolate_address(masm->isolate()))); |
| 5533 // Push isolate and holder. | 5535 // Push isolate and holder. |
| 5534 __ Push(scratch, holder); | 5536 __ Push(scratch, holder); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5599 } | 5601 } |
| 5600 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, | 5602 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, |
| 5601 stack_space_offset, return_value_operand, | 5603 stack_space_offset, return_value_operand, |
| 5602 &context_restore_operand); | 5604 &context_restore_operand); |
| 5603 } | 5605 } |
| 5604 | 5606 |
| 5605 | 5607 |
| 5606 void CallApiFunctionStub::Generate(MacroAssembler* masm) { | 5608 void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
| 5607 bool call_data_undefined = this->call_data_undefined(); | 5609 bool call_data_undefined = this->call_data_undefined(); |
| 5608 CallApiFunctionStubHelper(masm, ParameterCount(a3), false, | 5610 CallApiFunctionStubHelper(masm, ParameterCount(a3), false, |
| 5609 call_data_undefined); | 5611 call_data_undefined, false); |
| 5610 } | 5612 } |
| 5611 | 5613 |
| 5612 | 5614 |
| 5613 void CallApiAccessorStub::Generate(MacroAssembler* masm) { | 5615 void CallApiAccessorStub::Generate(MacroAssembler* masm) { |
| 5614 bool is_store = this->is_store(); | 5616 bool is_store = this->is_store(); |
| 5615 int argc = this->argc(); | 5617 int argc = this->argc(); |
| 5616 bool call_data_undefined = this->call_data_undefined(); | 5618 bool call_data_undefined = this->call_data_undefined(); |
| 5619 bool is_lazy = this->is_lazy(); |
| 5617 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5620 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
| 5618 call_data_undefined); | 5621 call_data_undefined, is_lazy); |
| 5619 } | 5622 } |
| 5620 | 5623 |
| 5621 | 5624 |
| 5622 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5625 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
| 5623 // ----------- S t a t e ------------- | 5626 // ----------- S t a t e ------------- |
| 5624 // -- sp[0] : name | 5627 // -- sp[0] : name |
| 5625 // -- sp[4 - kArgsLength*4] : PropertyCallbackArguments object | 5628 // -- sp[4 - kArgsLength*4] : PropertyCallbackArguments object |
| 5626 // -- ... | 5629 // -- ... |
| 5627 // -- a2 : api_function_address | 5630 // -- a2 : api_function_address |
| 5628 // ----------------------------------- | 5631 // ----------------------------------- |
| (...skipping 22 matching lines...) Expand all Loading... |
| 5651 MemOperand(fp, 6 * kPointerSize), NULL); | 5654 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5652 } | 5655 } |
| 5653 | 5656 |
| 5654 | 5657 |
| 5655 #undef __ | 5658 #undef __ |
| 5656 | 5659 |
| 5657 } // namespace internal | 5660 } // namespace internal |
| 5658 } // namespace v8 | 5661 } // namespace v8 |
| 5659 | 5662 |
| 5660 #endif // V8_TARGET_ARCH_MIPS64 | 5663 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |