Update LuaJIT to 2.0.4.

This commit is contained in:
Alex Szpakowski
2015-12-01 14:19:13 -04:00
parent e9d77ef766
commit c952bbcab7
182 changed files with 724 additions and 401 deletions
+7 -3
View File
@@ -1,6 +1,6 @@
/*
** Trace recorder (bytecode -> SSA IR).
** Copyright (C) 2005-2014 Mike Pall. See Copyright Notice in luajit.h
** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
*/
#define lj_record_c
@@ -421,6 +421,7 @@ static void rec_for_loop(jit_State *J, const BCIns *fori, ScEvEntry *scev,
J->base[ra+FORL_IDX] = idx = emitir(IRT(IR_ADD, t), idx, step);
J->base[ra+FORL_EXT] = idx;
scev->idx = tref_ref(idx);
setmref(scev->pc, fori);
J->maxslot = ra+FORL_EXT+1;
}
@@ -436,7 +437,7 @@ static LoopEvent rec_for(jit_State *J, const BCIns *fori, int isforl)
IRType t;
if (isforl) { /* Handle FORL/JFORL opcodes. */
TRef idx = tr[FORL_IDX];
if (tref_ref(idx) == J->scev.idx) {
if (mref(J->scev.pc, const BCIns) == fori && tref_ref(idx) == J->scev.idx) {
t = J->scev.t.irt;
stop = J->scev.stop;
idx = emitir(IRT(IR_ADD, t), idx, J->scev.step);
@@ -744,6 +745,8 @@ void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults)
} else if (J->parent == 0 && !bc_isret(bc_op(J->cur.startins))) {
/* Return to lower frame would leave the loop in a root trace. */
lj_trace_err(J, LJ_TRERR_LLEAVE);
} else if (J->needsnap) { /* Tailcalled to ff with side-effects. */
lj_trace_err(J, LJ_TRERR_NYIRETL); /* No way to insert snapshot here. */
} else { /* Return to lower frame. Guard for the target we return to. */
TRef trpt = lj_ir_kgc(J, obj2gco(pt), IRT_PROTO);
TRef trpc = lj_ir_kptr(J, (void *)frame_pc(frame));
@@ -1059,7 +1062,7 @@ static void rec_idx_abc(jit_State *J, TRef asizeref, TRef ikey, uint32_t asize)
lua_assert(irt_isint(J->scev.t) && ir->o == IR_SLOAD);
stop = numberVint(&(J->L->base - J->baseslot)[ir->op1 + FORL_STOP]);
/* Runtime value for stop of loop is within bounds? */
if ((int64_t)stop + ofs < (int64_t)asize) {
if ((uint64_t)stop + ofs < (uint64_t)asize) {
/* Emit invariant bounds check for stop. */
emitir(IRTG(IR_ABC, IRT_P32), asizeref, ofs == 0 ? J->scev.stop :
emitir(IRTI(IR_ADD), J->scev.stop, ofsref));
@@ -2153,6 +2156,7 @@ void lj_record_setup(jit_State *J)
memset(J->chain, 0, sizeof(J->chain));
memset(J->bpropcache, 0, sizeof(J->bpropcache));
J->scev.idx = REF_NIL;
setmref(J->scev.pc, NULL);
J->baseslot = 1; /* Invoking function is at base[-1]. */
J->base = J->slot + J->baseslot;