aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2011-05-04 23:21:46 +0200
committerMike Pall <mike>2011-05-04 23:21:46 +0200
commitfb8b87e818480c3a16dba9b542d1f1e29d3d24c6 (patch)
treebef9ccb3c7ca1c8d154a85bbd01a5f33670bf216 /src
parentb4006ba9a8bf506c98d12f32c182219bb8d9cd4f (diff)
downloadluajit-fb8b87e818480c3a16dba9b542d1f1e29d3d24c6.tar.gz
luajit-fb8b87e818480c3a16dba9b542d1f1e29d3d24c6.tar.bz2
luajit-fb8b87e818480c3a16dba9b542d1f1e29d3d24c6.zip
More tuning of loop unrolling heuristics.
Diffstat (limited to 'src')
-rw-r--r--src/lj_record.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lj_record.c b/src/lj_record.c
index 472597b6..246545dc 100644
--- a/src/lj_record.c
+++ b/src/lj_record.c
@@ -422,7 +422,8 @@ static LoopEvent rec_for(jit_State *J, const BCIns *fori, int isforl)
422 } else { /* Handle FORI/JFORI opcodes. */ 422 } else { /* Handle FORI/JFORI opcodes. */
423 BCReg i; 423 BCReg i;
424 lj_meta_for(J->L, tv); 424 lj_meta_for(J->L, tv);
425 t = lj_opt_narrow_forl(J, tv); 425 t = (LJ_DUALNUM || tref_isint(tr[FORL_IDX])) ? lj_opt_narrow_forl(J, tv) :
426 IRT_NUM;
426 for (i = FORL_IDX; i <= FORL_STEP; i++) { 427 for (i = FORL_IDX; i <= FORL_STEP; i++) {
427 lua_assert(tref_isnumber_str(tr[i])); 428 lua_assert(tref_isnumber_str(tr[i]));
428 if (tref_isstr(tr[i])) 429 if (tref_isstr(tr[i]))
@@ -521,9 +522,7 @@ static void rec_loop_interp(jit_State *J, const BCIns *pc, LoopEvent ev)
521 */ 522 */
522 if (!innerloopleft(J, pc)) 523 if (!innerloopleft(J, pc))
523 lj_trace_err(J, LJ_TRERR_LINNER); /* Root trace hit an inner loop. */ 524 lj_trace_err(J, LJ_TRERR_LINNER); /* Root trace hit an inner loop. */
524 if ((J->loopref && J->cur.nins - J->loopref > 525 if ((J->loopref && J->cur.nins - J->loopref > 24) || --J->loopunroll < 0)
525 ((IRRef)J->param[JIT_P_maxrecord] >> 5)) ||
526 --J->loopunroll < 0)
527 lj_trace_err(J, LJ_TRERR_LUNROLL); /* Limit loop unrolling. */ 526 lj_trace_err(J, LJ_TRERR_LUNROLL); /* Limit loop unrolling. */
528 J->loopref = J->cur.nins; 527 J->loopref = J->cur.nins;
529 } 528 }