break;
case BC_JITERL:
case BC_JLOOP:
- lua_assert(op == BC_ITERL || op == BC_LOOP || bc_isret(op));
+ lj_assertJ(op == BC_ITERL || op == BC_ITERN || op == BC_LOOP ||
+ bc_isret(op), "bad original bytecode %d", op);
*pc = T->startins;
break;
- case BC_JMP:
- lj_assertJ(op == BC_ITERL, "bad original bytecode %d", op);
- pc += bc_j(*pc)+2;
- if (bc_op(*pc) == BC_JITERL) {
- lj_assertJ(traceref(J, bc_d(*pc)) == T, "JITERL references other trace");
- *pc = T->startins;
- }
- break;
case BC_JFUNCF:
- lua_assert(op == BC_FUNCF);
+ lj_assertJ(op == BC_FUNCF, "bad original bytecode %d", op);
*pc = T->startins;
break;
default: /* Already unpatched. */
static void trace_flushroot(jit_State *J, GCtrace *T)
{
GCproto *pt = &gcref(T->startpt)->pt;
- lua_assert(T->root == 0 && pt != NULL);
+ lj_assertJ(T->root == 0, "not a root trace");
+ lj_assertJ(pt != NULL, "trace has no prototype");
- /* First unpatch any modified bytecode. */
- trace_unpatch(J, T);
/* Unlink root trace from chain anchored in prototype. */
if (pt->trace == T->traceno) { /* Trace is first in chain. Easy. */
pt->trace = T->nextroot;