OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" // NOLINT | 5 #include "vm/globals.h" // NOLINT |
6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/longjump.h" | 9 #include "vm/longjump.h" |
10 #include "vm/runtime_entry.h" | 10 #include "vm/runtime_entry.h" |
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 | 1060 |
1061 void Assembler::EnterCallRuntimeFrame(intptr_t frame_space) { | 1061 void Assembler::EnterCallRuntimeFrame(intptr_t frame_space) { |
1062 ASSERT(!in_delay_slot_); | 1062 ASSERT(!in_delay_slot_); |
1063 const intptr_t kPushedRegistersSize = | 1063 const intptr_t kPushedRegistersSize = |
1064 kDartVolatileCpuRegCount * kWordSize + | 1064 kDartVolatileCpuRegCount * kWordSize + |
1065 2 * kWordSize + // FP and RA. | 1065 2 * kWordSize + // FP and RA. |
1066 kDartVolatileFpuRegCount * kWordSize; | 1066 kDartVolatileFpuRegCount * kWordSize; |
1067 | 1067 |
1068 SetPrologueOffset(); | 1068 SetPrologueOffset(); |
1069 | 1069 |
1070 TraceSimMsg("EnterCallRuntimeFrame"); | 1070 Comment("EnterCallRuntimeFrame"); |
1071 | 1071 |
1072 // Save volatile CPU and FPU registers on the stack: | 1072 // Save volatile CPU and FPU registers on the stack: |
1073 // ------------- | 1073 // ------------- |
1074 // FPU Registers | 1074 // FPU Registers |
1075 // CPU Registers | 1075 // CPU Registers |
1076 // RA | 1076 // RA |
1077 // FP | 1077 // FP |
1078 // ------------- | 1078 // ------------- |
1079 // TODO(zra): It may be a problem for walking the stack that FP is below | 1079 // TODO(zra): It may be a problem for walking the stack that FP is below |
1080 // the saved registers. If it turns out to be a problem in the | 1080 // the saved registers. If it turns out to be a problem in the |
(...skipping 20 matching lines...) Expand all Loading... |
1101 } | 1101 } |
1102 | 1102 |
1103 | 1103 |
1104 void Assembler::LeaveCallRuntimeFrame() { | 1104 void Assembler::LeaveCallRuntimeFrame() { |
1105 ASSERT(!in_delay_slot_); | 1105 ASSERT(!in_delay_slot_); |
1106 const intptr_t kPushedRegistersSize = | 1106 const intptr_t kPushedRegistersSize = |
1107 kDartVolatileCpuRegCount * kWordSize + | 1107 kDartVolatileCpuRegCount * kWordSize + |
1108 2 * kWordSize + // FP and RA. | 1108 2 * kWordSize + // FP and RA. |
1109 kDartVolatileFpuRegCount * kWordSize; | 1109 kDartVolatileFpuRegCount * kWordSize; |
1110 | 1110 |
1111 TraceSimMsg("LeaveCallRuntimeFrame"); | 1111 Comment("LeaveCallRuntimeFrame"); |
1112 | 1112 |
1113 // SP might have been modified to reserve space for arguments | 1113 // SP might have been modified to reserve space for arguments |
1114 // and ensure proper alignment of the stack frame. | 1114 // and ensure proper alignment of the stack frame. |
1115 // We need to restore it before restoring registers. | 1115 // We need to restore it before restoring registers. |
1116 mov(SP, FP); | 1116 mov(SP, FP); |
1117 | 1117 |
1118 // Restore volatile CPU and FPU registers from the stack. | 1118 // Restore volatile CPU and FPU registers from the stack. |
1119 lw(FP, Address(SP, 0 * kWordSize)); | 1119 lw(FP, Address(SP, 0 * kWordSize)); |
1120 lw(RA, Address(SP, 1 * kWordSize)); | 1120 lw(RA, Address(SP, 1 * kWordSize)); |
1121 for (int i = kDartFirstVolatileCpuReg; i <= kDartLastVolatileCpuReg; i++) { | 1121 for (int i = kDartFirstVolatileCpuReg; i <= kDartLastVolatileCpuReg; i++) { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 if (FLAG_print_stop_message) { | 1206 if (FLAG_print_stop_message) { |
1207 UNIMPLEMENTED(); | 1207 UNIMPLEMENTED(); |
1208 } | 1208 } |
1209 Label stop; | 1209 Label stop; |
1210 b(&stop); | 1210 b(&stop); |
1211 Emit(reinterpret_cast<int32_t>(message)); | 1211 Emit(reinterpret_cast<int32_t>(message)); |
1212 Bind(&stop); | 1212 Bind(&stop); |
1213 break_(Instr::kStopMessageCode); | 1213 break_(Instr::kStopMessageCode); |
1214 } | 1214 } |
1215 | 1215 |
1216 | |
1217 void Assembler::TraceSimMsg(const char* message) { | |
1218 // Don't bother adding in the messages unless tracing is enabled, and we are | |
1219 // running in the simulator. | |
1220 #if defined(USING_SIMULATOR) | |
1221 if (FLAG_trace_sim_after != -1) { | |
1222 Label msg; | |
1223 b(&msg); | |
1224 Emit(reinterpret_cast<int32_t>(message)); | |
1225 Bind(&msg); | |
1226 break_(Instr::kSimulatorMessageCode); | |
1227 } | |
1228 #endif | |
1229 } | |
1230 | |
1231 } // namespace dart | 1216 } // namespace dart |
1232 | 1217 |
1233 #endif // defined TARGET_ARCH_MIPS | 1218 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |