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

Unified Diff: runtime/vm/simulator_arm64.cc

Issue 817593002: Improve generated MIPS code for conditional expressions and branches by delaying (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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_arm64.h ('k') | runtime/vm/simulator_mips.h » ('j') | 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 42554)
+++ runtime/vm/simulator_arm64.cc (working copy)
@@ -23,8 +23,9 @@
namespace dart {
-DEFINE_FLAG(bool, trace_sim, false, "Trace simulator execution.");
-DEFINE_FLAG(int, stop_sim_at, 0,
+DEFINE_FLAG(int, trace_sim_after, -1,
+ "Trace simulator execution after instruction count reached.");
+DEFINE_FLAG(int, stop_sim_at, -1,
"Instruction address or instruction count to stop simulator at.");
@@ -639,8 +640,13 @@
OS::Print("Not at debugger stop.\n");
}
} else if (strcmp(cmd, "trace") == 0) {
- FLAG_trace_sim = !FLAG_trace_sim;
- OS::Print("execution tracing %s\n", FLAG_trace_sim ? "on" : "off");
+ if (FLAG_trace_sim_after == -1) {
+ FLAG_trace_sim_after = sim_->get_icount();
+ OS::Print("execution tracing on\n");
+ } else {
+ FLAG_trace_sim_after = -1;
+ OS::Print("execution tracing off\n");
+ }
} else if (strcmp(cmd, "bt") == 0) {
PrintBacktrace();
} else {
@@ -1046,6 +1052,14 @@
}
+bool Simulator::IsTracingExecution() const {
+ // Integer flag values are signed, so we must cast to unsigned.
+ // The default of -1 hence becomes the maximum unsigned value.
+ return (static_cast<uintptr_t>(icount_) >
+ static_cast<uintptr_t>(FLAG_trace_sim_after));
+}
+
+
intptr_t Simulator::ReadX(uword addr, Instr* instr) {
if ((addr & 7) == 0) {
intptr_t* ptr = reinterpret_cast<intptr_t*>(addr);
@@ -1557,7 +1571,7 @@
int64_t saved_lr = get_register(LR);
Redirection* redirection = Redirection::FromHltInstruction(instr);
uword external = redirection->external_function();
- if (FLAG_trace_sim) {
+ if (IsTracingExecution()) {
OS::Print("Call to host function at 0x%" Pd "\n", external);
}
@@ -3272,7 +3286,8 @@
// Executes the current instruction.
void Simulator::InstructionDecode(Instr* instr) {
pc_modified_ = false;
- if (FLAG_trace_sim) {
+ if (IsTracingExecution()) {
+ OS::Print("%"Pu64" ", icount_);
const uword start = reinterpret_cast<uword>(instr);
const uword end = start + Instr::kInstrSize;
Disassembler::Disassemble(start, end);
« no previous file with comments | « runtime/vm/simulator_arm64.h ('k') | runtime/vm/simulator_mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698