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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 2539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2550 // eax: number of arguments including receiver | 2550 // eax: number of arguments including receiver |
2551 // ebx: pointer to C function (C callee-saved) | 2551 // ebx: pointer to C function (C callee-saved) |
2552 // ebp: frame pointer (restored after C call) | 2552 // ebp: frame pointer (restored after C call) |
2553 // esp: stack pointer (restored after C call) | 2553 // esp: stack pointer (restored after C call) |
2554 // esi: current context (C callee-saved) | 2554 // esi: current context (C callee-saved) |
2555 // edi: JS function of the caller (C callee-saved) | 2555 // edi: JS function of the caller (C callee-saved) |
2556 | 2556 |
2557 ProfileEntryHookStub::MaybeCallEntryHook(masm); | 2557 ProfileEntryHookStub::MaybeCallEntryHook(masm); |
2558 | 2558 |
2559 // Enter the exit frame that transitions from JavaScript to C++. | 2559 // Enter the exit frame that transitions from JavaScript to C++. |
2560 __ EnterExitFrame(save_doubles_ == kSaveFPRegs); | 2560 __ EnterExitFrame(save_doubles()); |
2561 | 2561 |
2562 // ebx: pointer to C function (C callee-saved) | 2562 // ebx: pointer to C function (C callee-saved) |
2563 // ebp: frame pointer (restored after C call) | 2563 // ebp: frame pointer (restored after C call) |
2564 // esp: stack pointer (restored after C call) | 2564 // esp: stack pointer (restored after C call) |
2565 // edi: number of arguments including receiver (C callee-saved) | 2565 // edi: number of arguments including receiver (C callee-saved) |
2566 // esi: pointer to the first argument (C callee-saved) | 2566 // esi: pointer to the first argument (C callee-saved) |
2567 | 2567 |
2568 // Result returned in eax, or eax+edx if result_size_ is 2. | 2568 // Result returned in eax, or eax+edx if result size is 2. |
2569 | 2569 |
2570 // Check stack alignment. | 2570 // Check stack alignment. |
2571 if (FLAG_debug_code) { | 2571 if (FLAG_debug_code) { |
2572 __ CheckStackAlignment(); | 2572 __ CheckStackAlignment(); |
2573 } | 2573 } |
2574 | 2574 |
2575 // Call C function. | 2575 // Call C function. |
2576 __ mov(Operand(esp, 0 * kPointerSize), edi); // argc. | 2576 __ mov(Operand(esp, 0 * kPointerSize), edi); // argc. |
2577 __ mov(Operand(esp, 1 * kPointerSize), esi); // argv. | 2577 __ mov(Operand(esp, 1 * kPointerSize), esi); // argv. |
2578 __ mov(Operand(esp, 2 * kPointerSize), | 2578 __ mov(Operand(esp, 2 * kPointerSize), |
(...skipping 27 matching lines...) Expand all Loading... |
2606 Label okay; | 2606 Label okay; |
2607 __ cmp(edx, Operand::StaticVariable(pending_exception_address)); | 2607 __ cmp(edx, Operand::StaticVariable(pending_exception_address)); |
2608 // Cannot use check here as it attempts to generate call into runtime. | 2608 // Cannot use check here as it attempts to generate call into runtime. |
2609 __ j(equal, &okay, Label::kNear); | 2609 __ j(equal, &okay, Label::kNear); |
2610 __ int3(); | 2610 __ int3(); |
2611 __ bind(&okay); | 2611 __ bind(&okay); |
2612 __ pop(edx); | 2612 __ pop(edx); |
2613 } | 2613 } |
2614 | 2614 |
2615 // Exit the JavaScript to C++ exit frame. | 2615 // Exit the JavaScript to C++ exit frame. |
2616 __ LeaveExitFrame(save_doubles_ == kSaveFPRegs); | 2616 __ LeaveExitFrame(save_doubles()); |
2617 __ ret(0); | 2617 __ ret(0); |
2618 | 2618 |
2619 // Handling of exception. | 2619 // Handling of exception. |
2620 __ bind(&exception_returned); | 2620 __ bind(&exception_returned); |
2621 | 2621 |
2622 // Retrieve the pending exception. | 2622 // Retrieve the pending exception. |
2623 __ mov(eax, Operand::StaticVariable(pending_exception_address)); | 2623 __ mov(eax, Operand::StaticVariable(pending_exception_address)); |
2624 | 2624 |
2625 // Clear the pending exception. | 2625 // Clear the pending exception. |
2626 __ mov(edx, Immediate(isolate()->factory()->the_hole_value())); | 2626 __ mov(edx, Immediate(isolate()->factory()->the_hole_value())); |
(...skipping 2378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5005 Operand(ebp, 7 * kPointerSize), | 5005 Operand(ebp, 7 * kPointerSize), |
5006 NULL); | 5006 NULL); |
5007 } | 5007 } |
5008 | 5008 |
5009 | 5009 |
5010 #undef __ | 5010 #undef __ |
5011 | 5011 |
5012 } } // namespace v8::internal | 5012 } } // namespace v8::internal |
5013 | 5013 |
5014 #endif // V8_TARGET_ARCH_IA32 | 5014 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |