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 5399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5410 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), | 5410 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), |
5411 1); | 5411 1); |
5412 __ mov(v0, s0); | 5412 __ mov(v0, s0); |
5413 __ jmp(&leave_exit_frame); | 5413 __ jmp(&leave_exit_frame); |
5414 } | 5414 } |
5415 | 5415 |
5416 | 5416 |
5417 static void CallApiFunctionStubHelper(MacroAssembler* masm, | 5417 static void CallApiFunctionStubHelper(MacroAssembler* masm, |
5418 const ParameterCount& argc, | 5418 const ParameterCount& argc, |
5419 bool return_first_arg, | 5419 bool return_first_arg, |
5420 bool call_data_undefined) { | 5420 bool call_data_undefined, bool is_lazy) { |
5421 // ----------- S t a t e ------------- | 5421 // ----------- S t a t e ------------- |
5422 // -- a0 : callee | 5422 // -- a0 : callee |
5423 // -- t0 : call_data | 5423 // -- t0 : call_data |
5424 // -- a2 : holder | 5424 // -- a2 : holder |
5425 // -- a1 : api_function_address | 5425 // -- a1 : api_function_address |
5426 // -- a3 : number of arguments if argc is a register | 5426 // -- a3 : number of arguments if argc is a register |
5427 // -- cp : context | 5427 // -- cp : context |
5428 // -- | 5428 // -- |
5429 // -- sp[0] : last argument | 5429 // -- sp[0] : last argument |
5430 // -- ... | 5430 // -- ... |
(...skipping 15 matching lines...) Expand all Loading... |
5446 STATIC_ASSERT(FCA::kReturnValueOffset == 3); | 5446 STATIC_ASSERT(FCA::kReturnValueOffset == 3); |
5447 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); | 5447 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); |
5448 STATIC_ASSERT(FCA::kIsolateIndex == 1); | 5448 STATIC_ASSERT(FCA::kIsolateIndex == 1); |
5449 STATIC_ASSERT(FCA::kHolderIndex == 0); | 5449 STATIC_ASSERT(FCA::kHolderIndex == 0); |
5450 STATIC_ASSERT(FCA::kArgsLength == 7); | 5450 STATIC_ASSERT(FCA::kArgsLength == 7); |
5451 | 5451 |
5452 DCHECK(argc.is_immediate() || a3.is(argc.reg())); | 5452 DCHECK(argc.is_immediate() || a3.is(argc.reg())); |
5453 | 5453 |
5454 // Save context, callee and call data. | 5454 // Save context, callee and call data. |
5455 __ Push(context, callee, call_data); | 5455 __ Push(context, callee, call_data); |
5456 // Load context from callee. | 5456 if (!is_lazy) { |
5457 __ lw(context, FieldMemOperand(callee, JSFunction::kContextOffset)); | 5457 // Load context from callee. |
| 5458 __ lw(context, FieldMemOperand(callee, JSFunction::kContextOffset)); |
| 5459 } |
5458 | 5460 |
5459 Register scratch = call_data; | 5461 Register scratch = call_data; |
5460 if (!call_data_undefined) { | 5462 if (!call_data_undefined) { |
5461 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); | 5463 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); |
5462 } | 5464 } |
5463 // Push return value and default return value. | 5465 // Push return value and default return value. |
5464 __ Push(scratch, scratch); | 5466 __ Push(scratch, scratch); |
5465 __ li(scratch, Operand(ExternalReference::isolate_address(masm->isolate()))); | 5467 __ li(scratch, Operand(ExternalReference::isolate_address(masm->isolate()))); |
5466 // Push isolate and holder. | 5468 // Push isolate and holder. |
5467 __ Push(scratch, holder); | 5469 __ Push(scratch, holder); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5528 } | 5530 } |
5529 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, | 5531 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, |
5530 stack_space_offset, return_value_operand, | 5532 stack_space_offset, return_value_operand, |
5531 &context_restore_operand); | 5533 &context_restore_operand); |
5532 } | 5534 } |
5533 | 5535 |
5534 | 5536 |
5535 void CallApiFunctionStub::Generate(MacroAssembler* masm) { | 5537 void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
5536 bool call_data_undefined = this->call_data_undefined(); | 5538 bool call_data_undefined = this->call_data_undefined(); |
5537 CallApiFunctionStubHelper(masm, ParameterCount(a3), false, | 5539 CallApiFunctionStubHelper(masm, ParameterCount(a3), false, |
5538 call_data_undefined); | 5540 call_data_undefined, false); |
5539 } | 5541 } |
5540 | 5542 |
5541 | 5543 |
5542 void CallApiAccessorStub::Generate(MacroAssembler* masm) { | 5544 void CallApiAccessorStub::Generate(MacroAssembler* masm) { |
5543 bool is_store = this->is_store(); | 5545 bool is_store = this->is_store(); |
5544 int argc = this->argc(); | 5546 int argc = this->argc(); |
5545 bool call_data_undefined = this->call_data_undefined(); | 5547 bool call_data_undefined = this->call_data_undefined(); |
| 5548 bool is_lazy = this->is_lazy(); |
5546 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5549 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
5547 call_data_undefined); | 5550 call_data_undefined, is_lazy); |
5548 } | 5551 } |
5549 | 5552 |
5550 | 5553 |
5551 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5554 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
5552 // ----------- S t a t e ------------- | 5555 // ----------- S t a t e ------------- |
5553 // -- sp[0] : name | 5556 // -- sp[0] : name |
5554 // -- sp[4 - kArgsLength*4] : PropertyCallbackArguments object | 5557 // -- sp[4 - kArgsLength*4] : PropertyCallbackArguments object |
5555 // -- ... | 5558 // -- ... |
5556 // -- a2 : api_function_address | 5559 // -- a2 : api_function_address |
5557 // ----------------------------------- | 5560 // ----------------------------------- |
(...skipping 22 matching lines...) Expand all Loading... |
5580 MemOperand(fp, 6 * kPointerSize), NULL); | 5583 MemOperand(fp, 6 * kPointerSize), NULL); |
5581 } | 5584 } |
5582 | 5585 |
5583 | 5586 |
5584 #undef __ | 5587 #undef __ |
5585 | 5588 |
5586 } // namespace internal | 5589 } // namespace internal |
5587 } // namespace v8 | 5590 } // namespace v8 |
5588 | 5591 |
5589 #endif // V8_TARGET_ARCH_MIPS | 5592 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |