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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 5630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5641 __ mov(Operand::StaticVariable(limit_address), edi); | 5641 __ mov(Operand::StaticVariable(limit_address), edi); |
5642 __ mov(edi, eax); | 5642 __ mov(edi, eax); |
5643 __ mov(Operand(esp, 0), | 5643 __ mov(Operand(esp, 0), |
5644 Immediate(ExternalReference::isolate_address(isolate))); | 5644 Immediate(ExternalReference::isolate_address(isolate))); |
5645 __ mov(eax, Immediate(delete_extensions)); | 5645 __ mov(eax, Immediate(delete_extensions)); |
5646 __ call(eax); | 5646 __ call(eax); |
5647 __ mov(eax, edi); | 5647 __ mov(eax, edi); |
5648 __ jmp(&leave_exit_frame); | 5648 __ jmp(&leave_exit_frame); |
5649 } | 5649 } |
5650 | 5650 |
5651 | |
5652 static void CallApiFunctionStubHelper(MacroAssembler* masm, | 5651 static void CallApiFunctionStubHelper(MacroAssembler* masm, |
5653 const ParameterCount& argc, | 5652 const ParameterCount& argc, |
5654 bool return_first_arg, | 5653 bool return_first_arg, |
5655 bool call_data_undefined) { | 5654 bool call_data_undefined, bool is_lazy) { |
5656 // ----------- S t a t e ------------- | 5655 // ----------- S t a t e ------------- |
5657 // -- edi : callee | 5656 // -- edi : callee |
5658 // -- ebx : call_data | 5657 // -- ebx : call_data |
5659 // -- ecx : holder | 5658 // -- ecx : holder |
5660 // -- edx : api_function_address | 5659 // -- edx : api_function_address |
5661 // -- esi : context | 5660 // -- esi : context |
5662 // -- eax : number of arguments if argc is a register | 5661 // -- eax : number of arguments if argc is a register |
5663 // -- | 5662 // -- |
5664 // -- esp[0] : return address | 5663 // -- esp[0] : return address |
5665 // -- esp[4] : last argument | 5664 // -- esp[4] : last argument |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5719 // isolate | 5718 // isolate |
5720 __ push(Immediate(reinterpret_cast<int>(masm->isolate()))); | 5719 __ push(Immediate(reinterpret_cast<int>(masm->isolate()))); |
5721 // holder | 5720 // holder |
5722 __ push(holder); | 5721 __ push(holder); |
5723 | 5722 |
5724 __ mov(scratch, esp); | 5723 __ mov(scratch, esp); |
5725 | 5724 |
5726 // push return address | 5725 // push return address |
5727 __ push(return_address); | 5726 __ push(return_address); |
5728 | 5727 |
5729 // load context from callee | 5728 if (!is_lazy) { |
5730 __ mov(context, FieldOperand(callee, JSFunction::kContextOffset)); | 5729 // load context from callee |
| 5730 __ mov(context, FieldOperand(callee, JSFunction::kContextOffset)); |
| 5731 } |
5731 | 5732 |
5732 // API function gets reference to the v8::Arguments. If CPU profiler | 5733 // API function gets reference to the v8::Arguments. If CPU profiler |
5733 // is enabled wrapper function will be called and we need to pass | 5734 // is enabled wrapper function will be called and we need to pass |
5734 // address of the callback as additional parameter, always allocate | 5735 // address of the callback as additional parameter, always allocate |
5735 // space for it. | 5736 // space for it. |
5736 const int kApiArgc = 1 + 1; | 5737 const int kApiArgc = 1 + 1; |
5737 | 5738 |
5738 // Allocate the v8::Arguments structure in the arguments' space since | 5739 // Allocate the v8::Arguments structure in the arguments' space since |
5739 // it's not controlled by GC. | 5740 // it's not controlled by GC. |
5740 const int kApiStackSpace = 4; | 5741 const int kApiStackSpace = 4; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5792 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5793 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5793 ApiParameterOperand(1), stack_space, | 5794 ApiParameterOperand(1), stack_space, |
5794 stack_space_operand, return_value_operand, | 5795 stack_space_operand, return_value_operand, |
5795 &context_restore_operand); | 5796 &context_restore_operand); |
5796 } | 5797 } |
5797 | 5798 |
5798 | 5799 |
5799 void CallApiFunctionStub::Generate(MacroAssembler* masm) { | 5800 void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
5800 bool call_data_undefined = this->call_data_undefined(); | 5801 bool call_data_undefined = this->call_data_undefined(); |
5801 CallApiFunctionStubHelper(masm, ParameterCount(eax), false, | 5802 CallApiFunctionStubHelper(masm, ParameterCount(eax), false, |
5802 call_data_undefined); | 5803 call_data_undefined, false); |
5803 } | 5804 } |
5804 | 5805 |
5805 | 5806 |
5806 void CallApiAccessorStub::Generate(MacroAssembler* masm) { | 5807 void CallApiAccessorStub::Generate(MacroAssembler* masm) { |
5807 bool is_store = this->is_store(); | 5808 bool is_store = this->is_store(); |
5808 int argc = this->argc(); | 5809 int argc = this->argc(); |
5809 bool call_data_undefined = this->call_data_undefined(); | 5810 bool call_data_undefined = this->call_data_undefined(); |
| 5811 bool is_lazy = this->is_lazy(); |
5810 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5812 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
5811 call_data_undefined); | 5813 call_data_undefined, is_lazy); |
5812 } | 5814 } |
5813 | 5815 |
5814 | 5816 |
5815 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5817 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
5816 // ----------- S t a t e ------------- | 5818 // ----------- S t a t e ------------- |
5817 // -- esp[0] : return address | 5819 // -- esp[0] : return address |
5818 // -- esp[4] : name | 5820 // -- esp[4] : name |
5819 // -- esp[8 .. (8 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_ | 5821 // -- esp[8 .. (8 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_ |
5820 // -- ... | 5822 // -- ... |
5821 // -- edx : api_function_address | 5823 // -- edx : api_function_address |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5860 return_value_operand, NULL); | 5862 return_value_operand, NULL); |
5861 } | 5863 } |
5862 | 5864 |
5863 | 5865 |
5864 #undef __ | 5866 #undef __ |
5865 | 5867 |
5866 } // namespace internal | 5868 } // namespace internal |
5867 } // namespace v8 | 5869 } // namespace v8 |
5868 | 5870 |
5869 #endif // V8_TARGET_ARCH_IA32 | 5871 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |