| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 5444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5455 __ StoreP(r15, MemOperand(r17, kLimitOffset)); | 5455 __ StoreP(r15, MemOperand(r17, kLimitOffset)); |
| 5456 __ mr(r14, r3); | 5456 __ mr(r14, r3); |
| 5457 __ PrepareCallCFunction(1, r15); | 5457 __ PrepareCallCFunction(1, r15); |
| 5458 __ mov(r3, Operand(ExternalReference::isolate_address(isolate))); | 5458 __ mov(r3, Operand(ExternalReference::isolate_address(isolate))); |
| 5459 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), | 5459 __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), |
| 5460 1); | 5460 1); |
| 5461 __ mr(r3, r14); | 5461 __ mr(r3, r14); |
| 5462 __ b(&leave_exit_frame); | 5462 __ b(&leave_exit_frame); |
| 5463 } | 5463 } |
| 5464 | 5464 |
| 5465 | |
| 5466 static void CallApiFunctionStubHelper(MacroAssembler* masm, | 5465 static void CallApiFunctionStubHelper(MacroAssembler* masm, |
| 5467 const ParameterCount& argc, | 5466 const ParameterCount& argc, |
| 5468 bool return_first_arg, | 5467 bool return_first_arg, |
| 5469 bool call_data_undefined) { | 5468 bool call_data_undefined, bool is_lazy) { |
| 5470 // ----------- S t a t e ------------- | 5469 // ----------- S t a t e ------------- |
| 5471 // -- r3 : callee | 5470 // -- r3 : callee |
| 5472 // -- r7 : call_data | 5471 // -- r7 : call_data |
| 5473 // -- r5 : holder | 5472 // -- r5 : holder |
| 5474 // -- r4 : api_function_address | 5473 // -- r4 : api_function_address |
| 5475 // -- r6 : number of arguments if argc is a register | 5474 // -- r6 : number of arguments if argc is a register |
| 5476 // -- cp : context | 5475 // -- cp : context |
| 5477 // -- | 5476 // -- |
| 5478 // -- sp[0] : last argument | 5477 // -- sp[0] : last argument |
| 5479 // -- ... | 5478 // -- ... |
| (...skipping 15 matching lines...) Expand all Loading... |
| 5495 STATIC_ASSERT(FCA::kReturnValueOffset == 3); | 5494 STATIC_ASSERT(FCA::kReturnValueOffset == 3); |
| 5496 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); | 5495 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); |
| 5497 STATIC_ASSERT(FCA::kIsolateIndex == 1); | 5496 STATIC_ASSERT(FCA::kIsolateIndex == 1); |
| 5498 STATIC_ASSERT(FCA::kHolderIndex == 0); | 5497 STATIC_ASSERT(FCA::kHolderIndex == 0); |
| 5499 STATIC_ASSERT(FCA::kArgsLength == 7); | 5498 STATIC_ASSERT(FCA::kArgsLength == 7); |
| 5500 | 5499 |
| 5501 DCHECK(argc.is_immediate() || r3.is(argc.reg())); | 5500 DCHECK(argc.is_immediate() || r3.is(argc.reg())); |
| 5502 | 5501 |
| 5503 // context save | 5502 // context save |
| 5504 __ push(context); | 5503 __ push(context); |
| 5505 // load context from callee | 5504 if (!is_lazy) { |
| 5506 __ LoadP(context, FieldMemOperand(callee, JSFunction::kContextOffset)); | 5505 // load context from callee |
| 5506 __ LoadP(context, FieldMemOperand(callee, JSFunction::kContextOffset)); |
| 5507 } |
| 5507 | 5508 |
| 5508 // callee | 5509 // callee |
| 5509 __ push(callee); | 5510 __ push(callee); |
| 5510 | 5511 |
| 5511 // call data | 5512 // call data |
| 5512 __ push(call_data); | 5513 __ push(call_data); |
| 5513 | 5514 |
| 5514 Register scratch = call_data; | 5515 Register scratch = call_data; |
| 5515 if (!call_data_undefined) { | 5516 if (!call_data_undefined) { |
| 5516 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); | 5517 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5595 } | 5596 } |
| 5596 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, | 5597 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, |
| 5597 stack_space_operand, return_value_operand, | 5598 stack_space_operand, return_value_operand, |
| 5598 &context_restore_operand); | 5599 &context_restore_operand); |
| 5599 } | 5600 } |
| 5600 | 5601 |
| 5601 | 5602 |
| 5602 void CallApiFunctionStub::Generate(MacroAssembler* masm) { | 5603 void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
| 5603 bool call_data_undefined = this->call_data_undefined(); | 5604 bool call_data_undefined = this->call_data_undefined(); |
| 5604 CallApiFunctionStubHelper(masm, ParameterCount(r6), false, | 5605 CallApiFunctionStubHelper(masm, ParameterCount(r6), false, |
| 5605 call_data_undefined); | 5606 call_data_undefined, false); |
| 5606 } | 5607 } |
| 5607 | 5608 |
| 5608 | 5609 |
| 5609 void CallApiAccessorStub::Generate(MacroAssembler* masm) { | 5610 void CallApiAccessorStub::Generate(MacroAssembler* masm) { |
| 5610 bool is_store = this->is_store(); | 5611 bool is_store = this->is_store(); |
| 5611 int argc = this->argc(); | 5612 int argc = this->argc(); |
| 5612 bool call_data_undefined = this->call_data_undefined(); | 5613 bool call_data_undefined = this->call_data_undefined(); |
| 5614 bool is_lazy = this->is_lazy(); |
| 5613 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5615 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
| 5614 call_data_undefined); | 5616 call_data_undefined, is_lazy); |
| 5615 } | 5617 } |
| 5616 | 5618 |
| 5617 | 5619 |
| 5618 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5620 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
| 5619 // ----------- S t a t e ------------- | 5621 // ----------- S t a t e ------------- |
| 5620 // -- sp[0] : name | 5622 // -- sp[0] : name |
| 5621 // -- sp[4 .. (4 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_ | 5623 // -- sp[4 .. (4 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_ |
| 5622 // -- ... | 5624 // -- ... |
| 5623 // -- r5 : api_function_address | 5625 // -- r5 : api_function_address |
| 5624 // ----------------------------------- | 5626 // ----------------------------------- |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5681 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5683 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
| 5682 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5684 kStackUnwindSpace, NULL, return_value_operand, NULL); |
| 5683 } | 5685 } |
| 5684 | 5686 |
| 5685 | 5687 |
| 5686 #undef __ | 5688 #undef __ |
| 5687 } // namespace internal | 5689 } // namespace internal |
| 5688 } // namespace v8 | 5690 } // namespace v8 |
| 5689 | 5691 |
| 5690 #endif // V8_TARGET_ARCH_PPC | 5692 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |