From ce6fbb4240fa3d626b6a1eb8ddafd3d36b335751 Mon Sep 17 00:00:00 2001 From: Luke Gorrie Date: Mon, 4 Sep 2017 12:07:11 +0000 Subject: [PATCH] lj_record.c: Relax heuristic for root trace meeting JIT loop If a trace is persistently reaching a compiler inner loop, then stop and accept. This is better than aborting repeatedly and causing a blacklisting. --- src/lj_record.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lj_record.c b/src/lj_record.c index cce8cf34e0..6b076e2402 100644 --- a/src/lj_record.c +++ b/src/lj_record.c @@ -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. */