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
+19 -12
View File
@@ -2,7 +2,7 @@
** FOLD: Constant Folding, Algebraic Simplifications and Reassociation.
** ABCelim: Array Bounds Check Elimination.
** CSE: Common-Subexpression Elimination.
** 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_opt_fold_c
@@ -505,13 +505,14 @@ LJFOLDF(kfold_strref_snew)
} else {
/* Reassociate: strref(snew(strref(str, a), len), b) ==> strref(str, a+b) */
IRIns *ir = IR(fleft->op1);
IRRef1 str = ir->op1; /* IRIns * is not valid across emitir. */
lua_assert(ir->o == IR_STRREF);
PHIBARRIER(ir);
fins->op2 = emitir(IRTI(IR_ADD), ir->op2, fins->op2); /* Clobbers fins! */
fins->op1 = str;
fins->ot = IRT(IR_STRREF, IRT_P32);
return RETRYFOLD;
if (ir->o == IR_STRREF) {
IRRef1 str = ir->op1; /* IRIns * is not valid across emitir. */
PHIBARRIER(ir);
fins->op2 = emitir(IRTI(IR_ADD), ir->op2, fins->op2); /* Clobbers fins! */
fins->op1 = str;
fins->ot = IRT(IR_STRREF, IRT_P32);
return RETRYFOLD;
}
}
return NEXTFOLD;
}
@@ -1005,11 +1006,16 @@ LJFOLDF(simplify_conv_flt_num)
LJFOLD(TOBIT CONV KNUM)
LJFOLDF(simplify_tobit_conv)
{
if ((fleft->op2 & IRCONV_SRCMASK) == IRT_INT ||
(fleft->op2 & IRCONV_SRCMASK) == IRT_U32) {
/* Fold even across PHI to avoid expensive num->int conversions in loop. */
/* Fold even across PHI to avoid expensive num->int conversions in loop. */
if ((fleft->op2 & IRCONV_SRCMASK) == IRT_INT) {
lua_assert(irt_isnum(fleft->t));
return fleft->op1;
} else if ((fleft->op2 & IRCONV_SRCMASK) == IRT_U32) {
lua_assert(irt_isnum(fleft->t));
fins->o = IR_CONV;
fins->op1 = fleft->op1;
fins->op2 = (IRT_INT<<5)|IRT_U32;
return RETRYFOLD;
}
return NEXTFOLD;
}
@@ -1825,7 +1831,8 @@ LJFOLDF(merge_eqne_snew_kgc)
if (len <= FOLD_SNEW_MAX_LEN) {
IROp op = (IROp)fins->o;
IRRef strref = fleft->op1;
lua_assert(IR(strref)->o == IR_STRREF);
if (IR(strref)->o != IR_STRREF)
return NEXTFOLD;
if (op == IR_EQ) {
emitir(IRTGI(IR_EQ), fleft->op2, lj_ir_kint(J, len));
/* Caveat: fins/fleft/fright is no longer valid after emitir. */