| 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 5517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5528 __ mov(Operand::StaticVariable(limit_address), edi); | 5528 __ mov(Operand::StaticVariable(limit_address), edi); |
| 5529 __ mov(edi, eax); | 5529 __ mov(edi, eax); |
| 5530 __ mov(Operand(esp, 0), | 5530 __ mov(Operand(esp, 0), |
| 5531 Immediate(ExternalReference::isolate_address(isolate))); | 5531 Immediate(ExternalReference::isolate_address(isolate))); |
| 5532 __ mov(eax, Immediate(delete_extensions)); | 5532 __ mov(eax, Immediate(delete_extensions)); |
| 5533 __ call(eax); | 5533 __ call(eax); |
| 5534 __ mov(eax, edi); | 5534 __ mov(eax, edi); |
| 5535 __ jmp(&leave_exit_frame); | 5535 __ jmp(&leave_exit_frame); |
| 5536 } | 5536 } |
| 5537 | 5537 |
| 5538 | |
| 5539 static void CallApiFunctionStubHelper(MacroAssembler* masm, | 5538 static void CallApiFunctionStubHelper(MacroAssembler* masm, |
| 5540 const ParameterCount& argc, | 5539 const ParameterCount& argc, |
| 5541 bool return_first_arg, | 5540 bool return_first_arg, |
| 5542 bool call_data_undefined) { | 5541 bool call_data_undefined, bool is_lazy) { |
| 5543 // ----------- S t a t e ------------- | 5542 // ----------- S t a t e ------------- |
| 5544 // -- edi : callee | 5543 // -- edi : callee |
| 5545 // -- ebx : call_data | 5544 // -- ebx : call_data |
| 5546 // -- ecx : holder | 5545 // -- ecx : holder |
| 5547 // -- edx : api_function_address | 5546 // -- edx : api_function_address |
| 5548 // -- esi : context | 5547 // -- esi : context |
| 5549 // -- eax : number of arguments if argc is a register | 5548 // -- eax : number of arguments if argc is a register |
| 5550 // -- | 5549 // -- |
| 5551 // -- esp[0] : return address | 5550 // -- esp[0] : return address |
| 5552 // -- esp[4] : last argument | 5551 // -- esp[4] : last argument |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5606 // isolate | 5605 // isolate |
| 5607 __ push(Immediate(reinterpret_cast<int>(masm->isolate()))); | 5606 __ push(Immediate(reinterpret_cast<int>(masm->isolate()))); |
| 5608 // holder | 5607 // holder |
| 5609 __ push(holder); | 5608 __ push(holder); |
| 5610 | 5609 |
| 5611 __ mov(scratch, esp); | 5610 __ mov(scratch, esp); |
| 5612 | 5611 |
| 5613 // push return address | 5612 // push return address |
| 5614 __ push(return_address); | 5613 __ push(return_address); |
| 5615 | 5614 |
| 5616 // load context from callee | 5615 if (!is_lazy) { |
| 5617 __ mov(context, FieldOperand(callee, JSFunction::kContextOffset)); | 5616 // load context from callee |
| 5617 __ mov(context, FieldOperand(callee, JSFunction::kContextOffset)); |
| 5618 } |
| 5618 | 5619 |
| 5619 // API function gets reference to the v8::Arguments. If CPU profiler | 5620 // API function gets reference to the v8::Arguments. If CPU profiler |
| 5620 // is enabled wrapper function will be called and we need to pass | 5621 // is enabled wrapper function will be called and we need to pass |
| 5621 // address of the callback as additional parameter, always allocate | 5622 // address of the callback as additional parameter, always allocate |
| 5622 // space for it. | 5623 // space for it. |
| 5623 const int kApiArgc = 1 + 1; | 5624 const int kApiArgc = 1 + 1; |
| 5624 | 5625 |
| 5625 // Allocate the v8::Arguments structure in the arguments' space since | 5626 // Allocate the v8::Arguments structure in the arguments' space since |
| 5626 // it's not controlled by GC. | 5627 // it's not controlled by GC. |
| 5627 const int kApiStackSpace = 4; | 5628 const int kApiStackSpace = 4; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5679 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5680 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
| 5680 ApiParameterOperand(1), stack_space, | 5681 ApiParameterOperand(1), stack_space, |
| 5681 stack_space_operand, return_value_operand, | 5682 stack_space_operand, return_value_operand, |
| 5682 &context_restore_operand); | 5683 &context_restore_operand); |
| 5683 } | 5684 } |
| 5684 | 5685 |
| 5685 | 5686 |
| 5686 void CallApiFunctionStub::Generate(MacroAssembler* masm) { | 5687 void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
| 5687 bool call_data_undefined = this->call_data_undefined(); | 5688 bool call_data_undefined = this->call_data_undefined(); |
| 5688 CallApiFunctionStubHelper(masm, ParameterCount(eax), false, | 5689 CallApiFunctionStubHelper(masm, ParameterCount(eax), false, |
| 5689 call_data_undefined); | 5690 call_data_undefined, false); |
| 5690 } | 5691 } |
| 5691 | 5692 |
| 5692 | 5693 |
| 5693 void CallApiAccessorStub::Generate(MacroAssembler* masm) { | 5694 void CallApiAccessorStub::Generate(MacroAssembler* masm) { |
| 5694 bool is_store = this->is_store(); | 5695 bool is_store = this->is_store(); |
| 5695 int argc = this->argc(); | 5696 int argc = this->argc(); |
| 5696 bool call_data_undefined = this->call_data_undefined(); | 5697 bool call_data_undefined = this->call_data_undefined(); |
| 5698 bool is_lazy = this->is_lazy(); |
| 5697 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5699 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
| 5698 call_data_undefined); | 5700 call_data_undefined, is_lazy); |
| 5699 } | 5701 } |
| 5700 | 5702 |
| 5701 | 5703 |
| 5702 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5704 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
| 5703 // ----------- S t a t e ------------- | 5705 // ----------- S t a t e ------------- |
| 5704 // -- esp[0] : return address | 5706 // -- esp[0] : return address |
| 5705 // -- esp[4] : name | 5707 // -- esp[4] : name |
| 5706 // -- esp[8 .. (8 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_ | 5708 // -- esp[8 .. (8 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_ |
| 5707 // -- ... | 5709 // -- ... |
| 5708 // -- edx : api_function_address | 5710 // -- edx : api_function_address |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5747 return_value_operand, NULL); | 5749 return_value_operand, NULL); |
| 5748 } | 5750 } |
| 5749 | 5751 |
| 5750 | 5752 |
| 5751 #undef __ | 5753 #undef __ |
| 5752 | 5754 |
| 5753 } // namespace internal | 5755 } // namespace internal |
| 5754 } // namespace v8 | 5756 } // namespace v8 |
| 5755 | 5757 |
| 5756 #endif // V8_TARGET_ARCH_IA32 | 5758 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |