Merge branch 'master' into v2.1
This commit is contained in:
commit
4401af88dc
@ -278,6 +278,7 @@ typedef struct BPropEntry {
|
||||
|
||||
/* Scalar evolution analysis cache. */
|
||||
typedef struct ScEvEntry {
|
||||
MRef pc; /* Bytecode PC of FORI. */
|
||||
IRRef1 idx; /* Index reference. */
|
||||
IRRef1 start; /* Constant start reference. */
|
||||
IRRef1 stop; /* Constant stop reference. */
|
||||
|
@ -424,6 +424,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;
|
||||
}
|
||||
|
||||
@ -439,7 +440,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) {
|
||||
t = J->scev.t.irt;
|
||||
stop = J->scev.stop;
|
||||
idx = emitir(IRT(IR_ADD, t), idx, J->scev.step);
|
||||
@ -2336,6 +2337,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;
|
||||
|
Loading…
Reference in New Issue
Block a user