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

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

Issue 1605633003: [interpreter] First implementation of stack unwinding. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_int-5
Patch Set: Rebase and skip one more test. Created 4 years, 11 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/arm/builtins-arm.cc ('k') | src/builtins.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 __ LeaveFrame(StackFrame::JAVA_SCRIPT); 1011 __ LeaveFrame(StackFrame::JAVA_SCRIPT);
1012 1012
1013 // Drop receiver + arguments and return. 1013 // Drop receiver + arguments and return.
1014 __ Ldr(w1, FieldMemOperand(kInterpreterBytecodeArrayRegister, 1014 __ Ldr(w1, FieldMemOperand(kInterpreterBytecodeArrayRegister,
1015 BytecodeArray::kParameterSizeOffset)); 1015 BytecodeArray::kParameterSizeOffset));
1016 __ Drop(x1, 1); 1016 __ Drop(x1, 1);
1017 __ Ret(); 1017 __ Ret();
1018 } 1018 }
1019 1019
1020 1020
1021 static void Generate_InterpreterNotifyDeoptimizedHelper( 1021 static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) {
1022 MacroAssembler* masm, Deoptimizer::BailoutType type) {
1023 // Enter an internal frame.
1024 {
1025 FrameScope scope(masm, StackFrame::INTERNAL);
1026 __ Push(kInterpreterAccumulatorRegister); // Save accumulator register.
1027
1028 // Pass the deoptimization type to the runtime system.
1029 __ Mov(x1, Operand(Smi::FromInt(static_cast<int>(type))));
1030 __ Push(x1);
1031 __ CallRuntime(Runtime::kNotifyDeoptimized);
1032
1033 __ Pop(kInterpreterAccumulatorRegister); // Restore accumulator register.
1034 // Tear down internal frame.
1035 }
1036
1037 // Drop state (we don't use this for interpreter deopts).
1038 __ Drop(1);
1039
1040 // Initialize register file register and dispatch table register. 1022 // Initialize register file register and dispatch table register.
1041 __ Add(kInterpreterRegisterFileRegister, fp, 1023 __ Add(kInterpreterRegisterFileRegister, fp,
1042 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); 1024 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp));
1043 __ LoadRoot(kInterpreterDispatchTableRegister, 1025 __ LoadRoot(kInterpreterDispatchTableRegister,
1044 Heap::kInterpreterTableRootIndex); 1026 Heap::kInterpreterTableRootIndex);
1045 __ Add(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, 1027 __ Add(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister,
1046 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 1028 Operand(FixedArray::kHeaderSize - kHeapObjectTag));
1047 1029
1048 // Get the context from the frame. 1030 // Get the context from the frame.
1049 // TODO(rmcilroy): Update interpreter frame to expect current context at the 1031 // TODO(rmcilroy): Update interpreter frame to expect current context at the
(...skipping 29 matching lines...) Expand all
1079 // Dispatch to the target bytecode. 1061 // Dispatch to the target bytecode.
1080 __ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister, 1062 __ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister,
1081 kInterpreterBytecodeOffsetRegister)); 1063 kInterpreterBytecodeOffsetRegister));
1082 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2)); 1064 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2));
1083 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1)); 1065 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1));
1084 __ Add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag)); 1066 __ Add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag));
1085 __ Jump(ip0); 1067 __ Jump(ip0);
1086 } 1068 }
1087 1069
1088 1070
1071 static void Generate_InterpreterNotifyDeoptimizedHelper(
1072 MacroAssembler* masm, Deoptimizer::BailoutType type) {
1073 // Enter an internal frame.
1074 {
1075 FrameScope scope(masm, StackFrame::INTERNAL);
1076 __ Push(kInterpreterAccumulatorRegister); // Save accumulator register.
1077
1078 // Pass the deoptimization type to the runtime system.
1079 __ Mov(x1, Operand(Smi::FromInt(static_cast<int>(type))));
1080 __ Push(x1);
1081 __ CallRuntime(Runtime::kNotifyDeoptimized);
1082
1083 __ Pop(kInterpreterAccumulatorRegister); // Restore accumulator register.
1084 // Tear down internal frame.
1085 }
1086
1087 // Drop state (we don't use this for interpreter deopts).
1088 __ Drop(1);
1089
1090 // Enter the bytecode dispatch.
1091 Generate_EnterBytecodeDispatch(masm);
1092 }
1093
1094
1089 void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) { 1095 void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) {
1090 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); 1096 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
1091 } 1097 }
1092 1098
1093 1099
1094 void Builtins::Generate_InterpreterNotifySoftDeoptimized(MacroAssembler* masm) { 1100 void Builtins::Generate_InterpreterNotifySoftDeoptimized(MacroAssembler* masm) {
1095 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::SOFT); 1101 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::SOFT);
1096 } 1102 }
1097 1103
1098 1104
1099 void Builtins::Generate_InterpreterNotifyLazyDeoptimized(MacroAssembler* masm) { 1105 void Builtins::Generate_InterpreterNotifyLazyDeoptimized(MacroAssembler* masm) {
1100 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); 1106 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::LAZY);
1101 } 1107 }
1102 1108
1103 1109
1110 void Builtins::Generate_InterpreterEnterExceptionHandler(MacroAssembler* masm) {
1111 Generate_EnterBytecodeDispatch(masm);
1112 }
1113
1114
1104 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { 1115 void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
1105 CallRuntimePassFunction(masm, Runtime::kCompileLazy); 1116 CallRuntimePassFunction(masm, Runtime::kCompileLazy);
1106 GenerateTailCallToReturnedCode(masm); 1117 GenerateTailCallToReturnedCode(masm);
1107 } 1118 }
1108 1119
1109 1120
1110 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) { 1121 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) {
1111 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_NotConcurrent); 1122 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_NotConcurrent);
1112 GenerateTailCallToReturnedCode(masm); 1123 GenerateTailCallToReturnedCode(masm);
1113 } 1124 }
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after
2599 } 2610 }
2600 } 2611 }
2601 2612
2602 2613
2603 #undef __ 2614 #undef __
2604 2615
2605 } // namespace internal 2616 } // namespace internal
2606 } // namespace v8 2617 } // namespace v8
2607 2618
2608 #endif // V8_TARGET_ARCH_ARM 2619 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698