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

Side by Side Diff: src/mips64/builtins-mips64.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/mips/builtins-mips.cc ('k') | src/x64/builtins-x64.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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 #include "src/codegen.h" 7 #include "src/codegen.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.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 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 __ Daddu(a2, a2, Operand(-kPointerSize)); 1039 __ Daddu(a2, a2, Operand(-kPointerSize));
1040 __ push(t1); 1040 __ push(t1);
1041 __ bind(&loop_check); 1041 __ bind(&loop_check);
1042 __ Branch(&loop_header, gt, a2, Operand(t0)); 1042 __ Branch(&loop_header, gt, a2, Operand(t0));
1043 1043
1044 // Call the constructor with a0, a1, and a3 unmodified. 1044 // Call the constructor with a0, a1, and a3 unmodified.
1045 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); 1045 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
1046 } 1046 }
1047 1047
1048 1048
1049 static void Generate_InterpreterNotifyDeoptimizedHelper( 1049 static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) {
1050 MacroAssembler* masm, Deoptimizer::BailoutType type) {
1051 // Enter an internal frame.
1052 {
1053 FrameScope scope(masm, StackFrame::INTERNAL);
1054 __ push(kInterpreterAccumulatorRegister); // Save accumulator register.
1055
1056 // Pass the deoptimization type to the runtime system.
1057 __ li(a1, Operand(Smi::FromInt(static_cast<int>(type))));
1058 __ push(a1);
1059 __ CallRuntime(Runtime::kNotifyDeoptimized);
1060
1061 __ pop(kInterpreterAccumulatorRegister); // Restore accumulator register.
1062 // Tear down internal frame.
1063 }
1064
1065 // Drop state (we don't use this for interpreter deopts).
1066 __ Drop(1);
1067
1068 // Initialize register file register and dispatch table register. 1050 // Initialize register file register and dispatch table register.
1069 __ Daddu(kInterpreterRegisterFileRegister, fp, 1051 __ Daddu(kInterpreterRegisterFileRegister, fp,
1070 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); 1052 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp));
1071 __ LoadRoot(kInterpreterDispatchTableRegister, 1053 __ LoadRoot(kInterpreterDispatchTableRegister,
1072 Heap::kInterpreterTableRootIndex); 1054 Heap::kInterpreterTableRootIndex);
1073 __ Daddu(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, 1055 __ Daddu(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister,
1074 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 1056 Operand(FixedArray::kHeaderSize - kHeapObjectTag));
1075 1057
1076 // Get the context from the frame. 1058 // Get the context from the frame.
1077 // TODO(rmcilroy): Update interpreter frame to expect current context at the 1059 // TODO(rmcilroy): Update interpreter frame to expect current context at the
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 kInterpreterBytecodeOffsetRegister); 1092 kInterpreterBytecodeOffsetRegister);
1111 __ lbu(a1, MemOperand(a1)); 1093 __ lbu(a1, MemOperand(a1));
1112 __ dsll(a1, a1, kPointerSizeLog2); 1094 __ dsll(a1, a1, kPointerSizeLog2);
1113 __ Daddu(a1, kInterpreterDispatchTableRegister, a1); 1095 __ Daddu(a1, kInterpreterDispatchTableRegister, a1);
1114 __ ld(a1, MemOperand(a1)); 1096 __ ld(a1, MemOperand(a1));
1115 __ Daddu(a1, a1, Operand(Code::kHeaderSize - kHeapObjectTag)); 1097 __ Daddu(a1, a1, Operand(Code::kHeaderSize - kHeapObjectTag));
1116 __ Jump(a1); 1098 __ Jump(a1);
1117 } 1099 }
1118 1100
1119 1101
1102 static void Generate_InterpreterNotifyDeoptimizedHelper(
1103 MacroAssembler* masm, Deoptimizer::BailoutType type) {
1104 // Enter an internal frame.
1105 {
1106 FrameScope scope(masm, StackFrame::INTERNAL);
1107 __ push(kInterpreterAccumulatorRegister); // Save accumulator register.
1108
1109 // Pass the deoptimization type to the runtime system.
1110 __ li(a1, Operand(Smi::FromInt(static_cast<int>(type))));
1111 __ push(a1);
1112 __ CallRuntime(Runtime::kNotifyDeoptimized);
1113
1114 __ pop(kInterpreterAccumulatorRegister); // Restore accumulator register.
1115 // Tear down internal frame.
1116 }
1117
1118 // Drop state (we don't use this for interpreter deopts).
1119 __ Drop(1);
1120
1121 // Enter the bytecode dispatch.
1122 Generate_EnterBytecodeDispatch(masm);
1123 }
1124
1125
1120 void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) { 1126 void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) {
1121 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); 1127 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
1122 } 1128 }
1123 1129
1124 1130
1125 void Builtins::Generate_InterpreterNotifySoftDeoptimized(MacroAssembler* masm) { 1131 void Builtins::Generate_InterpreterNotifySoftDeoptimized(MacroAssembler* masm) {
1126 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::SOFT); 1132 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::SOFT);
1127 } 1133 }
1128 1134
1129 1135
1130 void Builtins::Generate_InterpreterNotifyLazyDeoptimized(MacroAssembler* masm) { 1136 void Builtins::Generate_InterpreterNotifyLazyDeoptimized(MacroAssembler* masm) {
1131 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); 1137 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::LAZY);
1132 } 1138 }
1133 1139
1134 1140
1141 void Builtins::Generate_InterpreterEnterExceptionHandler(MacroAssembler* masm) {
1142 Generate_EnterBytecodeDispatch(masm);
1143 }
1144
1145
1135 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { 1146 void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
1136 CallRuntimePassFunction(masm, Runtime::kCompileLazy); 1147 CallRuntimePassFunction(masm, Runtime::kCompileLazy);
1137 GenerateTailCallToReturnedCode(masm); 1148 GenerateTailCallToReturnedCode(masm);
1138 } 1149 }
1139 1150
1140 1151
1141 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) { 1152 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) {
1142 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_NotConcurrent); 1153 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_NotConcurrent);
1143 GenerateTailCallToReturnedCode(masm); 1154 GenerateTailCallToReturnedCode(masm);
1144 } 1155 }
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
2548 } 2559 }
2549 } 2560 }
2550 2561
2551 2562
2552 #undef __ 2563 #undef __
2553 2564
2554 } // namespace internal 2565 } // namespace internal
2555 } // namespace v8 2566 } // namespace v8
2556 2567
2557 #endif // V8_TARGET_ARCH_MIPS64 2568 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698