Skip to content

Instantly share code, notes, and snippets.

@MasterDuke17
Created February 22, 2021 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MasterDuke17/1e160b6d169a1a0fc9b20fc3c8703932 to your computer and use it in GitHub Desktop.
Save MasterDuke17/1e160b6d169a1a0fc9b20fc3c8703932 to your computer and use it in GitHub Desktop.
diff --git src/6model/reprs/MVMSpeshCandidate.c src/6model/reprs/MVMSpeshCandidate.c
index 096f45c72..4604308f7 100644
--- src/6model/reprs/MVMSpeshCandidate.c
+++ src/6model/reprs/MVMSpeshCandidate.c
@@ -228,10 +228,10 @@ void MVM_spesh_candidate_add(MVMThreadContext *tc, MVMSpeshPlanned *p) {
MVM_spesh_debug_printf(tc,
"Specialization of '%s' (cuid: %s)\n\n", c_name, c_cuid);
MVM_spesh_debug_printf(tc, "Before:\n%s", before);
+ MVM_spesh_debug_flush(tc);
MVM_free(c_name);
MVM_free(c_cuid);
MVM_free(before);
- fflush(tc->instance->spesh_log_fh);
start_time = uv_hrtime();
}
@@ -324,8 +324,8 @@ void MVM_spesh_candidate_add(MVMThreadContext *tc, MVMSpeshPlanned *p) {
}
}
MVM_spesh_debug_printf(tc, "\n========\n\n");
+ MVM_spesh_debug_flush(tc);
MVM_free(after);
- fflush(tc->instance->spesh_log_fh);
}
/* Calculate work environment taking JIT spill area into account. */
@@ -372,7 +372,7 @@ void MVM_spesh_candidate_add(MVMThreadContext *tc, MVMSpeshPlanned *p) {
char *guard_dump = MVM_spesh_dump_arg_guard(tc, p->sf,
p->sf->body.spesh->body.spesh_arg_guard);
MVM_spesh_debug_printf(tc, "%s========\n\n", guard_dump);
- fflush(tc->instance->spesh_log_fh);
+ MVM_spesh_debug_flush(tc);
MVM_free(guard_dump);
}
diff --git src/jit/compile.c src/jit/compile.c
index 17914d3e4..888a61f55 100644
--- src/jit/compile.c
+++ src/jit/compile.c
@@ -41,6 +41,7 @@ static void debug_spill_map(MVMThreadContext *tc, MVMJitCompiler *cl) {
MVM_spesh_debug_printf(tc, " r%d [%x] = %s\n", i, cl->spills_base + i * sizeof(MVMRegister),
MVM_register_type(cl->spills[i].reg_type));
}
+ MVM_spesh_debug_flush(tc);
}
void MVM_jit_compiler_init(MVMThreadContext *tc, MVMJitCompiler *cl, MVMJitGraph *jg) {
diff --git src/spesh/optimize.c src/spesh/optimize.c
index bef3b6344..f320b0b63 100644
--- src/spesh/optimize.c
+++ src/spesh/optimize.c
@@ -38,6 +38,7 @@ static void log_inline(MVMThreadContext *tc, MVMSpeshGraph *g, MVMStaticFrame *t
if (inline_graph && MVM_spesh_debug_enabled(tc)) {
char *dump = MVM_spesh_dump(tc, inline_graph);
MVM_spesh_debug_printf(tc, "Inlining graph\n%s\n", dump);
+ MVM_spesh_debug_flush(tc);
MVM_free(dump);
}
}
diff --git src/spesh/worker.c src/spesh/worker.c
index 1808b3d77..26fcd3035 100644
--- src/spesh/worker.c
+++ src/spesh/worker.c
@@ -105,6 +105,7 @@ static void worker(MVMThreadContext *tc, MVMCallsite *callsite, MVMRegister *arg
char *dump = MVM_spesh_dump_stats(tc, (MVMStaticFrame* )
MVM_repr_at_pos_o(tc, updated_static_frames, i));
MVM_spesh_debug_printf(tc, "%s==========\n\n", dump);
+ MVM_spesh_debug_flush(tc);
MVM_free(dump);
}
}
@@ -130,6 +131,7 @@ static void worker(MVMThreadContext *tc, MVMCallsite *callsite, MVMRegister *arg
char *dump = MVM_spesh_dump_planned(tc,
&(tc->instance->spesh_plan->planned[i]));
MVM_spesh_debug_printf(tc, "%s==========\n\n", dump);
+ MVM_spesh_debug_flush(tc);
MVM_free(dump);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment