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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 5197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5208 __ mov(Operand::StaticVariable(limit_address), edi); | 5208 __ mov(Operand::StaticVariable(limit_address), edi); |
5209 __ mov(edi, eax); | 5209 __ mov(edi, eax); |
5210 __ mov(Operand(esp, 0), | 5210 __ mov(Operand(esp, 0), |
5211 Immediate(ExternalReference::isolate_address(isolate))); | 5211 Immediate(ExternalReference::isolate_address(isolate))); |
5212 __ mov(eax, Immediate(delete_extensions)); | 5212 __ mov(eax, Immediate(delete_extensions)); |
5213 __ call(eax); | 5213 __ call(eax); |
5214 __ mov(eax, edi); | 5214 __ mov(eax, edi); |
5215 __ jmp(&leave_exit_frame); | 5215 __ jmp(&leave_exit_frame); |
5216 } | 5216 } |
5217 | 5217 |
5218 | |
5219 static void CallApiFunctionStubHelper(MacroAssembler* masm, | 5218 static void CallApiFunctionStubHelper(MacroAssembler* masm, |
5220 const ParameterCount& argc, | 5219 const ParameterCount& argc, |
5221 bool return_first_arg, | 5220 bool return_first_arg, |
5222 bool call_data_undefined) { | 5221 bool call_data_undefined, bool is_lazy) { |
5223 // ----------- S t a t e ------------- | 5222 // ----------- S t a t e ------------- |
5224 // -- edi : callee | 5223 // -- edi : callee |
5225 // -- ebx : call_data | 5224 // -- ebx : call_data |
5226 // -- ecx : holder | 5225 // -- ecx : holder |
5227 // -- edx : api_function_address | 5226 // -- edx : api_function_address |
5228 // -- esi : context | 5227 // -- esi : context |
5229 // -- eax : number of arguments if argc is a register | 5228 // -- eax : number of arguments if argc is a register |
5230 // -- | 5229 // -- |
5231 // -- esp[0] : return address | 5230 // -- esp[0] : return address |
5232 // -- esp[4] : last argument | 5231 // -- esp[4] : last argument |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5286 // isolate | 5285 // isolate |
5287 __ push(Immediate(reinterpret_cast<int>(masm->isolate()))); | 5286 __ push(Immediate(reinterpret_cast<int>(masm->isolate()))); |
5288 // holder | 5287 // holder |
5289 __ push(holder); | 5288 __ push(holder); |
5290 | 5289 |
5291 __ mov(scratch, esp); | 5290 __ mov(scratch, esp); |
5292 | 5291 |
5293 // push return address | 5292 // push return address |
5294 __ push(return_address); | 5293 __ push(return_address); |
5295 | 5294 |
5296 // load context from callee | 5295 if (!is_lazy) { |
5297 __ mov(context, FieldOperand(callee, JSFunction::kContextOffset)); | 5296 // load context from callee |
| 5297 __ mov(context, FieldOperand(callee, JSFunction::kContextOffset)); |
| 5298 } |
5298 | 5299 |
5299 // API function gets reference to the v8::Arguments. If CPU profiler | 5300 // API function gets reference to the v8::Arguments. If CPU profiler |
5300 // is enabled wrapper function will be called and we need to pass | 5301 // is enabled wrapper function will be called and we need to pass |
5301 // address of the callback as additional parameter, always allocate | 5302 // address of the callback as additional parameter, always allocate |
5302 // space for it. | 5303 // space for it. |
5303 const int kApiArgc = 1 + 1; | 5304 const int kApiArgc = 1 + 1; |
5304 | 5305 |
5305 // Allocate the v8::Arguments structure in the arguments' space since | 5306 // Allocate the v8::Arguments structure in the arguments' space since |
5306 // it's not controlled by GC. | 5307 // it's not controlled by GC. |
5307 const int kApiStackSpace = 4; | 5308 const int kApiStackSpace = 4; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5359 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5360 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5360 ApiParameterOperand(1), stack_space, | 5361 ApiParameterOperand(1), stack_space, |
5361 stack_space_operand, return_value_operand, | 5362 stack_space_operand, return_value_operand, |
5362 &context_restore_operand); | 5363 &context_restore_operand); |
5363 } | 5364 } |
5364 | 5365 |
5365 | 5366 |
5366 void CallApiFunctionStub::Generate(MacroAssembler* masm) { | 5367 void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
5367 bool call_data_undefined = this->call_data_undefined(); | 5368 bool call_data_undefined = this->call_data_undefined(); |
5368 CallApiFunctionStubHelper(masm, ParameterCount(eax), false, | 5369 CallApiFunctionStubHelper(masm, ParameterCount(eax), false, |
5369 call_data_undefined); | 5370 call_data_undefined, false); |
5370 } | 5371 } |
5371 | 5372 |
5372 | 5373 |
5373 void CallApiAccessorStub::Generate(MacroAssembler* masm) { | 5374 void CallApiAccessorStub::Generate(MacroAssembler* masm) { |
5374 bool is_store = this->is_store(); | 5375 bool is_store = this->is_store(); |
5375 int argc = this->argc(); | 5376 int argc = this->argc(); |
5376 bool call_data_undefined = this->call_data_undefined(); | 5377 bool call_data_undefined = this->call_data_undefined(); |
| 5378 bool is_lazy = this->is_lazy(); |
5377 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5379 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
5378 call_data_undefined); | 5380 call_data_undefined, is_lazy); |
5379 } | 5381 } |
5380 | 5382 |
5381 | 5383 |
5382 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5384 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
5383 // ----------- S t a t e ------------- | 5385 // ----------- S t a t e ------------- |
5384 // -- esp[0] : return address | 5386 // -- esp[0] : return address |
5385 // -- esp[4] : name | 5387 // -- esp[4] : name |
5386 // -- esp[8 .. (8 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_ | 5388 // -- esp[8 .. (8 + kArgsLength*4)] : v8::PropertyCallbackInfo::args_ |
5387 // -- ... | 5389 // -- ... |
5388 // -- edx : api_function_address | 5390 // -- edx : api_function_address |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5427 return_value_operand, NULL); | 5429 return_value_operand, NULL); |
5428 } | 5430 } |
5429 | 5431 |
5430 | 5432 |
5431 #undef __ | 5433 #undef __ |
5432 | 5434 |
5433 } // namespace internal | 5435 } // namespace internal |
5434 } // namespace v8 | 5436 } // namespace v8 |
5435 | 5437 |
5436 #endif // V8_TARGET_ARCH_X87 | 5438 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |