Suppress recording of retried fast functions.

This commit is contained in:
Mike Pall 2011-03-07 20:03:38 +01:00
parent f29a9d4341
commit 8eb09fe820
3 changed files with 9 additions and 2 deletions

View File

@ -799,8 +799,10 @@ void lj_ffrecord_func(jit_State *J)
rd.argv = J->L->base; rd.argv = J->L->base;
J->base[J->maxslot] = 0; /* Mark end of arguments. */ J->base[J->maxslot] = 0; /* Mark end of arguments. */
(recff_func[m >> 8])(J, &rd); /* Call recff_* handler. */ (recff_func[m >> 8])(J, &rd); /* Call recff_* handler. */
if (rd.nres >= 0) if (rd.nres >= 0) {
if (J->postproc == LJ_POST_NONE) J->postproc = LJ_POST_FFRETRY;
lj_record_ret(J, 0, rd.nres); lj_record_ret(J, 0, rd.nres);
}
} }
#undef IR #undef IR

View File

@ -113,7 +113,8 @@ typedef enum {
LJ_POST_NONE, /* No action. */ LJ_POST_NONE, /* No action. */
LJ_POST_FIXCOMP, /* Fixup comparison and emit pending guard. */ LJ_POST_FIXCOMP, /* Fixup comparison and emit pending guard. */
LJ_POST_FIXGUARD, /* Fixup and emit pending guard. */ LJ_POST_FIXGUARD, /* Fixup and emit pending guard. */
LJ_POST_FIXBOOL /* Fixup boolean result. */ LJ_POST_FIXBOOL, /* Fixup boolean result. */
LJ_POST_FFRETRY /* Suppress recording of retried fast functions. */
} PostProc; } PostProc;
/* Machine code type. */ /* Machine code type. */

View File

@ -1400,6 +1400,10 @@ void lj_record_ins(jit_State *J)
} }
} }
break; break;
case LJ_POST_FFRETRY: /* Suppress recording of retried fast function. */
if (bc_op(*J->pc) >= BC__MAX)
return;
break;
default: lua_assert(0); break; default: lua_assert(0); break;
} }
J->postproc = LJ_POST_NONE; J->postproc = LJ_POST_NONE;