| 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 5482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5493 __ mov(s0, v0); | 5493 __ mov(s0, v0); |
| 5494 __ mov(a0, v0); | 5494 __ mov(a0, v0); |
| 5495 __ PrepareCallCFunction(1, s1); | 5495 __ PrepareCallCFunction(1, s1); |
| 5496 __ li(a0, Operand(ExternalReference::isolate_address(isolate))); | 5496 __ li(a0, Operand(ExternalReference::isolate_address(isolate))); |
| 5497 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), | 5497 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), |
| 5498 1); | 5498 1); |
| 5499 __ mov(v0, s0); | 5499 __ mov(v0, s0); |
| 5500 __ jmp(&leave_exit_frame); | 5500 __ jmp(&leave_exit_frame); |
| 5501 } | 5501 } |
| 5502 | 5502 |
| 5503 | |
| 5504 static void CallApiFunctionStubHelper(MacroAssembler* masm, | 5503 static void CallApiFunctionStubHelper(MacroAssembler* masm, |
| 5505 const ParameterCount& argc, | 5504 const ParameterCount& argc, |
| 5506 bool return_first_arg, | 5505 bool return_first_arg, |
| 5507 bool call_data_undefined) { | 5506 bool call_data_undefined, bool is_lazy) { |
| 5508 // ----------- S t a t e ------------- | 5507 // ----------- S t a t e ------------- |
| 5509 // -- a0 : callee | 5508 // -- a0 : callee |
| 5510 // -- a4 : call_data | 5509 // -- a4 : call_data |
| 5511 // -- a2 : holder | 5510 // -- a2 : holder |
| 5512 // -- a1 : api_function_address | 5511 // -- a1 : api_function_address |
| 5513 // -- a3 : number of arguments if argc is a register | 5512 // -- a3 : number of arguments if argc is a register |
| 5514 // -- cp : context | 5513 // -- cp : context |
| 5515 // -- | 5514 // -- |
| 5516 // -- sp[0] : last argument | 5515 // -- sp[0] : last argument |
| 5517 // -- ... | 5516 // -- ... |
| (...skipping 15 matching lines...) Expand all Loading... |
| 5533 STATIC_ASSERT(FCA::kReturnValueOffset == 3); | 5532 STATIC_ASSERT(FCA::kReturnValueOffset == 3); |
| 5534 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); | 5533 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); |
| 5535 STATIC_ASSERT(FCA::kIsolateIndex == 1); | 5534 STATIC_ASSERT(FCA::kIsolateIndex == 1); |
| 5536 STATIC_ASSERT(FCA::kHolderIndex == 0); | 5535 STATIC_ASSERT(FCA::kHolderIndex == 0); |
| 5537 STATIC_ASSERT(FCA::kArgsLength == 7); | 5536 STATIC_ASSERT(FCA::kArgsLength == 7); |
| 5538 | 5537 |
| 5539 DCHECK(argc.is_immediate() || a3.is(argc.reg())); | 5538 DCHECK(argc.is_immediate() || a3.is(argc.reg())); |
| 5540 | 5539 |
| 5541 // Save context, callee and call data. | 5540 // Save context, callee and call data. |
| 5542 __ Push(context, callee, call_data); | 5541 __ Push(context, callee, call_data); |
| 5543 // Load context from callee. | 5542 if (!is_lazy) { |
| 5544 __ ld(context, FieldMemOperand(callee, JSFunction::kContextOffset)); | 5543 // Load context from callee. |
| 5544 __ ld(context, FieldMemOperand(callee, JSFunction::kContextOffset)); |
| 5545 } |
| 5545 | 5546 |
| 5546 Register scratch = call_data; | 5547 Register scratch = call_data; |
| 5547 if (!call_data_undefined) { | 5548 if (!call_data_undefined) { |
| 5548 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); | 5549 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); |
| 5549 } | 5550 } |
| 5550 // Push return value and default return value. | 5551 // Push return value and default return value. |
| 5551 __ Push(scratch, scratch); | 5552 __ Push(scratch, scratch); |
| 5552 __ li(scratch, Operand(ExternalReference::isolate_address(masm->isolate()))); | 5553 __ li(scratch, Operand(ExternalReference::isolate_address(masm->isolate()))); |
| 5553 // Push isolate and holder. | 5554 // Push isolate and holder. |
| 5554 __ Push(scratch, holder); | 5555 __ Push(scratch, holder); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5619 } | 5620 } |
| 5620 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, | 5621 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, |
| 5621 stack_space_offset, return_value_operand, | 5622 stack_space_offset, return_value_operand, |
| 5622 &context_restore_operand); | 5623 &context_restore_operand); |
| 5623 } | 5624 } |
| 5624 | 5625 |
| 5625 | 5626 |
| 5626 void CallApiFunctionStub::Generate(MacroAssembler* masm) { | 5627 void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
| 5627 bool call_data_undefined = this->call_data_undefined(); | 5628 bool call_data_undefined = this->call_data_undefined(); |
| 5628 CallApiFunctionStubHelper(masm, ParameterCount(a3), false, | 5629 CallApiFunctionStubHelper(masm, ParameterCount(a3), false, |
| 5629 call_data_undefined); | 5630 call_data_undefined, false); |
| 5630 } | 5631 } |
| 5631 | 5632 |
| 5632 | 5633 |
| 5633 void CallApiAccessorStub::Generate(MacroAssembler* masm) { | 5634 void CallApiAccessorStub::Generate(MacroAssembler* masm) { |
| 5634 bool is_store = this->is_store(); | 5635 bool is_store = this->is_store(); |
| 5635 int argc = this->argc(); | 5636 int argc = this->argc(); |
| 5636 bool call_data_undefined = this->call_data_undefined(); | 5637 bool call_data_undefined = this->call_data_undefined(); |
| 5638 bool is_lazy = this->is_lazy(); |
| 5637 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5639 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
| 5638 call_data_undefined); | 5640 call_data_undefined, is_lazy); |
| 5639 } | 5641 } |
| 5640 | 5642 |
| 5641 | 5643 |
| 5642 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5644 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
| 5643 // ----------- S t a t e ------------- | 5645 // ----------- S t a t e ------------- |
| 5644 // -- sp[0] : name | 5646 // -- sp[0] : name |
| 5645 // -- sp[8 .. (8 + kArgsLength*8)] : v8::PropertyCallbackInfo::args_ | 5647 // -- sp[8 .. (8 + kArgsLength*8)] : v8::PropertyCallbackInfo::args_ |
| 5646 // -- ... | 5648 // -- ... |
| 5647 // -- a2 : api_function_address | 5649 // -- a2 : api_function_address |
| 5648 // ----------------------------------- | 5650 // ----------------------------------- |
| (...skipping 29 matching lines...) Expand all Loading... |
| 5678 return_value_operand, NULL); | 5680 return_value_operand, NULL); |
| 5679 } | 5681 } |
| 5680 | 5682 |
| 5681 | 5683 |
| 5682 #undef __ | 5684 #undef __ |
| 5683 | 5685 |
| 5684 } // namespace internal | 5686 } // namespace internal |
| 5685 } // namespace v8 | 5687 } // namespace v8 |
| 5686 | 5688 |
| 5687 #endif // V8_TARGET_ARCH_MIPS64 | 5689 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |