Skip to content

Commit

Permalink
lj_trace.c: Clear profiler lasttrace state on flushall()
Browse files Browse the repository at this point in the history
This is to prevent a trace in the previous JIT code generation from
being "blamed" for time spent interpreting and compiling during the
warmup of the next generation.
  • Loading branch information
lukego committed Mar 1, 2018
1 parent 7b57a23 commit c6347dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lj_trace.c
Expand Up @@ -238,6 +238,7 @@ void lj_trace_flushproto(global_State *g, GCproto *pt)
int lj_trace_flushall(lua_State *L)
{
jit_State *J = L2J(L);
global_State *g = G(L);
ptrdiff_t i;
if ((J2G(J)->hookmask & HOOK_GC))
return 1;
Expand All @@ -253,6 +254,7 @@ int lj_trace_flushall(lua_State *L)
}
J->cur.traceno = 0;
J->freetrace = 0;
g->lasttrace = 0;
/* Unpatch blacklisted byte codes. */
GCRef *p = &(G(L)->gc.root);
GCobj *o;
Expand Down

0 comments on commit c6347dc

Please sign in to comment.