Rearrange OSX vs. iOS defines. Disable callbacks on iOS.

This commit is contained in:
Mike Pall 2012-06-08 11:57:44 +02:00
parent 1543b2a7ca
commit fad5382d21
7 changed files with 94 additions and 76 deletions

View File

@ -218,7 +218,7 @@
|.endmacro |.endmacro
| |
|.macro IOS, a, b |.macro IOS, a, b
||if (LJ_TARGET_OSX) { ||if (LJ_TARGET_IOS) {
| a, b | a, b
||} ||}
|.endmacro |.endmacro
@ -2892,7 +2892,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| sub CARG1, DISPATCH, #-GG_DISP2G | sub CARG1, DISPATCH, #-GG_DISP2G
| tst RC, #LJ_GC_WHITES | tst RC, #LJ_GC_WHITES
| // Crossed a write barrier. Move the barrier forward. | // Crossed a write barrier. Move the barrier forward.
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
| beq <1 | beq <1
| mov RC, BASE | mov RC, BASE
| bl extern lj_gc_barrieruv // (global_State *g, TValue *tv) | bl extern lj_gc_barrieruv // (global_State *g, TValue *tv)
@ -2926,7 +2926,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| cmpne RC, #0 | cmpne RC, #0
| sub CARG1, DISPATCH, #-GG_DISP2G | sub CARG1, DISPATCH, #-GG_DISP2G
| // Crossed a write barrier. Move the barrier forward. | // Crossed a write barrier. Move the barrier forward.
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
| beq <1 | beq <1
| mov RC, BASE | mov RC, BASE
| bl extern lj_gc_barrieruv // (global_State *g, TValue *tv) | bl extern lj_gc_barrieruv // (global_State *g, TValue *tv)

View File

@ -6205,15 +6205,15 @@ static void build_subroutines(BuildCtx *ctx)
dasm_put(Dst, 329); dasm_put(Dst, 329);
#endif #endif
dasm_put(Dst, 338, Dt1(->base), -DISPATCH_GL(tmptv), ~LJ_TTAB, ~LJ_TSTR, ~LJ_TISNUM, Dt1(->base)); dasm_put(Dst, 338, Dt1(->base), -DISPATCH_GL(tmptv), ~LJ_TTAB, ~LJ_TSTR, ~LJ_TISNUM, Dt1(->base));
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 395, Dt1(->base)); dasm_put(Dst, 395, Dt1(->base));
} }
dasm_put(Dst, 398, FRAME_CONT, Dt1(->top), -DISPATCH_GL(tmptv), ~LJ_TTAB, ~LJ_TSTR, ~LJ_TISNUM, Dt1(->base)); dasm_put(Dst, 398, FRAME_CONT, Dt1(->top), -DISPATCH_GL(tmptv), ~LJ_TTAB, ~LJ_TSTR, ~LJ_TISNUM, Dt1(->base));
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 460, Dt1(->base)); dasm_put(Dst, 460, Dt1(->base));
} }
dasm_put(Dst, 463, FRAME_CONT, Dt1(->top), Dt1(->base)); dasm_put(Dst, 463, FRAME_CONT, Dt1(->top), Dt1(->base));
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 499, Dt1(->base)); dasm_put(Dst, 499, Dt1(->base));
} }
dasm_put(Dst, 502, ~LJ_TTRUE, -LJ_TFALSE, Dt1(->base)); dasm_put(Dst, 502, ~LJ_TTRUE, -LJ_TFALSE, Dt1(->base));
@ -6221,11 +6221,11 @@ static void build_subroutines(BuildCtx *ctx)
dasm_put(Dst, 549, Dt1(->base)); dasm_put(Dst, 549, Dt1(->base));
#endif #endif
dasm_put(Dst, 560, Dt1(->base)); dasm_put(Dst, 560, Dt1(->base));
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 597, Dt1(->base)); dasm_put(Dst, 597, Dt1(->base));
} }
dasm_put(Dst, 600, FRAME_CONT, Dt1(->base)); dasm_put(Dst, 600, FRAME_CONT, Dt1(->base));
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 621, Dt1(->base)); dasm_put(Dst, 621, Dt1(->base));
} }
#ifdef LUAJIT_ENABLE_LUA52COMPAT #ifdef LUAJIT_ENABLE_LUA52COMPAT
@ -6234,19 +6234,19 @@ static void build_subroutines(BuildCtx *ctx)
dasm_put(Dst, 631); dasm_put(Dst, 631);
#endif #endif
dasm_put(Dst, 634, Dt1(->base)); dasm_put(Dst, 634, Dt1(->base));
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 642); dasm_put(Dst, 642);
} }
dasm_put(Dst, 644); dasm_put(Dst, 644);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 647); dasm_put(Dst, 647);
} }
dasm_put(Dst, 649, Dt7(->field_pc), Dt1(->base)); dasm_put(Dst, 649, Dt7(->field_pc), Dt1(->base));
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 670, Dt1(->base)); dasm_put(Dst, 670, Dt1(->base));
} }
dasm_put(Dst, 673, Dt1(->base)); dasm_put(Dst, 673, Dt1(->base));
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 687, Dt1(->base)); dasm_put(Dst, 687, Dt1(->base));
} }
#if LJ_HASJIT #if LJ_HASJIT
@ -6264,16 +6264,16 @@ static void build_subroutines(BuildCtx *ctx)
dasm_put(Dst, 760, ~LJ_TNIL, DISPATCH_GL(gcroot[GCROOT_MMNAME+MM_metatable]), Dt6(->hmask), Dt5(->hash), Dt6(->node), DtB(->key), DtB(->val), DtB(->next), -LJ_TSTR, ~LJ_TTAB, -LJ_TNIL, -LJ_TISNUM); dasm_put(Dst, 760, ~LJ_TNIL, DISPATCH_GL(gcroot[GCROOT_MMNAME+MM_metatable]), Dt6(->hmask), Dt5(->hash), Dt6(->node), DtB(->key), DtB(->val), DtB(->next), -LJ_TSTR, ~LJ_TTAB, -LJ_TNIL, -LJ_TISNUM);
dasm_put(Dst, 808, ~LJ_TISNUM, DISPATCH_GL(gcroot[GCROOT_BASEMT]), -LJ_TTAB, Dt6(->metatable), -LJ_TTAB, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), DISPATCH_GL(gc.grayagain), LJ_GC_BLACK, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist), -LJ_TTAB); dasm_put(Dst, 808, ~LJ_TISNUM, DISPATCH_GL(gcroot[GCROOT_BASEMT]), -LJ_TTAB, Dt6(->metatable), -LJ_TTAB, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), DISPATCH_GL(gc.grayagain), LJ_GC_BLACK, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist), -LJ_TTAB);
dasm_put(Dst, 860); dasm_put(Dst, 860);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 865); dasm_put(Dst, 865);
} }
dasm_put(Dst, 867); dasm_put(Dst, 867);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 870); dasm_put(Dst, 870);
} }
dasm_put(Dst, 872, -LJ_TISNUM, -LJ_TSTR, DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM]), Dt1(->base), -LJ_TISNUM, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), ~LJ_TSTR); dasm_put(Dst, 872, -LJ_TISNUM, -LJ_TSTR, DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM]), Dt1(->base), -LJ_TISNUM, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), ~LJ_TSTR);
dasm_put(Dst, 924, ~LJ_TNIL, -LJ_TTAB, Dt1(->base), Dt1(->top)); dasm_put(Dst, 924, ~LJ_TNIL, -LJ_TTAB, Dt1(->base), Dt1(->top));
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 947, Dt1(->base)); dasm_put(Dst, 947, Dt1(->base));
} }
dasm_put(Dst, 950, ~LJ_TNIL, (2+1)*8, -LJ_TTAB); dasm_put(Dst, 950, ~LJ_TNIL, (2+1)*8, -LJ_TTAB);
@ -6285,11 +6285,11 @@ static void build_subroutines(BuildCtx *ctx)
dasm_put(Dst, 980); dasm_put(Dst, 980);
#endif #endif
dasm_put(Dst, 984, ~LJ_TNIL, (3+1)*8, -LJ_TTAB, -LJ_TISNUM, Dt6(->asize), Dt6(->array), (0+1)*8, -LJ_TNIL, (2+1)*8, Dt6(->hmask)); dasm_put(Dst, 984, ~LJ_TNIL, (3+1)*8, -LJ_TTAB, -LJ_TISNUM, Dt6(->asize), Dt6(->array), (0+1)*8, -LJ_TNIL, (2+1)*8, Dt6(->hmask));
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1034); dasm_put(Dst, 1034);
} }
dasm_put(Dst, 1036); dasm_put(Dst, 1036);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1039); dasm_put(Dst, 1039);
} }
dasm_put(Dst, 1041, -LJ_TTAB); dasm_put(Dst, 1041, -LJ_TTAB);
@ -6309,155 +6309,155 @@ static void build_subroutines(BuildCtx *ctx)
dasm_put(Dst, 1429, -LJ_TISNUM, ~LJ_TISNUM, ~LJ_TISNUM); dasm_put(Dst, 1429, -LJ_TISNUM, ~LJ_TISNUM, ~LJ_TISNUM);
dasm_put(Dst, 1493, -LJ_TISNUM, (1+1)*8, FRAME_TYPE, ~LJ_TNIL); dasm_put(Dst, 1493, -LJ_TISNUM, (1+1)*8, FRAME_TYPE, ~LJ_TNIL);
dasm_put(Dst, 1555, -LJ_TISNUM); dasm_put(Dst, 1555, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1564); dasm_put(Dst, 1564);
} }
dasm_put(Dst, 1566); dasm_put(Dst, 1566);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1569); dasm_put(Dst, 1569);
} }
dasm_put(Dst, 1571, -LJ_TISNUM); dasm_put(Dst, 1571, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1583); dasm_put(Dst, 1583);
} }
dasm_put(Dst, 1585); dasm_put(Dst, 1585);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1588); dasm_put(Dst, 1588);
} }
dasm_put(Dst, 1590, -LJ_TISNUM); dasm_put(Dst, 1590, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1602); dasm_put(Dst, 1602);
} }
dasm_put(Dst, 1604); dasm_put(Dst, 1604);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1607); dasm_put(Dst, 1607);
} }
dasm_put(Dst, 1609, -LJ_TISNUM); dasm_put(Dst, 1609, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1621); dasm_put(Dst, 1621);
} }
dasm_put(Dst, 1623); dasm_put(Dst, 1623);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1626); dasm_put(Dst, 1626);
} }
dasm_put(Dst, 1628, -LJ_TISNUM); dasm_put(Dst, 1628, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1640); dasm_put(Dst, 1640);
} }
dasm_put(Dst, 1642); dasm_put(Dst, 1642);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1645); dasm_put(Dst, 1645);
} }
dasm_put(Dst, 1647, -LJ_TISNUM); dasm_put(Dst, 1647, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1659); dasm_put(Dst, 1659);
} }
dasm_put(Dst, 1661); dasm_put(Dst, 1661);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1664); dasm_put(Dst, 1664);
} }
dasm_put(Dst, 1666, -LJ_TISNUM); dasm_put(Dst, 1666, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1678); dasm_put(Dst, 1678);
} }
dasm_put(Dst, 1680); dasm_put(Dst, 1680);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1683); dasm_put(Dst, 1683);
} }
dasm_put(Dst, 1685, -LJ_TISNUM); dasm_put(Dst, 1685, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1697); dasm_put(Dst, 1697);
} }
dasm_put(Dst, 1699); dasm_put(Dst, 1699);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1702); dasm_put(Dst, 1702);
} }
dasm_put(Dst, 1704, -LJ_TISNUM); dasm_put(Dst, 1704, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1716); dasm_put(Dst, 1716);
} }
dasm_put(Dst, 1718); dasm_put(Dst, 1718);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1721); dasm_put(Dst, 1721);
} }
dasm_put(Dst, 1723, -LJ_TISNUM); dasm_put(Dst, 1723, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1735); dasm_put(Dst, 1735);
} }
dasm_put(Dst, 1737); dasm_put(Dst, 1737);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1740); dasm_put(Dst, 1740);
} }
dasm_put(Dst, 1742, -LJ_TISNUM); dasm_put(Dst, 1742, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1754); dasm_put(Dst, 1754);
} }
dasm_put(Dst, 1756); dasm_put(Dst, 1756);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1759); dasm_put(Dst, 1759);
} }
dasm_put(Dst, 1761, -LJ_TISNUM); dasm_put(Dst, 1761, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1773); dasm_put(Dst, 1773);
} }
dasm_put(Dst, 1775); dasm_put(Dst, 1775);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1778); dasm_put(Dst, 1778);
} }
dasm_put(Dst, 1780, -LJ_TISNUM); dasm_put(Dst, 1780, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1792); dasm_put(Dst, 1792);
} }
dasm_put(Dst, 1794); dasm_put(Dst, 1794);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1797); dasm_put(Dst, 1797);
} }
dasm_put(Dst, 1799, -LJ_TISNUM, -LJ_TISNUM); dasm_put(Dst, 1799, -LJ_TISNUM, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1814); dasm_put(Dst, 1814);
} }
dasm_put(Dst, 1816); dasm_put(Dst, 1816);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1819); dasm_put(Dst, 1819);
} }
dasm_put(Dst, 1821, -LJ_TISNUM, -LJ_TISNUM); dasm_put(Dst, 1821, -LJ_TISNUM, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1836); dasm_put(Dst, 1836);
} }
dasm_put(Dst, 1838); dasm_put(Dst, 1838);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1841); dasm_put(Dst, 1841);
} }
dasm_put(Dst, 1843, -LJ_TISNUM, -LJ_TISNUM); dasm_put(Dst, 1843, -LJ_TISNUM, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1858); dasm_put(Dst, 1858);
} }
dasm_put(Dst, 1860); dasm_put(Dst, 1860);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1863); dasm_put(Dst, 1863);
} }
dasm_put(Dst, 1865, -LJ_TISNUM, Dt8(->upvalue[0]), -LJ_TISNUM, -LJ_TISNUM); dasm_put(Dst, 1865, -LJ_TISNUM, Dt8(->upvalue[0]), -LJ_TISNUM, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1898); dasm_put(Dst, 1898);
} }
dasm_put(Dst, 1900); dasm_put(Dst, 1900);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1903); dasm_put(Dst, 1903);
} }
dasm_put(Dst, 1905, -LJ_TISNUM); dasm_put(Dst, 1905, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1918); dasm_put(Dst, 1918);
} }
dasm_put(Dst, 1920); dasm_put(Dst, 1920);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1923); dasm_put(Dst, 1923);
} }
dasm_put(Dst, 1925, ~LJ_TISNUM, (2+1)*8, -LJ_TISNUM); dasm_put(Dst, 1925, ~LJ_TISNUM, (2+1)*8, -LJ_TISNUM);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1947); dasm_put(Dst, 1947);
} }
dasm_put(Dst, 1949); dasm_put(Dst, 1949);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 1952); dasm_put(Dst, 1952);
} }
dasm_put(Dst, 1954, (2+1)*8, -LJ_TISNUM, -LJ_TISNUM, -LJ_TISNUM); dasm_put(Dst, 1954, (2+1)*8, -LJ_TISNUM, -LJ_TISNUM, -LJ_TISNUM);
@ -6468,11 +6468,11 @@ static void build_subroutines(BuildCtx *ctx)
dasm_put(Dst, 2234, DISPATCH_GL(tmpbuf.sz), DISPATCH_GL(tmpbuf.buf), Dt5([1]), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), -LJ_TSTR, Dt5(->len), DISPATCH_GL(tmpbuf.sz), DISPATCH_GL(tmpbuf.buf), sizeof(GCstr)); dasm_put(Dst, 2234, DISPATCH_GL(tmpbuf.sz), DISPATCH_GL(tmpbuf.buf), Dt5([1]), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), -LJ_TSTR, Dt5(->len), DISPATCH_GL(tmpbuf.sz), DISPATCH_GL(tmpbuf.buf), sizeof(GCstr));
dasm_put(Dst, 2287, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), -LJ_TSTR, Dt5(->len), DISPATCH_GL(tmpbuf.sz), DISPATCH_GL(tmpbuf.buf), sizeof(GCstr), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold)); dasm_put(Dst, 2287, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), -LJ_TSTR, Dt5(->len), DISPATCH_GL(tmpbuf.sz), DISPATCH_GL(tmpbuf.buf), sizeof(GCstr), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold));
dasm_put(Dst, 2347, -LJ_TSTR, Dt5(->len), DISPATCH_GL(tmpbuf.sz), DISPATCH_GL(tmpbuf.buf), sizeof(GCstr), -LJ_TTAB); dasm_put(Dst, 2347, -LJ_TSTR, Dt5(->len), DISPATCH_GL(tmpbuf.sz), DISPATCH_GL(tmpbuf.buf), sizeof(GCstr), -LJ_TTAB);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 2385); dasm_put(Dst, 2385);
} }
dasm_put(Dst, 2387); dasm_put(Dst, 2387);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 2390); dasm_put(Dst, 2390);
} }
dasm_put(Dst, 2392, ~LJ_TISNUM, -LJ_TISNUM, ~LJ_TISNUM, -LJ_TISNUM, -LJ_TISNUM); dasm_put(Dst, 2392, ~LJ_TISNUM, -LJ_TISNUM, ~LJ_TISNUM, -LJ_TISNUM, -LJ_TISNUM);
@ -6709,11 +6709,11 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
dasm_put(Dst, 3647, Dt6(->metatable)); dasm_put(Dst, 3647, Dt6(->metatable));
#endif #endif
dasm_put(Dst, 3654); dasm_put(Dst, 3654);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 3656); dasm_put(Dst, 3656);
} }
dasm_put(Dst, 3658); dasm_put(Dst, 3658);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 3661); dasm_put(Dst, 3661);
} }
dasm_put(Dst, 3663); dasm_put(Dst, 3663);
@ -7050,11 +7050,11 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
dasm_put(Dst, 4152); dasm_put(Dst, 4152);
break; break;
} }
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 4155); dasm_put(Dst, 4155);
} }
dasm_put(Dst, 4157); dasm_put(Dst, 4157);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 4160); dasm_put(Dst, 4160);
} }
dasm_put(Dst, 4162); dasm_put(Dst, 4162);
@ -7094,7 +7094,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
break; break;
case BC_USETV: case BC_USETV:
dasm_put(Dst, 4286, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->closed), DtA(->v), LJ_GC_BLACK, -LJ_TISGCV, -(LJ_TISNUM - LJ_TISGCV), Dt4(->gch.marked), -GG_DISP2G, LJ_GC_WHITES); dasm_put(Dst, 4286, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->closed), DtA(->v), LJ_GC_BLACK, -LJ_TISGCV, -(LJ_TISNUM - LJ_TISGCV), Dt4(->gch.marked), -GG_DISP2G, LJ_GC_WHITES);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 4326); dasm_put(Dst, 4326);
} else { } else {
dasm_put(Dst, 4333); dasm_put(Dst, 4333);
@ -7103,7 +7103,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
break; break;
case BC_USETS: case BC_USETS:
dasm_put(Dst, 4339, offsetof(GCfuncL, uvptr), ~LJ_TSTR, DtA(->marked), DtA(->v), DtA(->closed), LJ_GC_BLACK, Dt5(->marked), LJ_GC_WHITES, -GG_DISP2G); dasm_put(Dst, 4339, offsetof(GCfuncL, uvptr), ~LJ_TSTR, DtA(->marked), DtA(->v), DtA(->closed), LJ_GC_BLACK, Dt5(->marked), LJ_GC_WHITES, -GG_DISP2G);
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 4375); dasm_put(Dst, 4375);
} else { } else {
dasm_put(Dst, 4382); dasm_put(Dst, 4382);
@ -7178,7 +7178,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
case BC_TSETM: case BC_TSETM:
dasm_put(Dst, 4958, Dt6(->asize), Dt6(->array), Dt6(->marked), LJ_GC_BLACK, Dt1(->base)); dasm_put(Dst, 4958, Dt6(->asize), Dt6(->array), Dt6(->marked), LJ_GC_BLACK, Dt1(->base));
if (LJ_TARGET_OSX) { if (LJ_TARGET_IOS) {
dasm_put(Dst, 5003, Dt1(->base)); dasm_put(Dst, 5003, Dt1(->base));
} }
dasm_put(Dst, 5006, DISPATCH_GL(gc.grayagain), LJ_GC_BLACK, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); dasm_put(Dst, 5006, DISPATCH_GL(gc.grayagain), LJ_GC_BLACK, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist));

View File

@ -96,6 +96,7 @@
#define LJ_TARGET_WINDOWS (LUAJIT_OS == LUAJIT_OS_WINDOWS) #define LJ_TARGET_WINDOWS (LUAJIT_OS == LUAJIT_OS_WINDOWS)
#define LJ_TARGET_LINUX (LUAJIT_OS == LUAJIT_OS_LINUX) #define LJ_TARGET_LINUX (LUAJIT_OS == LUAJIT_OS_LINUX)
#define LJ_TARGET_OSX (LUAJIT_OS == LUAJIT_OS_OSX) #define LJ_TARGET_OSX (LUAJIT_OS == LUAJIT_OS_OSX)
#define LJ_TARGET_IOS (LJ_TARGET_OSX && LUAJIT_TARGET == LUAJIT_ARCH_ARM)
#define LJ_TARGET_POSIX (LUAJIT_OS > LUAJIT_OS_WINDOWS) #define LJ_TARGET_POSIX (LUAJIT_OS > LUAJIT_OS_WINDOWS)
#define LJ_TARGET_DLOPEN LJ_TARGET_POSIX #define LJ_TARGET_DLOPEN LJ_TARGET_POSIX
@ -149,10 +150,6 @@
#define LJ_TARGET_MASKROT 1 #define LJ_TARGET_MASKROT 1
#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */ #define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */
#define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL #define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL
#if LJ_TARGET_OSX
/* Runtime code generation is restricted on iOS. Complain to Apple, not me. */
#define LJ_ARCH_NOJIT 1
#endif
#elif LUAJIT_TARGET == LUAJIT_ARCH_PPC #elif LUAJIT_TARGET == LUAJIT_ARCH_PPC
@ -243,7 +240,7 @@
#if defined(__ARM_PCS_VFP) #if defined(__ARM_PCS_VFP)
#error "No support for ARM hard-float ABI (yet)" #error "No support for ARM hard-float ABI (yet)"
#endif #endif
#if !(__ARM_EABI__ || LJ_TARGET_OSX) #if !(__ARM_EABI__ || LJ_TARGET_IOS)
#error "Only ARM EABI or iOS 3.0+ ABI is supported" #error "Only ARM EABI or iOS 3.0+ ABI is supported"
#endif #endif
#elif LJ_TARGET_PPC || LJ_TARGET_PPCSPE #elif LJ_TARGET_PPC || LJ_TARGET_PPCSPE
@ -272,8 +269,15 @@
#define LJ_DUALNUM 0 #define LJ_DUALNUM 0
#endif #endif
#if LJ_TARGET_IOS
/* Runtime code generation is restricted on iOS. Complain to Apple, not me. */
#ifndef LUAJIT_ENABLE_JIT
#define LJ_OS_NOJIT 1
#endif
#endif
/* Disable or enable the JIT compiler. */ /* Disable or enable the JIT compiler. */
#if defined(LUAJIT_DISABLE_JIT) || defined(LJ_ARCH_NOJIT) #if defined(LUAJIT_DISABLE_JIT) || defined(LJ_ARCH_NOJIT) || defined(LJ_OS_NOJIT)
#define LJ_HASJIT 0 #define LJ_HASJIT 0
#else #else
#define LJ_HASJIT 1 #define LJ_HASJIT 1
@ -316,7 +320,7 @@
#define LUAJIT_NO_EXP2 #define LUAJIT_NO_EXP2
#endif #endif
#if defined(__symbian__) || (LJ_TARGET_ARM && LJ_TARGET_OSX) #if defined(__symbian__) || LJ_TARGET_IOS
#define LUAJIT_NO_UNWIND #define LUAJIT_NO_UNWIND
#endif #endif

View File

@ -25,7 +25,14 @@
#define CALLBACK_MCODE_SIZE (LJ_PAGESIZE * LJ_NUM_CBPAGE) #define CALLBACK_MCODE_SIZE (LJ_PAGESIZE * LJ_NUM_CBPAGE)
#if LJ_TARGET_X86ORX64 #if LJ_OS_NOJIT
/* Disabled callback support. */
#define CALLBACK_SLOT2OFS(slot) (0*(slot))
#define CALLBACK_OFS2SLOT(ofs) (0*(ofs))
#define CALLBACK_MAX_SLOT 0
#elif LJ_TARGET_X86ORX64
#define CALLBACK_MCODE_HEAD (LJ_64 ? 8 : 0) #define CALLBACK_MCODE_HEAD (LJ_64 ? 8 : 0)
#define CALLBACK_MCODE_GROUP (-2+1+2+5+(LJ_64 ? 6 : 5)) #define CALLBACK_MCODE_GROUP (-2+1+2+5+(LJ_64 ? 6 : 5))
@ -93,7 +100,10 @@ MSize lj_ccallback_ptr2slot(CTState *cts, void *p)
} }
/* Initialize machine code for callback function pointers. */ /* Initialize machine code for callback function pointers. */
#if LJ_TARGET_X86ORX64 #if LJ_OS_NOJIT
/* Disabled callback support. */
#define callback_mcode_init(g, p) UNUSED(p)
#elif LJ_TARGET_X86ORX64
static void callback_mcode_init(global_State *g, uint8_t *page) static void callback_mcode_init(global_State *g, uint8_t *page)
{ {
uint8_t *p = page; uint8_t *p = page;

View File

@ -162,7 +162,11 @@ ERRDEF(FFI_BADIDX, LUA_QS " cannot be indexed")
ERRDEF(FFI_WRCONST, "attempt to write to constant location") ERRDEF(FFI_WRCONST, "attempt to write to constant location")
ERRDEF(FFI_NODECL, "missing declaration for symbol " LUA_QS) ERRDEF(FFI_NODECL, "missing declaration for symbol " LUA_QS)
ERRDEF(FFI_BADCBACK, "bad callback") ERRDEF(FFI_BADCBACK, "bad callback")
#if LJ_OS_NOJIT
ERRDEF(FFI_CBACKOV, "no support for callbacks on this OS")
#else
ERRDEF(FFI_CBACKOV, "too many callbacks") ERRDEF(FFI_CBACKOV, "too many callbacks")
#endif
ERRDEF(FFI_NYIPACKBIT, "NYI: packed bit fields") ERRDEF(FFI_NYIPACKBIT, "NYI: packed bit fields")
ERRDEF(FFI_NYICALL, "NYI: cannot call this C function (yet)") ERRDEF(FFI_NYICALL, "NYI: cannot call this C function (yet)")
#endif #endif

View File

@ -209,7 +209,7 @@ LJ_DATA const CCallInfo lj_ir_callinfo[IRCALL__MAX+1];
#define fp64_ul2d __aeabi_ul2d #define fp64_ul2d __aeabi_ul2d
#define fp64_l2f __aeabi_l2f #define fp64_l2f __aeabi_l2f
#define fp64_ul2f __aeabi_ul2f #define fp64_ul2f __aeabi_ul2f
#if LJ_TARGET_OSX #if LJ_TARGET_IOS
#define fp64_d2l __fixdfdi #define fp64_d2l __fixdfdi
#define fp64_d2ul __fixunsdfdi #define fp64_d2ul __fixunsdfdi
#define fp64_f2l __fixsfdi #define fp64_f2l __fixsfdi

View File

@ -25,7 +25,7 @@
#include <valgrind/valgrind.h> #include <valgrind/valgrind.h>
#endif #endif
#if !LJ_TARGET_X86ORX64 && LJ_TARGET_OSX #if LJ_TARGET_IOS
void sys_icache_invalidate(void *start, size_t len); void sys_icache_invalidate(void *start, size_t len);
#endif #endif
@ -37,7 +37,7 @@ void lj_mcode_sync(void *start, void *end)
#endif #endif
#if LJ_TARGET_X86ORX64 #if LJ_TARGET_X86ORX64
UNUSED(start); UNUSED(end); UNUSED(start); UNUSED(end);
#elif LJ_TARGET_OSX #elif LJ_TARGET_IOS
sys_icache_invalidate(start, (char *)end-(char *)start); sys_icache_invalidate(start, (char *)end-(char *)start);
#elif LJ_TARGET_PPC #elif LJ_TARGET_PPC
lj_vm_cachesync(start, end); lj_vm_cachesync(start, end);