| 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 5164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5175 __ mov(eax, Immediate(delete_extensions)); | 5175 __ mov(eax, Immediate(delete_extensions)); |
| 5176 __ call(eax); | 5176 __ call(eax); |
| 5177 __ mov(eax, edi); | 5177 __ mov(eax, edi); |
| 5178 __ jmp(&leave_exit_frame); | 5178 __ jmp(&leave_exit_frame); |
| 5179 } | 5179 } |
| 5180 | 5180 |
| 5181 | 5181 |
| 5182 static void CallApiFunctionStubHelper(MacroAssembler* masm, | 5182 static void CallApiFunctionStubHelper(MacroAssembler* masm, |
| 5183 const ParameterCount& argc, | 5183 const ParameterCount& argc, |
| 5184 bool return_first_arg, | 5184 bool return_first_arg, |
| 5185 bool call_data_undefined) { | 5185 bool call_data_undefined, bool is_lazy) { |
| 5186 // ----------- S t a t e ------------- | 5186 // ----------- S t a t e ------------- |
| 5187 // -- edi : callee | 5187 // -- edi : callee |
| 5188 // -- ebx : call_data | 5188 // -- ebx : call_data |
| 5189 // -- ecx : holder | 5189 // -- ecx : holder |
| 5190 // -- edx : api_function_address | 5190 // -- edx : api_function_address |
| 5191 // -- esi : context | 5191 // -- esi : context |
| 5192 // -- eax : number of arguments if argc is a register | 5192 // -- eax : number of arguments if argc is a register |
| 5193 // -- | 5193 // -- |
| 5194 // -- esp[0] : return address | 5194 // -- esp[0] : return address |
| 5195 // -- esp[4] : last argument | 5195 // -- esp[4] : last argument |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5249 // isolate | 5249 // isolate |
| 5250 __ push(Immediate(reinterpret_cast<int>(masm->isolate()))); | 5250 __ push(Immediate(reinterpret_cast<int>(masm->isolate()))); |
| 5251 // holder | 5251 // holder |
| 5252 __ push(holder); | 5252 __ push(holder); |
| 5253 | 5253 |
| 5254 __ mov(scratch, esp); | 5254 __ mov(scratch, esp); |
| 5255 | 5255 |
| 5256 // push return address | 5256 // push return address |
| 5257 __ push(return_address); | 5257 __ push(return_address); |
| 5258 | 5258 |
| 5259 // load context from callee | 5259 if (!is_lazy) { |
| 5260 __ mov(context, FieldOperand(callee, JSFunction::kContextOffset)); | 5260 // load context from callee |
| 5261 __ mov(context, FieldOperand(callee, JSFunction::kContextOffset)); |
| 5262 } |
| 5261 | 5263 |
| 5262 // API function gets reference to the v8::Arguments. If CPU profiler | 5264 // API function gets reference to the v8::Arguments. If CPU profiler |
| 5263 // is enabled wrapper function will be called and we need to pass | 5265 // is enabled wrapper function will be called and we need to pass |
| 5264 // address of the callback as additional parameter, always allocate | 5266 // address of the callback as additional parameter, always allocate |
| 5265 // space for it. | 5267 // space for it. |
| 5266 const int kApiArgc = 1 + 1; | 5268 const int kApiArgc = 1 + 1; |
| 5267 | 5269 |
| 5268 // Allocate the v8::Arguments structure in the arguments' space since | 5270 // Allocate the v8::Arguments structure in the arguments' space since |
| 5269 // it's not controlled by GC. | 5271 // it's not controlled by GC. |
| 5270 const int kApiStackSpace = 4; | 5272 const int kApiStackSpace = 4; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5322 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5324 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
| 5323 ApiParameterOperand(1), stack_space, | 5325 ApiParameterOperand(1), stack_space, |
| 5324 stack_space_operand, return_value_operand, | 5326 stack_space_operand, return_value_operand, |
| 5325 &context_restore_operand); | 5327 &context_restore_operand); |
| 5326 } | 5328 } |
| 5327 | 5329 |
| 5328 | 5330 |
| 5329 void CallApiFunctionStub::Generate(MacroAssembler* masm) { | 5331 void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
| 5330 bool call_data_undefined = this->call_data_undefined(); | 5332 bool call_data_undefined = this->call_data_undefined(); |
| 5331 CallApiFunctionStubHelper(masm, ParameterCount(eax), false, | 5333 CallApiFunctionStubHelper(masm, ParameterCount(eax), false, |
| 5332 call_data_undefined); | 5334 call_data_undefined, false); |
| 5333 } | 5335 } |
| 5334 | 5336 |
| 5335 | 5337 |
| 5336 void CallApiAccessorStub::Generate(MacroAssembler* masm) { | 5338 void CallApiAccessorStub::Generate(MacroAssembler* masm) { |
| 5337 bool is_store = this->is_store(); | 5339 bool is_store = this->is_store(); |
| 5338 int argc = this->argc(); | 5340 int argc = this->argc(); |
| 5339 bool call_data_undefined = this->call_data_undefined(); | 5341 bool call_data_undefined = this->call_data_undefined(); |
| 5342 bool is_lazy = this->is_lazy(); |
| 5340 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, | 5343 CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
| 5341 call_data_undefined); | 5344 call_data_undefined, is_lazy); |
| 5342 } | 5345 } |
| 5343 | 5346 |
| 5344 | 5347 |
| 5345 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5348 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
| 5346 // ----------- S t a t e ------------- | 5349 // ----------- S t a t e ------------- |
| 5347 // -- esp[0] : return address | 5350 // -- esp[0] : return address |
| 5348 // -- esp[4] : name | 5351 // -- esp[4] : name |
| 5349 // -- esp[8 - kArgsLength*4] : PropertyCallbackArguments object | 5352 // -- esp[8 - kArgsLength*4] : PropertyCallbackArguments object |
| 5350 // -- ... | 5353 // -- ... |
| 5351 // -- edx : api_function_address | 5354 // -- edx : api_function_address |
| (...skipping 26 matching lines...) Expand all Loading... |
| 5378 Operand(ebp, 7 * kPointerSize), NULL); | 5381 Operand(ebp, 7 * kPointerSize), NULL); |
| 5379 } | 5382 } |
| 5380 | 5383 |
| 5381 | 5384 |
| 5382 #undef __ | 5385 #undef __ |
| 5383 | 5386 |
| 5384 } // namespace internal | 5387 } // namespace internal |
| 5385 } // namespace v8 | 5388 } // namespace v8 |
| 5386 | 5389 |
| 5387 #endif // V8_TARGET_ARCH_X87 | 5390 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |