Skip to content

Commit

Permalink
lj_record.c: Relax heuristic for root trace meeting JIT loop
Browse files Browse the repository at this point in the history
If a trace is persistently reaching a compiler inner loop, then stop
and accept. This is better than aborting repeatedly and causing a
blacklisting.
  • Loading branch information
lukego committed Sep 8, 2017
1 parent a720595 commit ce6fbb4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lj_record.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,8 @@ static void rec_loop_interp(jit_State *J, const BCIns *pc, LoopEvent ev)
/* Handle the case when an already compiled loop op is hit. */
static void rec_loop_jit(jit_State *J, TraceNo lnk, LoopEvent ev)
{
if (J->parent == 0 && J->exitno == 0) { /* Root trace hit an inner loop. */
/* Root trace hit an inner loop. */
if (J->parent == 0 && J->exitno == 0 && !innerloopleft(J, J->startpc)) {
/* Better let the inner loop spawn a side trace back here. */
lj_trace_err(J, LJ_TRERR_LINNER);
} else if (ev != LOOPEV_LEAVE) { /* Side trace enters a compiled loop. */
Expand Down

0 comments on commit ce6fbb4

Please sign in to comment.