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