| 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 2407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2418 } | 2418 } |
| 2419 | 2419 |
| 2420 | 2420 |
| 2421 void CEntryStub::Generate(MacroAssembler* masm) { | 2421 void CEntryStub::Generate(MacroAssembler* masm) { |
| 2422 // eax: number of arguments including receiver | 2422 // eax: number of arguments including receiver |
| 2423 // ebx: pointer to C function (C callee-saved) | 2423 // ebx: pointer to C function (C callee-saved) |
| 2424 // ebp: frame pointer (restored after C call) | 2424 // ebp: frame pointer (restored after C call) |
| 2425 // esp: stack pointer (restored after C call) | 2425 // esp: stack pointer (restored after C call) |
| 2426 // esi: current context (C callee-saved) | 2426 // esi: current context (C callee-saved) |
| 2427 // edi: JS function of the caller (C callee-saved) | 2427 // edi: JS function of the caller (C callee-saved) |
| 2428 // | |
| 2429 // If argv_in_register(): | |
| 2430 // ecx: pointer to the first argument | |
| 2431 | 2428 |
| 2432 ProfileEntryHookStub::MaybeCallEntryHook(masm); | 2429 ProfileEntryHookStub::MaybeCallEntryHook(masm); |
| 2433 | 2430 |
| 2434 // Enter the exit frame that transitions from JavaScript to C++. | 2431 // Enter the exit frame that transitions from JavaScript to C++. |
| 2435 if (argv_in_register()) { | 2432 __ EnterExitFrame(save_doubles()); |
| 2436 DCHECK(!save_doubles()); | |
| 2437 __ EnterApiExitFrame(3); | |
| 2438 | |
| 2439 // Move argc and argv into the correct registers. | |
| 2440 __ mov(esi, ecx); | |
| 2441 __ mov(edi, eax); | |
| 2442 } else { | |
| 2443 __ EnterExitFrame(save_doubles()); | |
| 2444 } | |
| 2445 | 2433 |
| 2446 // ebx: pointer to C function (C callee-saved) | 2434 // ebx: pointer to C function (C callee-saved) |
| 2447 // ebp: frame pointer (restored after C call) | 2435 // ebp: frame pointer (restored after C call) |
| 2448 // esp: stack pointer (restored after C call) | 2436 // esp: stack pointer (restored after C call) |
| 2449 // edi: number of arguments including receiver (C callee-saved) | 2437 // edi: number of arguments including receiver (C callee-saved) |
| 2450 // esi: pointer to the first argument (C callee-saved) | 2438 // esi: pointer to the first argument (C callee-saved) |
| 2451 | 2439 |
| 2452 // Result returned in eax, or eax+edx if result size is 2. | 2440 // Result returned in eax, or eax+edx if result size is 2. |
| 2453 | 2441 |
| 2454 // Check stack alignment. | 2442 // Check stack alignment. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 2479 Isolate::kPendingExceptionAddress, isolate()); | 2467 Isolate::kPendingExceptionAddress, isolate()); |
| 2480 __ cmp(edx, Operand::StaticVariable(pending_exception_address)); | 2468 __ cmp(edx, Operand::StaticVariable(pending_exception_address)); |
| 2481 // Cannot use check here as it attempts to generate call into runtime. | 2469 // Cannot use check here as it attempts to generate call into runtime. |
| 2482 __ j(equal, &okay, Label::kNear); | 2470 __ j(equal, &okay, Label::kNear); |
| 2483 __ int3(); | 2471 __ int3(); |
| 2484 __ bind(&okay); | 2472 __ bind(&okay); |
| 2485 __ pop(edx); | 2473 __ pop(edx); |
| 2486 } | 2474 } |
| 2487 | 2475 |
| 2488 // Exit the JavaScript to C++ exit frame. | 2476 // Exit the JavaScript to C++ exit frame. |
| 2489 __ LeaveExitFrame(save_doubles(), !argv_in_register()); | 2477 __ LeaveExitFrame(save_doubles()); |
| 2490 __ ret(0); | 2478 __ ret(0); |
| 2491 | 2479 |
| 2492 // Handling of exception. | 2480 // Handling of exception. |
| 2493 __ bind(&exception_returned); | 2481 __ bind(&exception_returned); |
| 2494 | 2482 |
| 2495 ExternalReference pending_handler_context_address( | 2483 ExternalReference pending_handler_context_address( |
| 2496 Isolate::kPendingHandlerContextAddress, isolate()); | 2484 Isolate::kPendingHandlerContextAddress, isolate()); |
| 2497 ExternalReference pending_handler_code_address( | 2485 ExternalReference pending_handler_code_address( |
| 2498 Isolate::kPendingHandlerCodeAddress, isolate()); | 2486 Isolate::kPendingHandlerCodeAddress, isolate()); |
| 2499 ExternalReference pending_handler_offset_address( | 2487 ExternalReference pending_handler_offset_address( |
| (...skipping 3327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5827 Operand(ebp, 7 * kPointerSize), NULL); | 5815 Operand(ebp, 7 * kPointerSize), NULL); |
| 5828 } | 5816 } |
| 5829 | 5817 |
| 5830 | 5818 |
| 5831 #undef __ | 5819 #undef __ |
| 5832 | 5820 |
| 5833 } // namespace internal | 5821 } // namespace internal |
| 5834 } // namespace v8 | 5822 } // namespace v8 |
| 5835 | 5823 |
| 5836 #endif // V8_TARGET_ARCH_IA32 | 5824 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |