| 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/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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 __ add(ebx, Immediate(Code::kHeaderSize - kHeapObjectTag)); | 795 __ add(ebx, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
| 796 __ jmp(ebx); | 796 __ jmp(ebx); |
| 797 } | 797 } |
| 798 | 798 |
| 799 | 799 |
| 800 static void Generate_InterpreterNotifyDeoptimizedHelper( | 800 static void Generate_InterpreterNotifyDeoptimizedHelper( |
| 801 MacroAssembler* masm, Deoptimizer::BailoutType type) { | 801 MacroAssembler* masm, Deoptimizer::BailoutType type) { |
| 802 // Enter an internal frame. | 802 // Enter an internal frame. |
| 803 { | 803 { |
| 804 FrameScope scope(masm, StackFrame::INTERNAL); | 804 FrameScope scope(masm, StackFrame::INTERNAL); |
| 805 __ Push(kInterpreterAccumulatorRegister); // Save accumulator register. | |
| 806 | 805 |
| 807 // Pass the deoptimization type to the runtime system. | 806 // Pass the deoptimization type to the runtime system. |
| 808 __ Push(Smi::FromInt(static_cast<int>(type))); | 807 __ Push(Smi::FromInt(static_cast<int>(type))); |
| 809 | |
| 810 __ CallRuntime(Runtime::kNotifyDeoptimized); | 808 __ CallRuntime(Runtime::kNotifyDeoptimized); |
| 811 | |
| 812 __ Pop(kInterpreterAccumulatorRegister); // Restore accumulator register. | |
| 813 // Tear down internal frame. | 809 // Tear down internal frame. |
| 814 } | 810 } |
| 815 | 811 |
| 816 // Drop state (we don't use these for interpreter deopts) and push PC at top | 812 // Drop state (we don't use these for interpreter deopts) and and pop the |
| 813 // accumulator value into the accumulator register and push PC at top |
| 817 // of stack (to simulate initial call to bytecode handler in interpreter entry | 814 // of stack (to simulate initial call to bytecode handler in interpreter entry |
| 818 // trampoline). | 815 // trampoline). |
| 819 __ Pop(ebx); | 816 __ Pop(ebx); |
| 820 __ Drop(1); | 817 __ Drop(1); |
| 818 __ Pop(kInterpreterAccumulatorRegister); |
| 821 __ Push(ebx); | 819 __ Push(ebx); |
| 822 | 820 |
| 823 // Enter the bytecode dispatch. | 821 // Enter the bytecode dispatch. |
| 824 Generate_EnterBytecodeDispatch(masm); | 822 Generate_EnterBytecodeDispatch(masm); |
| 825 } | 823 } |
| 826 | 824 |
| 827 | 825 |
| 828 void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) { | 826 void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) { |
| 829 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); | 827 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); |
| 830 } | 828 } |
| (...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2796 | 2794 |
| 2797 __ bind(&ok); | 2795 __ bind(&ok); |
| 2798 __ ret(0); | 2796 __ ret(0); |
| 2799 } | 2797 } |
| 2800 | 2798 |
| 2801 #undef __ | 2799 #undef __ |
| 2802 } // namespace internal | 2800 } // namespace internal |
| 2803 } // namespace v8 | 2801 } // namespace v8 |
| 2804 | 2802 |
| 2805 #endif // V8_TARGET_ARCH_X87 | 2803 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |