| 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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 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 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 __ Addu(a2, a2, Operand(-kPointerSize)); | 1041 __ Addu(a2, a2, Operand(-kPointerSize)); |
| 1042 __ push(t1); | 1042 __ push(t1); |
| 1043 __ bind(&loop_check); | 1043 __ bind(&loop_check); |
| 1044 __ Branch(&loop_header, gt, a2, Operand(t0)); | 1044 __ Branch(&loop_header, gt, a2, Operand(t0)); |
| 1045 | 1045 |
| 1046 // Call the constructor with a0, a1, and a3 unmodified. | 1046 // Call the constructor with a0, a1, and a3 unmodified. |
| 1047 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | 1047 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
| 1048 } | 1048 } |
| 1049 | 1049 |
| 1050 | 1050 |
| 1051 static void Generate_InterpreterNotifyDeoptimizedHelper( | 1051 static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) { |
| 1052 MacroAssembler* masm, Deoptimizer::BailoutType type) { | |
| 1053 // Enter an internal frame. | |
| 1054 { | |
| 1055 FrameScope scope(masm, StackFrame::INTERNAL); | |
| 1056 __ push(kInterpreterAccumulatorRegister); // Save accumulator register. | |
| 1057 | |
| 1058 // Pass the deoptimization type to the runtime system. | |
| 1059 __ li(a1, Operand(Smi::FromInt(static_cast<int>(type)))); | |
| 1060 __ push(a1); | |
| 1061 __ CallRuntime(Runtime::kNotifyDeoptimized); | |
| 1062 | |
| 1063 __ pop(kInterpreterAccumulatorRegister); // Restore accumulator register. | |
| 1064 // Tear down internal frame. | |
| 1065 } | |
| 1066 | |
| 1067 // Drop state (we don't use this for interpreter deopts). | |
| 1068 __ Drop(1); | |
| 1069 | |
| 1070 // Initialize register file register and dispatch table register. | 1052 // Initialize register file register and dispatch table register. |
| 1071 __ Addu(kInterpreterRegisterFileRegister, fp, | 1053 __ Addu(kInterpreterRegisterFileRegister, fp, |
| 1072 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); | 1054 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
| 1073 __ LoadRoot(kInterpreterDispatchTableRegister, | 1055 __ LoadRoot(kInterpreterDispatchTableRegister, |
| 1074 Heap::kInterpreterTableRootIndex); | 1056 Heap::kInterpreterTableRootIndex); |
| 1075 __ Addu(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, | 1057 __ Addu(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, |
| 1076 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 1058 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
| 1077 | 1059 |
| 1078 // Get the context from the frame. | 1060 // Get the context from the frame. |
| 1079 // TODO(rmcilroy): Update interpreter frame to expect current context at the | 1061 // TODO(rmcilroy): Update interpreter frame to expect current context at the |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 __ Addu(a1, kInterpreterBytecodeArrayRegister, | 1093 __ Addu(a1, kInterpreterBytecodeArrayRegister, |
| 1112 kInterpreterBytecodeOffsetRegister); | 1094 kInterpreterBytecodeOffsetRegister); |
| 1113 __ lbu(a1, MemOperand(a1)); | 1095 __ lbu(a1, MemOperand(a1)); |
| 1114 __ Lsa(a1, kInterpreterDispatchTableRegister, a1, kPointerSizeLog2); | 1096 __ Lsa(a1, kInterpreterDispatchTableRegister, a1, kPointerSizeLog2); |
| 1115 __ lw(a1, MemOperand(a1)); | 1097 __ lw(a1, MemOperand(a1)); |
| 1116 __ Addu(a1, a1, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1098 __ Addu(a1, a1, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 1117 __ Jump(a1); | 1099 __ Jump(a1); |
| 1118 } | 1100 } |
| 1119 | 1101 |
| 1120 | 1102 |
| 1103 static void Generate_InterpreterNotifyDeoptimizedHelper( |
| 1104 MacroAssembler* masm, Deoptimizer::BailoutType type) { |
| 1105 // Enter an internal frame. |
| 1106 { |
| 1107 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1108 __ push(kInterpreterAccumulatorRegister); // Save accumulator register. |
| 1109 |
| 1110 // Pass the deoptimization type to the runtime system. |
| 1111 __ li(a1, Operand(Smi::FromInt(static_cast<int>(type)))); |
| 1112 __ push(a1); |
| 1113 __ CallRuntime(Runtime::kNotifyDeoptimized); |
| 1114 |
| 1115 __ pop(kInterpreterAccumulatorRegister); // Restore accumulator register. |
| 1116 // Tear down internal frame. |
| 1117 } |
| 1118 |
| 1119 // Drop state (we don't use this for interpreter deopts). |
| 1120 __ Drop(1); |
| 1121 |
| 1122 // Enter the bytecode dispatch. |
| 1123 Generate_EnterBytecodeDispatch(masm); |
| 1124 } |
| 1125 |
| 1126 |
| 1121 void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) { | 1127 void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) { |
| 1122 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); | 1128 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); |
| 1123 } | 1129 } |
| 1124 | 1130 |
| 1125 | 1131 |
| 1126 void Builtins::Generate_InterpreterNotifySoftDeoptimized(MacroAssembler* masm) { | 1132 void Builtins::Generate_InterpreterNotifySoftDeoptimized(MacroAssembler* masm) { |
| 1127 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::SOFT); | 1133 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::SOFT); |
| 1128 } | 1134 } |
| 1129 | 1135 |
| 1130 | 1136 |
| 1131 void Builtins::Generate_InterpreterNotifyLazyDeoptimized(MacroAssembler* masm) { | 1137 void Builtins::Generate_InterpreterNotifyLazyDeoptimized(MacroAssembler* masm) { |
| 1132 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); | 1138 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); |
| 1133 } | 1139 } |
| 1134 | 1140 |
| 1135 | 1141 |
| 1142 void Builtins::Generate_InterpreterEnterExceptionHandler(MacroAssembler* masm) { |
| 1143 Generate_EnterBytecodeDispatch(masm); |
| 1144 } |
| 1145 |
| 1146 |
| 1136 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 1147 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
| 1137 CallRuntimePassFunction(masm, Runtime::kCompileLazy); | 1148 CallRuntimePassFunction(masm, Runtime::kCompileLazy); |
| 1138 GenerateTailCallToReturnedCode(masm); | 1149 GenerateTailCallToReturnedCode(masm); |
| 1139 } | 1150 } |
| 1140 | 1151 |
| 1141 | 1152 |
| 1142 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) { | 1153 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) { |
| 1143 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_NotConcurrent); | 1154 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_NotConcurrent); |
| 1144 GenerateTailCallToReturnedCode(masm); | 1155 GenerateTailCallToReturnedCode(masm); |
| 1145 } | 1156 } |
| (...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2532 } | 2543 } |
| 2533 } | 2544 } |
| 2534 | 2545 |
| 2535 | 2546 |
| 2536 #undef __ | 2547 #undef __ |
| 2537 | 2548 |
| 2538 } // namespace internal | 2549 } // namespace internal |
| 2539 } // namespace v8 | 2550 } // namespace v8 |
| 2540 | 2551 |
| 2541 #endif // V8_TARGET_ARCH_MIPS | 2552 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |