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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 __ push(ip); | 1052 __ push(ip); |
1053 | 1053 |
1054 // Push the arguments. | 1054 // Push the arguments. |
1055 Generate_InterpreterPushArgs(masm, r2, r4, r5); | 1055 Generate_InterpreterPushArgs(masm, r2, r4, r5); |
1056 | 1056 |
1057 // Call the constructor with r0, r1, and r3 unmodified. | 1057 // Call the constructor with r0, r1, and r3 unmodified. |
1058 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | 1058 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
1059 } | 1059 } |
1060 | 1060 |
1061 | 1061 |
1062 static void Generate_InterpreterNotifyDeoptimizedHelper( | 1062 static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) { |
1063 MacroAssembler* masm, Deoptimizer::BailoutType type) { | |
1064 // Enter an internal frame. | |
1065 { | |
1066 FrameScope scope(masm, StackFrame::INTERNAL); | |
1067 __ push(kInterpreterAccumulatorRegister); // Save accumulator register. | |
1068 | |
1069 // Pass the deoptimization type to the runtime system. | |
1070 __ mov(r1, Operand(Smi::FromInt(static_cast<int>(type)))); | |
1071 __ push(r1); | |
1072 __ CallRuntime(Runtime::kNotifyDeoptimized); | |
1073 | |
1074 __ pop(kInterpreterAccumulatorRegister); // Restore accumulator register. | |
1075 // Tear down internal frame. | |
1076 } | |
1077 | |
1078 // Drop state (we don't use this for interpreter deopts). | |
1079 __ Drop(1); | |
1080 | |
1081 // Initialize register file register and dispatch table register. | 1063 // Initialize register file register and dispatch table register. |
1082 __ add(kInterpreterRegisterFileRegister, fp, | 1064 __ add(kInterpreterRegisterFileRegister, fp, |
1083 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); | 1065 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
1084 __ LoadRoot(kInterpreterDispatchTableRegister, | 1066 __ LoadRoot(kInterpreterDispatchTableRegister, |
1085 Heap::kInterpreterTableRootIndex); | 1067 Heap::kInterpreterTableRootIndex); |
1086 __ add(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, | 1068 __ add(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, |
1087 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 1069 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
1088 | 1070 |
1089 // Get the context from the frame. | 1071 // Get the context from the frame. |
1090 // TODO(rmcilroy): Update interpreter frame to expect current context at the | 1072 // TODO(rmcilroy): Update interpreter frame to expect current context at the |
(...skipping 29 matching lines...) Expand all Loading... |
1120 // Dispatch to the target bytecode. | 1102 // Dispatch to the target bytecode. |
1121 __ ldrb(r1, MemOperand(kInterpreterBytecodeArrayRegister, | 1103 __ ldrb(r1, MemOperand(kInterpreterBytecodeArrayRegister, |
1122 kInterpreterBytecodeOffsetRegister)); | 1104 kInterpreterBytecodeOffsetRegister)); |
1123 __ ldr(ip, MemOperand(kInterpreterDispatchTableRegister, r1, LSL, | 1105 __ ldr(ip, MemOperand(kInterpreterDispatchTableRegister, r1, LSL, |
1124 kPointerSizeLog2)); | 1106 kPointerSizeLog2)); |
1125 __ add(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1107 __ add(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); |
1126 __ mov(pc, ip); | 1108 __ mov(pc, ip); |
1127 } | 1109 } |
1128 | 1110 |
1129 | 1111 |
| 1112 static void Generate_InterpreterNotifyDeoptimizedHelper( |
| 1113 MacroAssembler* masm, Deoptimizer::BailoutType type) { |
| 1114 // Enter an internal frame. |
| 1115 { |
| 1116 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1117 __ push(kInterpreterAccumulatorRegister); // Save accumulator register. |
| 1118 |
| 1119 // Pass the deoptimization type to the runtime system. |
| 1120 __ mov(r1, Operand(Smi::FromInt(static_cast<int>(type)))); |
| 1121 __ push(r1); |
| 1122 __ CallRuntime(Runtime::kNotifyDeoptimized); |
| 1123 |
| 1124 __ pop(kInterpreterAccumulatorRegister); // Restore accumulator register. |
| 1125 // Tear down internal frame. |
| 1126 } |
| 1127 |
| 1128 // Drop state (we don't use this for interpreter deopts). |
| 1129 __ Drop(1); |
| 1130 |
| 1131 // Enter the bytecode dispatch. |
| 1132 Generate_EnterBytecodeDispatch(masm); |
| 1133 } |
| 1134 |
| 1135 |
1130 void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) { | 1136 void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) { |
1131 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); | 1137 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); |
1132 } | 1138 } |
1133 | 1139 |
1134 | 1140 |
1135 void Builtins::Generate_InterpreterNotifySoftDeoptimized(MacroAssembler* masm) { | 1141 void Builtins::Generate_InterpreterNotifySoftDeoptimized(MacroAssembler* masm) { |
1136 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::SOFT); | 1142 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::SOFT); |
1137 } | 1143 } |
1138 | 1144 |
1139 | 1145 |
1140 void Builtins::Generate_InterpreterNotifyLazyDeoptimized(MacroAssembler* masm) { | 1146 void Builtins::Generate_InterpreterNotifyLazyDeoptimized(MacroAssembler* masm) { |
1141 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); | 1147 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); |
1142 } | 1148 } |
1143 | 1149 |
1144 | 1150 |
| 1151 void Builtins::Generate_InterpreterEnterExceptionHandler(MacroAssembler* masm) { |
| 1152 Generate_EnterBytecodeDispatch(masm); |
| 1153 } |
| 1154 |
| 1155 |
1145 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 1156 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
1146 CallRuntimePassFunction(masm, Runtime::kCompileLazy); | 1157 CallRuntimePassFunction(masm, Runtime::kCompileLazy); |
1147 GenerateTailCallToReturnedCode(masm); | 1158 GenerateTailCallToReturnedCode(masm); |
1148 } | 1159 } |
1149 | 1160 |
1150 | 1161 |
1151 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) { | 1162 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) { |
1152 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_NotConcurrent); | 1163 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_NotConcurrent); |
1153 GenerateTailCallToReturnedCode(masm); | 1164 GenerateTailCallToReturnedCode(masm); |
1154 } | 1165 } |
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2452 } | 2463 } |
2453 } | 2464 } |
2454 | 2465 |
2455 | 2466 |
2456 #undef __ | 2467 #undef __ |
2457 | 2468 |
2458 } // namespace internal | 2469 } // namespace internal |
2459 } // namespace v8 | 2470 } // namespace v8 |
2460 | 2471 |
2461 #endif // V8_TARGET_ARCH_ARM | 2472 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |