| 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/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
| 10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
| (...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 __ add(ebx, Immediate(Code::kHeaderSize - kHeapObjectTag)); | 793 __ add(ebx, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
| 794 __ jmp(ebx); | 794 __ jmp(ebx); |
| 795 } | 795 } |
| 796 | 796 |
| 797 | 797 |
| 798 static void Generate_InterpreterNotifyDeoptimizedHelper( | 798 static void Generate_InterpreterNotifyDeoptimizedHelper( |
| 799 MacroAssembler* masm, Deoptimizer::BailoutType type) { | 799 MacroAssembler* masm, Deoptimizer::BailoutType type) { |
| 800 // Enter an internal frame. | 800 // Enter an internal frame. |
| 801 { | 801 { |
| 802 FrameScope scope(masm, StackFrame::INTERNAL); | 802 FrameScope scope(masm, StackFrame::INTERNAL); |
| 803 __ Push(kInterpreterAccumulatorRegister); // Save accumulator register. | |
| 804 | 803 |
| 805 // Pass the deoptimization type to the runtime system. | 804 // Pass the deoptimization type to the runtime system. |
| 806 __ Push(Smi::FromInt(static_cast<int>(type))); | 805 __ Push(Smi::FromInt(static_cast<int>(type))); |
| 807 | |
| 808 __ CallRuntime(Runtime::kNotifyDeoptimized); | 806 __ CallRuntime(Runtime::kNotifyDeoptimized); |
| 809 | |
| 810 __ Pop(kInterpreterAccumulatorRegister); // Restore accumulator register. | |
| 811 // Tear down internal frame. | 807 // Tear down internal frame. |
| 812 } | 808 } |
| 813 | 809 |
| 814 // Drop state (we don't use these for interpreter deopts) and push PC at top | 810 // Drop state (we don't use these for interpreter deopts) and and pop the |
| 811 // accumulator value into the accumulator register and push PC at top |
| 815 // of stack (to simulate initial call to bytecode handler in interpreter entry | 812 // of stack (to simulate initial call to bytecode handler in interpreter entry |
| 816 // trampoline). | 813 // trampoline). |
| 817 __ Pop(ebx); | 814 __ Pop(ebx); |
| 818 __ Drop(1); | 815 __ Drop(1); |
| 816 __ Pop(kInterpreterAccumulatorRegister); |
| 819 __ Push(ebx); | 817 __ Push(ebx); |
| 820 | 818 |
| 821 // Enter the bytecode dispatch. | 819 // Enter the bytecode dispatch. |
| 822 Generate_EnterBytecodeDispatch(masm); | 820 Generate_EnterBytecodeDispatch(masm); |
| 823 } | 821 } |
| 824 | 822 |
| 825 | 823 |
| 826 void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) { | 824 void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) { |
| 827 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); | 825 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); |
| 828 } | 826 } |
| (...skipping 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2769 | 2767 |
| 2770 __ bind(&ok); | 2768 __ bind(&ok); |
| 2771 __ ret(0); | 2769 __ ret(0); |
| 2772 } | 2770 } |
| 2773 | 2771 |
| 2774 #undef __ | 2772 #undef __ |
| 2775 } // namespace internal | 2773 } // namespace internal |
| 2776 } // namespace v8 | 2774 } // namespace v8 |
| 2777 | 2775 |
| 2778 #endif // V8_TARGET_ARCH_IA32 | 2776 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |