mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Merge branch 'master' into v2.1
This commit is contained in:
commit
2863b10956
@ -484,6 +484,7 @@ static void asm_retf(ASMState *as, IRIns *ir)
|
|||||||
int32_t delta = 1+bc_a(*((const BCIns *)pc - 1));
|
int32_t delta = 1+bc_a(*((const BCIns *)pc - 1));
|
||||||
as->topslot -= (BCReg)delta;
|
as->topslot -= (BCReg)delta;
|
||||||
if ((int32_t)as->topslot < 0) as->topslot = 0;
|
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. */
|
/* 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_lso(as, ARMI_STR, base, RID_SP, ra_spill(as, IR(REF_BASE)));
|
||||||
emit_setgl(as, base, jit_base);
|
emit_setgl(as, base, jit_base);
|
||||||
@ -2088,7 +2089,8 @@ static void asm_head_root_base(ASMState *as)
|
|||||||
IRIns *ir;
|
IRIns *ir;
|
||||||
asm_head_lreg(as);
|
asm_head_lreg(as);
|
||||||
ir = IR(REF_BASE);
|
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);
|
ra_destreg(as, ir, RID_BASE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2098,7 +2100,8 @@ static RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow)
|
|||||||
IRIns *ir;
|
IRIns *ir;
|
||||||
asm_head_lreg(as);
|
asm_head_lreg(as);
|
||||||
ir = IR(REF_BASE);
|
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)) {
|
if (ra_hasspill(irp->s)) {
|
||||||
rset_clear(allow, ra_dest(as, ir, allow));
|
rset_clear(allow, ra_dest(as, ir, allow));
|
||||||
} else {
|
} else {
|
||||||
|
@ -375,6 +375,7 @@ static void asm_retf(ASMState *as, IRIns *ir)
|
|||||||
int32_t delta = 1+bc_a(*((const BCIns *)pc - 1));
|
int32_t delta = 1+bc_a(*((const BCIns *)pc - 1));
|
||||||
as->topslot -= (BCReg)delta;
|
as->topslot -= (BCReg)delta;
|
||||||
if ((int32_t)as->topslot < 0) as->topslot = 0;
|
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_setgl(as, base, jit_base);
|
||||||
emit_addptr(as, base, -8*delta);
|
emit_addptr(as, base, -8*delta);
|
||||||
asm_guard(as, MIPSI_BNE, RID_TMP,
|
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 (as->loopinv) as->mctop--;
|
||||||
if (ra_hasreg(r)) {
|
if (ra_hasreg(r)) {
|
||||||
ra_free(as, 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. */
|
ir->r = RID_INIT; /* No inheritance for modified BASE register. */
|
||||||
if (r != RID_BASE)
|
if (r != RID_BASE)
|
||||||
emit_move(as, 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 (as->loopinv) as->mctop--;
|
||||||
if (ra_hasreg(r)) {
|
if (ra_hasreg(r)) {
|
||||||
ra_free(as, 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. */
|
ir->r = RID_INIT; /* No inheritance for modified BASE register. */
|
||||||
if (irp->r == r) {
|
if (irp->r == r) {
|
||||||
rset_clear(allow, r); /* Mark same BASE register as coalesced. */
|
rset_clear(allow, r); /* Mark same BASE register as coalesced. */
|
||||||
|
@ -362,6 +362,7 @@ static void asm_retf(ASMState *as, IRIns *ir)
|
|||||||
int32_t delta = 1+bc_a(*((const BCIns *)pc - 1));
|
int32_t delta = 1+bc_a(*((const BCIns *)pc - 1));
|
||||||
as->topslot -= (BCReg)delta;
|
as->topslot -= (BCReg)delta;
|
||||||
if ((int32_t)as->topslot < 0) as->topslot = 0;
|
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_setgl(as, base, jit_base);
|
||||||
emit_addptr(as, base, -8*delta);
|
emit_addptr(as, base, -8*delta);
|
||||||
asm_guardcc(as, CC_NE);
|
asm_guardcc(as, CC_NE);
|
||||||
@ -1868,7 +1869,7 @@ static void asm_head_root_base(ASMState *as)
|
|||||||
Reg r = ir->r;
|
Reg r = ir->r;
|
||||||
if (ra_hasreg(r)) {
|
if (ra_hasreg(r)) {
|
||||||
ra_free(as, 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. */
|
ir->r = RID_INIT; /* No inheritance for modified BASE register. */
|
||||||
if (r != RID_BASE)
|
if (r != RID_BASE)
|
||||||
emit_mr(as, 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;
|
Reg r = ir->r;
|
||||||
if (ra_hasreg(r)) {
|
if (ra_hasreg(r)) {
|
||||||
ra_free(as, 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. */
|
ir->r = RID_INIT; /* No inheritance for modified BASE register. */
|
||||||
if (irp->r == r) {
|
if (irp->r == r) {
|
||||||
rset_clear(allow, r); /* Mark same BASE register as coalesced. */
|
rset_clear(allow, r); /* Mark same BASE register as coalesced. */
|
||||||
|
@ -638,6 +638,7 @@ static void asm_retf(ASMState *as, IRIns *ir)
|
|||||||
int32_t delta = 1+bc_a(*((const BCIns *)pc - 1));
|
int32_t delta = 1+bc_a(*((const BCIns *)pc - 1));
|
||||||
as->topslot -= (BCReg)delta;
|
as->topslot -= (BCReg)delta;
|
||||||
if ((int32_t)as->topslot < 0) as->topslot = 0;
|
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_setgl(as, base, jit_base);
|
||||||
emit_addptr(as, base, -8*delta);
|
emit_addptr(as, base, -8*delta);
|
||||||
asm_guardcc(as, CC_NE);
|
asm_guardcc(as, CC_NE);
|
||||||
@ -2508,7 +2509,7 @@ static void asm_head_root_base(ASMState *as)
|
|||||||
Reg r = ir->r;
|
Reg r = ir->r;
|
||||||
if (ra_hasreg(r)) {
|
if (ra_hasreg(r)) {
|
||||||
ra_free(as, 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. */
|
ir->r = RID_INIT; /* No inheritance for modified BASE register. */
|
||||||
if (r != RID_BASE)
|
if (r != RID_BASE)
|
||||||
emit_rr(as, XO_MOV, 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;
|
Reg r = ir->r;
|
||||||
if (ra_hasreg(r)) {
|
if (ra_hasreg(r)) {
|
||||||
ra_free(as, 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. */
|
ir->r = RID_INIT; /* No inheritance for modified BASE register. */
|
||||||
if (irp->r == r) {
|
if (irp->r == r) {
|
||||||
rset_clear(allow, r); /* Mark same BASE register as coalesced. */
|
rset_clear(allow, r); /* Mark same BASE register as coalesced. */
|
||||||
|
@ -1244,7 +1244,7 @@ static void cp_struct_layout(CPState *cp, CTypeID sid, CTInfo sattr)
|
|||||||
sinfo |= (info & (CTF_QUAL|CTF_VLA)); /* Merge pseudo-qualifiers. */
|
sinfo |= (info & (CTF_QUAL|CTF_VLA)); /* Merge pseudo-qualifiers. */
|
||||||
|
|
||||||
/* Check for size overflow and determine alignment. */
|
/* 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) &&
|
if (!(sz == CTSIZE_INVALID && ctype_isarray(info) &&
|
||||||
!(sinfo & CTF_UNION)))
|
!(sinfo & CTF_UNION)))
|
||||||
cp_err(cp, LJ_ERR_FFI_INVSIZE);
|
cp_err(cp, LJ_ERR_FFI_INVSIZE);
|
||||||
|
@ -764,7 +764,7 @@ void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults)
|
|||||||
(J->parent == 0 && J->exitno == 0 &&
|
(J->parent == 0 && J->exitno == 0 &&
|
||||||
!bc_isret(bc_op(J->cur.startins))))) {
|
!bc_isret(bc_op(J->cur.startins))))) {
|
||||||
/* NYI: specialize to frame type and return directly, not via RET*. */
|
/* 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->base[i] = 0; /* Purge dead slots. */
|
||||||
J->maxslot = rbase + (BCReg)gotresults;
|
J->maxslot = rbase + (BCReg)gotresults;
|
||||||
lj_record_stop(J, LJ_TRLINK_RETURN, 0); /* Return to interpreter. */
|
lj_record_stop(J, LJ_TRLINK_RETURN, 0); /* Return to interpreter. */
|
||||||
|
@ -54,8 +54,8 @@ buildvm -m folddef -o lj_folddef.h lj_opt_fold.c
|
|||||||
@if errorlevel 1 goto :BAD
|
@if errorlevel 1 goto :BAD
|
||||||
|
|
||||||
@rem ---- Cross compiler ----
|
@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 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 LJLIB="%XEDK%\bin\win32\lib" /nologo
|
||||||
@set "INCLUDE=%XEDK%\include\xbox"
|
@set "INCLUDE=%XEDK%\include\xbox"
|
||||||
|
|
||||||
@if "%1" neq "debug" goto :NODEBUG
|
@if "%1" neq "debug" goto :NODEBUG
|
||||||
|
Loading…
Reference in New Issue
Block a user