Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(845)

Side by Side Diff: src/x64/builtins-x64.cc

Issue 1707133003: [Interpreter] Fix deopt when accumulator needs to be materialized. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments and add test Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ppc/builtins-ppc.cc ('k') | src/x87/builtins-x87.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_X64 5 #if V8_TARGET_ARCH_X64
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 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 __ addp(rbx, Immediate(Code::kHeaderSize - kHeapObjectTag)); 847 __ addp(rbx, Immediate(Code::kHeaderSize - kHeapObjectTag));
848 __ jmp(rbx); 848 __ jmp(rbx);
849 } 849 }
850 850
851 851
852 static void Generate_InterpreterNotifyDeoptimizedHelper( 852 static void Generate_InterpreterNotifyDeoptimizedHelper(
853 MacroAssembler* masm, Deoptimizer::BailoutType type) { 853 MacroAssembler* masm, Deoptimizer::BailoutType type) {
854 // Enter an internal frame. 854 // Enter an internal frame.
855 { 855 {
856 FrameScope scope(masm, StackFrame::INTERNAL); 856 FrameScope scope(masm, StackFrame::INTERNAL);
857 __ Push(kInterpreterAccumulatorRegister); // Save accumulator register.
858 857
859 // Pass the deoptimization type to the runtime system. 858 // Pass the deoptimization type to the runtime system.
860 __ Push(Smi::FromInt(static_cast<int>(type))); 859 __ Push(Smi::FromInt(static_cast<int>(type)));
861
862 __ CallRuntime(Runtime::kNotifyDeoptimized); 860 __ CallRuntime(Runtime::kNotifyDeoptimized);
863
864 __ Pop(kInterpreterAccumulatorRegister); // Restore accumulator register.
865 // Tear down internal frame. 861 // Tear down internal frame.
866 } 862 }
867 863
868 // Drop state (we don't use these for interpreter deopts) and push PC at top 864 // Drop state (we don't use these for interpreter deopts) and and pop the
865 // accumulator value into the accumulator register and push PC at top
869 // of stack (to simulate initial call to bytecode handler in interpreter entry 866 // of stack (to simulate initial call to bytecode handler in interpreter entry
870 // trampoline). 867 // trampoline).
871 __ Pop(rbx); 868 __ Pop(rbx);
872 __ Drop(1); 869 __ Drop(1);
870 __ Pop(kInterpreterAccumulatorRegister);
873 __ Push(rbx); 871 __ Push(rbx);
874 872
875 // Enter the bytecode dispatch. 873 // Enter the bytecode dispatch.
876 Generate_EnterBytecodeDispatch(masm); 874 Generate_EnterBytecodeDispatch(masm);
877 } 875 }
878 876
879 877
880 void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) { 878 void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) {
881 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); 879 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
882 } 880 }
(...skipping 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after
2847 __ ret(0); 2845 __ ret(0);
2848 } 2846 }
2849 2847
2850 2848
2851 #undef __ 2849 #undef __
2852 2850
2853 } // namespace internal 2851 } // namespace internal
2854 } // namespace v8 2852 } // namespace v8
2855 2853
2856 #endif // V8_TARGET_ARCH_X64 2854 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ppc/builtins-ppc.cc ('k') | src/x87/builtins-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698