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

Unified Diff: runtime/vm/simulator_arm64.cc

Issue 1097413004: Use a breakpoint instruction for a stop message on arm instead of (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/simulator_arm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/simulator_arm64.cc
===================================================================
--- runtime/vm/simulator_arm64.cc (revision 45360)
+++ runtime/vm/simulator_arm64.cc (working copy)
@@ -837,7 +837,6 @@
}
private:
- static const int32_t kRedirectInstruction = Instr::kRedirectInstruction;
Redirection(uword external_function,
Simulator::CallKind call_kind,
int argument_count)
@@ -844,7 +843,7 @@
: external_function_(external_function),
call_kind_(call_kind),
argument_count_(argument_count),
- hlt_instruction_(kRedirectInstruction),
+ hlt_instruction_(Instr::kSimulatorRedirectInstruction),
next_(list_) {
// Atomically prepend this element to the front of the global list.
// Note: Since elements are never removed, there is no ABA issue.
@@ -1689,22 +1688,23 @@
(instr->Bits(21, 3) == 1)) {
// Format(instr, "brk 'imm16");
SimulatorDebugger dbg(this);
- uint16_t imm = static_cast<uint16_t>(instr->Imm16Field());
- char buffer[32];
- snprintf(buffer, sizeof(buffer), "brk #0x%x", imm);
- set_pc(get_pc() + Instr::kInstrSize);
- dbg.Stop(instr, buffer);
- } else if ((instr->Bits(0, 2) == 0) && (instr->Bits(2, 3) == 0) &&
- (instr->Bits(21, 3) == 2)) {
- // Format(instr, "hlt 'imm16");
- uint16_t imm = static_cast<uint16_t>(instr->Imm16Field());
+ int32_t imm = instr->Imm16Field();
if (imm == Instr::kStopMessageCode) {
- SimulatorDebugger dbg(this);
const char* message = *reinterpret_cast<const char**>(
reinterpret_cast<intptr_t>(instr) - 2 * Instr::kInstrSize);
set_pc(get_pc() + Instr::kInstrSize);
dbg.Stop(instr, message);
- } else if (imm == Instr::kSimulatorBreakCode) {
+ } else {
+ char buffer[32];
+ snprintf(buffer, sizeof(buffer), "brk #0x%x", imm);
+ set_pc(get_pc() + Instr::kInstrSize);
+ dbg.Stop(instr, buffer);
+ }
+ } else if ((instr->Bits(0, 2) == 0) && (instr->Bits(2, 3) == 0) &&
+ (instr->Bits(21, 3) == 2)) {
+ // Format(instr, "hlt 'imm16");
+ uint16_t imm = static_cast<uint16_t>(instr->Imm16Field());
+ if (imm == Instr::kSimulatorBreakCode) {
SimulatorDebugger dbg(this);
dbg.Stop(instr, "breakpoint");
} else if (imm == Instr::kSimulatorRedirectCode) {
« no previous file with comments | « runtime/vm/simulator_arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698