| 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 <setjmp.h> // NOLINT | 5 #include <setjmp.h> // NOLINT |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 | 7 |
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
| 9 #if defined(TARGET_ARCH_MIPS) | 9 #if defined(TARGET_ARCH_MIPS) |
| 10 | 10 |
| (...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 ASSERT(instr->OpcodeField() == SPECIAL); | 1210 ASSERT(instr->OpcodeField() == SPECIAL); |
| 1211 ASSERT(instr->FunctionField() == BREAK); | 1211 ASSERT(instr->FunctionField() == BREAK); |
| 1212 if (instr->BreakCodeField() == Instr::kStopMessageCode) { | 1212 if (instr->BreakCodeField() == Instr::kStopMessageCode) { |
| 1213 SimulatorDebugger dbg(this); | 1213 SimulatorDebugger dbg(this); |
| 1214 const char* message = *reinterpret_cast<const char**>( | 1214 const char* message = *reinterpret_cast<const char**>( |
| 1215 reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize); | 1215 reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize); |
| 1216 set_pc(get_pc() + Instr::kInstrSize); | 1216 set_pc(get_pc() + Instr::kInstrSize); |
| 1217 dbg.Stop(instr, message); | 1217 dbg.Stop(instr, message); |
| 1218 // Adjust for extra pc increment. | 1218 // Adjust for extra pc increment. |
| 1219 set_pc(get_pc() - Instr::kInstrSize); | 1219 set_pc(get_pc() - Instr::kInstrSize); |
| 1220 } else if (instr->BreakCodeField() == Instr::kSimulatorMessageCode) { | |
| 1221 const char* message = *reinterpret_cast<const char**>( | |
| 1222 reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize); | |
| 1223 if (IsTracingExecution()) { | |
| 1224 OS::Print("Message: %s\n", message); | |
| 1225 } | |
| 1226 } else if (instr->BreakCodeField() == Instr::kSimulatorRedirectCode) { | 1220 } else if (instr->BreakCodeField() == Instr::kSimulatorRedirectCode) { |
| 1227 SimulatorSetjmpBuffer buffer(this); | 1221 SimulatorSetjmpBuffer buffer(this); |
| 1228 | 1222 |
| 1229 if (!setjmp(buffer.buffer_)) { | 1223 if (!setjmp(buffer.buffer_)) { |
| 1230 int32_t saved_ra = get_register(RA); | 1224 int32_t saved_ra = get_register(RA); |
| 1231 Redirection* redirection = Redirection::FromBreakInstruction(instr); | 1225 Redirection* redirection = Redirection::FromBreakInstruction(instr); |
| 1232 uword external = redirection->external_function(); | 1226 uword external = redirection->external_function(); |
| 1233 if (IsTracingExecution()) { | 1227 if (IsTracingExecution()) { |
| 1234 OS::Print("Call to host function at 0x%" Pd "\n", external); | 1228 OS::Print("Call to host function at 0x%" Pd "\n", external); |
| 1235 } | 1229 } |
| (...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2487 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); | 2481 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); |
| 2488 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 2482 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
| 2489 buf->Longjmp(); | 2483 buf->Longjmp(); |
| 2490 } | 2484 } |
| 2491 | 2485 |
| 2492 } // namespace dart | 2486 } // namespace dart |
| 2493 | 2487 |
| 2494 #endif // !defined(HOST_ARCH_MIPS) | 2488 #endif // !defined(HOST_ARCH_MIPS) |
| 2495 | 2489 |
| 2496 #endif // defined TARGET_ARCH_MIPS | 2490 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |