Skip to content

Commit

Permalink
lj_trace.c: Allow reuse of trace numbers after jit.flush()
Browse files Browse the repository at this point in the history
RaptorJIT had earlier adopted the behavior of keeping trace numbers
unique between JIT flushes (up to the limit of 4096 beyond which
numbers would be reused.) This was intended to prevent two different
traces from sharing a profiler bucket.

However, this is a primitive solution, and we now intend to extend the
profiler to explicitly track multiple generations of traces.
  • Loading branch information
lukego committed Mar 1, 2018
1 parent 9be90a3 commit 7b57a23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lj_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static TraceNo trace_findfree(jit_State *J)
lj_mem_growvec(J->L, J->trace, J->sizetrace, lim, GCRef);
for (; osz < J->sizetrace; osz++)
setgcrefnull(J->trace[osz]);
return J->freetrace++;
return J->freetrace;
}

#define TRACE_APPENDVEC(field, szfield, tp) \
Expand Down Expand Up @@ -252,6 +252,7 @@ int lj_trace_flushall(lua_State *L)
}
}
J->cur.traceno = 0;
J->freetrace = 0;
/* Unpatch blacklisted byte codes. */
GCRef *p = &(G(L)->gc.root);
GCobj *o;
Expand Down

0 comments on commit 7b57a23

Please sign in to comment.