Merge branch 'master' into v2.1

This commit is contained in:
Mike Pall 2014-02-20 15:09:02 +01:00
commit 2863b10956
7 changed files with 18 additions and 12 deletions

View File

@ -484,6 +484,7 @@ static void asm_retf(ASMState *as, IRIns *ir)
int32_t delta = 1+bc_a(*((const BCIns *)pc - 1));
as->topslot -= (BCReg)delta;
if ((int32_t)as->topslot < 0) as->topslot = 0;
irt_setmark(IR(REF_BASE)->t); /* Children must not coalesce with BASE reg. */
/* Need to force a spill on REF_BASE now to update the stack slot. */
emit_lso(as, ARMI_STR, base, RID_SP, ra_spill(as, IR(REF_BASE)));
emit_setgl(as, base, jit_base);
@ -2088,7 +2089,8 @@ static void asm_head_root_base(ASMState *as)
IRIns *ir;
asm_head_lreg(as);
ir = IR(REF_BASE);
if (ra_hasreg(ir->r) && rset_test(as->modset, ir->r)) ra_spill(as, ir);
if (ra_hasreg(ir->r) && (rset_test(as->modset, ir->r) || irt_ismarked(ir->t)))
ra_spill(as, ir);
ra_destreg(as, ir, RID_BASE);
}
@ -2098,7 +2100,8 @@ static RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow)
IRIns *ir;
asm_head_lreg(as);
ir = IR(REF_BASE);
if (ra_hasreg(ir->r) && rset_test(as->modset, ir->r)) ra_spill(as, ir);
if (ra_hasreg(ir->r) && (rset_test(as->modset, ir->r) || irt_ismarked(ir->t)))
ra_spill(as, ir);
if (ra_hasspill(irp->s)) {
rset_clear(allow, ra_dest(as, ir, allow));
} else {

View File

@ -375,6 +375,7 @@ static void asm_retf(ASMState *as, IRIns *ir)
int32_t delta = 1+bc_a(*((const BCIns *)pc - 1));
as->topslot -= (BCReg)delta;
if ((int32_t)as->topslot < 0) as->topslot = 0;
irt_setmark(IR(REF_BASE)->t); /* Children must not coalesce with BASE reg. */
emit_setgl(as, base, jit_base);
emit_addptr(as, base, -8*delta);
asm_guard(as, MIPSI_BNE, RID_TMP,
@ -1697,7 +1698,7 @@ static void asm_head_root_base(ASMState *as)
if (as->loopinv) as->mctop--;
if (ra_hasreg(r)) {
ra_free(as, r);
if (rset_test(as->modset, r))
if (rset_test(as->modset, r) || irt_ismarked(ir->t))
ir->r = RID_INIT; /* No inheritance for modified BASE register. */
if (r != RID_BASE)
emit_move(as, r, RID_BASE);
@ -1712,7 +1713,7 @@ static RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow)
if (as->loopinv) as->mctop--;
if (ra_hasreg(r)) {
ra_free(as, r);
if (rset_test(as->modset, r))
if (rset_test(as->modset, r) || irt_ismarked(ir->t))
ir->r = RID_INIT; /* No inheritance for modified BASE register. */
if (irp->r == r) {
rset_clear(allow, r); /* Mark same BASE register as coalesced. */

View File

@ -362,6 +362,7 @@ static void asm_retf(ASMState *as, IRIns *ir)
int32_t delta = 1+bc_a(*((const BCIns *)pc - 1));
as->topslot -= (BCReg)delta;
if ((int32_t)as->topslot < 0) as->topslot = 0;
irt_setmark(IR(REF_BASE)->t); /* Children must not coalesce with BASE reg. */
emit_setgl(as, base, jit_base);
emit_addptr(as, base, -8*delta);
asm_guardcc(as, CC_NE);
@ -1868,7 +1869,7 @@ static void asm_head_root_base(ASMState *as)
Reg r = ir->r;
if (ra_hasreg(r)) {
ra_free(as, r);
if (rset_test(as->modset, r))
if (rset_test(as->modset, r) || irt_ismarked(ir->t))
ir->r = RID_INIT; /* No inheritance for modified BASE register. */
if (r != RID_BASE)
emit_mr(as, r, RID_BASE);
@ -1882,7 +1883,7 @@ static RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow)
Reg r = ir->r;
if (ra_hasreg(r)) {
ra_free(as, r);
if (rset_test(as->modset, r))
if (rset_test(as->modset, r) || irt_ismarked(ir->t))
ir->r = RID_INIT; /* No inheritance for modified BASE register. */
if (irp->r == r) {
rset_clear(allow, r); /* Mark same BASE register as coalesced. */

View File

@ -638,6 +638,7 @@ static void asm_retf(ASMState *as, IRIns *ir)
int32_t delta = 1+bc_a(*((const BCIns *)pc - 1));
as->topslot -= (BCReg)delta;
if ((int32_t)as->topslot < 0) as->topslot = 0;
irt_setmark(IR(REF_BASE)->t); /* Children must not coalesce with BASE reg. */
emit_setgl(as, base, jit_base);
emit_addptr(as, base, -8*delta);
asm_guardcc(as, CC_NE);
@ -2508,7 +2509,7 @@ static void asm_head_root_base(ASMState *as)
Reg r = ir->r;
if (ra_hasreg(r)) {
ra_free(as, r);
if (rset_test(as->modset, r))
if (rset_test(as->modset, r) || irt_ismarked(ir->t))
ir->r = RID_INIT; /* No inheritance for modified BASE register. */
if (r != RID_BASE)
emit_rr(as, XO_MOV, r, RID_BASE);
@ -2522,7 +2523,7 @@ static RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow)
Reg r = ir->r;
if (ra_hasreg(r)) {
ra_free(as, r);
if (rset_test(as->modset, r))
if (rset_test(as->modset, r) || irt_ismarked(ir->t))
ir->r = RID_INIT; /* No inheritance for modified BASE register. */
if (irp->r == r) {
rset_clear(allow, r); /* Mark same BASE register as coalesced. */

View File

@ -1244,7 +1244,7 @@ static void cp_struct_layout(CPState *cp, CTypeID sid, CTInfo sattr)
sinfo |= (info & (CTF_QUAL|CTF_VLA)); /* Merge pseudo-qualifiers. */
/* Check for size overflow and determine alignment. */
if (sz >= 0x20000000u || bofs + csz < bofs) {
if (sz >= 0x20000000u || bofs + csz < bofs || (info & CTF_VLA)) {
if (!(sz == CTSIZE_INVALID && ctype_isarray(info) &&
!(sinfo & CTF_UNION)))
cp_err(cp, LJ_ERR_FFI_INVSIZE);

View File

@ -764,7 +764,7 @@ void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults)
(J->parent == 0 && J->exitno == 0 &&
!bc_isret(bc_op(J->cur.startins))))) {
/* NYI: specialize to frame type and return directly, not via RET*. */
for (i = -1; i < (ptrdiff_t)rbase; i++)
for (i = 0; i < (ptrdiff_t)rbase; i++)
J->base[i] = 0; /* Purge dead slots. */
J->maxslot = rbase + (BCReg)gotresults;
lj_record_stop(J, LJ_TRLINK_RETURN, 0); /* Return to interpreter. */

View File

@ -54,8 +54,8 @@ buildvm -m folddef -o lj_folddef.h lj_opt_fold.c
@if errorlevel 1 goto :BAD
@rem ---- Cross compiler ----
@set "LJCOMPILE=%XEDK%\bin\win32\cl /nologo /c /MT /O2 /W3 /GF /Gm- /GR- /GS- /Gy /openmp- /D_CRT_SECURE_NO_DEPRECATE /DNDEBUG /D_XBOX /D_LIB /DLUAJIT_USE_SYSMALLOC"
@set "LJLIB=%XEDK%\bin\win32\lib /nologo"
@set LJCOMPILE="%XEDK%\bin\win32\cl" /nologo /c /MT /O2 /W3 /GF /Gm- /GR- /GS- /Gy /openmp- /D_CRT_SECURE_NO_DEPRECATE /DNDEBUG /D_XBOX /D_LIB /DLUAJIT_USE_SYSMALLOC
@set LJLIB="%XEDK%\bin\win32\lib" /nologo
@set "INCLUDE=%XEDK%\include\xbox"
@if "%1" neq "debug" goto :NODEBUG