aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2012-06-08 11:57:44 +0200
committerMike Pall <mike>2012-06-08 11:59:23 +0200
commitfad5382d2179fa17b855cd3fbf1e8de508a4b2ae (patch)
treec371ae205b19f40650069594357d710a2dab3fdb /src
parent1543b2a7cabee0cab56c6d1196576331521f6cfc (diff)
downloadluajit-fad5382d2179fa17b855cd3fbf1e8de508a4b2ae.tar.gz
luajit-fad5382d2179fa17b855cd3fbf1e8de508a4b2ae.tar.bz2
luajit-fad5382d2179fa17b855cd3fbf1e8de508a4b2ae.zip
Rearrange OSX vs. iOS defines. Disable callbacks on iOS.
Diffstat (limited to 'src')
-rw-r--r--src/buildvm_arm.dasc6
-rw-r--r--src/buildvm_arm.h122
-rw-r--r--src/lj_arch.h18
-rw-r--r--src/lj_ccallback.c14
-rw-r--r--src/lj_errmsg.h4
-rw-r--r--src/lj_ircall.h2
-rw-r--r--src/lj_mcode.c4
7 files changed, 94 insertions, 76 deletions
diff --git a/src/buildvm_arm.dasc b/src/buildvm_arm.dasc
index 6f0e3878..3a039402 100644
--- a/src/buildvm_arm.dasc
+++ b/src/buildvm_arm.dasc
@@ -218,7 +218,7 @@
218|.endmacro 218|.endmacro
219| 219|
220|.macro IOS, a, b 220|.macro IOS, a, b
221||if (LJ_TARGET_OSX) { 221||if (LJ_TARGET_IOS) {
222| a, b 222| a, b
223||} 223||}
224|.endmacro 224|.endmacro
@@ -2892,7 +2892,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
2892 | sub CARG1, DISPATCH, #-GG_DISP2G 2892 | sub CARG1, DISPATCH, #-GG_DISP2G
2893 | tst RC, #LJ_GC_WHITES 2893 | tst RC, #LJ_GC_WHITES
2894 | // Crossed a write barrier. Move the barrier forward. 2894 | // Crossed a write barrier. Move the barrier forward.
2895 if (LJ_TARGET_OSX) { 2895 if (LJ_TARGET_IOS) {
2896 | beq <1 2896 | beq <1
2897 | mov RC, BASE 2897 | mov RC, BASE
2898 | bl extern lj_gc_barrieruv // (global_State *g, TValue *tv) 2898 | bl extern lj_gc_barrieruv // (global_State *g, TValue *tv)
@@ -2926,7 +2926,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
2926 | cmpne RC, #0 2926 | cmpne RC, #0
2927 | sub CARG1, DISPATCH, #-GG_DISP2G 2927 | sub CARG1, DISPATCH, #-GG_DISP2G
2928 | // Crossed a write barrier. Move the barrier forward. 2928 | // Crossed a write barrier. Move the barrier forward.
2929 if (LJ_TARGET_OSX) { 2929 if (LJ_TARGET_IOS) {
2930 | beq <1 2930 | beq <1
2931 | mov RC, BASE 2931 | mov RC, BASE
2932 | bl extern lj_gc_barrieruv // (global_State *g, TValue *tv) 2932 | bl extern lj_gc_barrieruv // (global_State *g, TValue *tv)
diff --git a/src/buildvm_arm.h b/src/buildvm_arm.h
index aec421dd..bccefa57 100644
--- a/src/buildvm_arm.h
+++ b/src/buildvm_arm.h
@@ -6205,15 +6205,15 @@ static void build_subroutines(BuildCtx *ctx)
6205 dasm_put(Dst, 329); 6205 dasm_put(Dst, 329);
6206#endif 6206#endif
6207 dasm_put(Dst, 338, Dt1(->base), -DISPATCH_GL(tmptv), ~LJ_TTAB, ~LJ_TSTR, ~LJ_TISNUM, Dt1(->base)); 6207 dasm_put(Dst, 338, Dt1(->base), -DISPATCH_GL(tmptv), ~LJ_TTAB, ~LJ_TSTR, ~LJ_TISNUM, Dt1(->base));
6208 if (LJ_TARGET_OSX) { 6208 if (LJ_TARGET_IOS) {
6209 dasm_put(Dst, 395, Dt1(->base)); 6209 dasm_put(Dst, 395, Dt1(->base));
6210 } 6210 }
6211 dasm_put(Dst, 398, FRAME_CONT, Dt1(->top), -DISPATCH_GL(tmptv), ~LJ_TTAB, ~LJ_TSTR, ~LJ_TISNUM, Dt1(->base)); 6211 dasm_put(Dst, 398, FRAME_CONT, Dt1(->top), -DISPATCH_GL(tmptv), ~LJ_TTAB, ~LJ_TSTR, ~LJ_TISNUM, Dt1(->base));
6212 if (LJ_TARGET_OSX) { 6212 if (LJ_TARGET_IOS) {
6213 dasm_put(Dst, 460, Dt1(->base)); 6213 dasm_put(Dst, 460, Dt1(->base));
6214 } 6214 }
6215 dasm_put(Dst, 463, FRAME_CONT, Dt1(->top), Dt1(->base)); 6215 dasm_put(Dst, 463, FRAME_CONT, Dt1(->top), Dt1(->base));
6216 if (LJ_TARGET_OSX) { 6216 if (LJ_TARGET_IOS) {
6217 dasm_put(Dst, 499, Dt1(->base)); 6217 dasm_put(Dst, 499, Dt1(->base));
6218 } 6218 }
6219 dasm_put(Dst, 502, ~LJ_TTRUE, -LJ_TFALSE, Dt1(->base)); 6219 dasm_put(Dst, 502, ~LJ_TTRUE, -LJ_TFALSE, Dt1(->base));
@@ -6221,11 +6221,11 @@ static void build_subroutines(BuildCtx *ctx)
6221 dasm_put(Dst, 549, Dt1(->base)); 6221 dasm_put(Dst, 549, Dt1(->base));
6222#endif 6222#endif
6223 dasm_put(Dst, 560, Dt1(->base)); 6223 dasm_put(Dst, 560, Dt1(->base));
6224 if (LJ_TARGET_OSX) { 6224 if (LJ_TARGET_IOS) {
6225 dasm_put(Dst, 597, Dt1(->base)); 6225 dasm_put(Dst, 597, Dt1(->base));
6226 } 6226 }
6227 dasm_put(Dst, 600, FRAME_CONT, Dt1(->base)); 6227 dasm_put(Dst, 600, FRAME_CONT, Dt1(->base));
6228 if (LJ_TARGET_OSX) { 6228 if (LJ_TARGET_IOS) {
6229 dasm_put(Dst, 621, Dt1(->base)); 6229 dasm_put(Dst, 621, Dt1(->base));
6230 } 6230 }
6231#ifdef LUAJIT_ENABLE_LUA52COMPAT 6231#ifdef LUAJIT_ENABLE_LUA52COMPAT
@@ -6234,19 +6234,19 @@ static void build_subroutines(BuildCtx *ctx)
6234 dasm_put(Dst, 631); 6234 dasm_put(Dst, 631);
6235#endif 6235#endif
6236 dasm_put(Dst, 634, Dt1(->base)); 6236 dasm_put(Dst, 634, Dt1(->base));
6237 if (LJ_TARGET_OSX) { 6237 if (LJ_TARGET_IOS) {
6238 dasm_put(Dst, 642); 6238 dasm_put(Dst, 642);
6239 } 6239 }
6240 dasm_put(Dst, 644); 6240 dasm_put(Dst, 644);
6241 if (LJ_TARGET_OSX) { 6241 if (LJ_TARGET_IOS) {
6242 dasm_put(Dst, 647); 6242 dasm_put(Dst, 647);
6243 } 6243 }
6244 dasm_put(Dst, 649, Dt7(->field_pc), Dt1(->base)); 6244 dasm_put(Dst, 649, Dt7(->field_pc), Dt1(->base));
6245 if (LJ_TARGET_OSX) { 6245 if (LJ_TARGET_IOS) {
6246 dasm_put(Dst, 670, Dt1(->base)); 6246 dasm_put(Dst, 670, Dt1(->base));
6247 } 6247 }
6248 dasm_put(Dst, 673, Dt1(->base)); 6248 dasm_put(Dst, 673, Dt1(->base));
6249 if (LJ_TARGET_OSX) { 6249 if (LJ_TARGET_IOS) {
6250 dasm_put(Dst, 687, Dt1(->base)); 6250 dasm_put(Dst, 687, Dt1(->base));
6251 } 6251 }
6252#if LJ_HASJIT 6252#if LJ_HASJIT
@@ -6264,16 +6264,16 @@ static void build_subroutines(BuildCtx *ctx)
6264 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); 6264 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);
6265 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); 6265 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);
6266 dasm_put(Dst, 860); 6266 dasm_put(Dst, 860);
6267 if (LJ_TARGET_OSX) { 6267 if (LJ_TARGET_IOS) {
6268 dasm_put(Dst, 865); 6268 dasm_put(Dst, 865);
6269 } 6269 }
6270 dasm_put(Dst, 867); 6270 dasm_put(Dst, 867);
6271 if (LJ_TARGET_OSX) { 6271 if (LJ_TARGET_IOS) {
6272 dasm_put(Dst, 870); 6272 dasm_put(Dst, 870);
6273 } 6273 }
6274 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); 6274 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);
6275 dasm_put(Dst, 924, ~LJ_TNIL, -LJ_TTAB, Dt1(->base), Dt1(->top)); 6275 dasm_put(Dst, 924, ~LJ_TNIL, -LJ_TTAB, Dt1(->base), Dt1(->top));
6276 if (LJ_TARGET_OSX) { 6276 if (LJ_TARGET_IOS) {
6277 dasm_put(Dst, 947, Dt1(->base)); 6277 dasm_put(Dst, 947, Dt1(->base));
6278 } 6278 }
6279 dasm_put(Dst, 950, ~LJ_TNIL, (2+1)*8, -LJ_TTAB); 6279 dasm_put(Dst, 950, ~LJ_TNIL, (2+1)*8, -LJ_TTAB);
@@ -6285,11 +6285,11 @@ static void build_subroutines(BuildCtx *ctx)
6285 dasm_put(Dst, 980); 6285 dasm_put(Dst, 980);
6286#endif 6286#endif
6287 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)); 6287 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));
6288 if (LJ_TARGET_OSX) { 6288 if (LJ_TARGET_IOS) {
6289 dasm_put(Dst, 1034); 6289 dasm_put(Dst, 1034);
6290 } 6290 }
6291 dasm_put(Dst, 1036); 6291 dasm_put(Dst, 1036);
6292 if (LJ_TARGET_OSX) { 6292 if (LJ_TARGET_IOS) {
6293 dasm_put(Dst, 1039); 6293 dasm_put(Dst, 1039);
6294 } 6294 }
6295 dasm_put(Dst, 1041, -LJ_TTAB); 6295 dasm_put(Dst, 1041, -LJ_TTAB);
@@ -6309,155 +6309,155 @@ static void build_subroutines(BuildCtx *ctx)
6309 dasm_put(Dst, 1429, -LJ_TISNUM, ~LJ_TISNUM, ~LJ_TISNUM); 6309 dasm_put(Dst, 1429, -LJ_TISNUM, ~LJ_TISNUM, ~LJ_TISNUM);
6310 dasm_put(Dst, 1493, -LJ_TISNUM, (1+1)*8, FRAME_TYPE, ~LJ_TNIL); 6310 dasm_put(Dst, 1493, -LJ_TISNUM, (1+1)*8, FRAME_TYPE, ~LJ_TNIL);
6311 dasm_put(Dst, 1555, -LJ_TISNUM); 6311 dasm_put(Dst, 1555, -LJ_TISNUM);
6312 if (LJ_TARGET_OSX) { 6312 if (LJ_TARGET_IOS) {
6313 dasm_put(Dst, 1564); 6313 dasm_put(Dst, 1564);
6314 } 6314 }
6315 dasm_put(Dst, 1566); 6315 dasm_put(Dst, 1566);
6316 if (LJ_TARGET_OSX) { 6316 if (LJ_TARGET_IOS) {
6317 dasm_put(Dst, 1569); 6317 dasm_put(Dst, 1569);
6318 } 6318 }
6319 dasm_put(Dst, 1571, -LJ_TISNUM); 6319 dasm_put(Dst, 1571, -LJ_TISNUM);
6320 if (LJ_TARGET_OSX) { 6320 if (LJ_TARGET_IOS) {
6321 dasm_put(Dst, 1583); 6321 dasm_put(Dst, 1583);
6322 } 6322 }
6323 dasm_put(Dst, 1585); 6323 dasm_put(Dst, 1585);
6324 if (LJ_TARGET_OSX) { 6324 if (LJ_TARGET_IOS) {
6325 dasm_put(Dst, 1588); 6325 dasm_put(Dst, 1588);
6326 } 6326 }
6327 dasm_put(Dst, 1590, -LJ_TISNUM); 6327 dasm_put(Dst, 1590, -LJ_TISNUM);
6328 if (LJ_TARGET_OSX) { 6328 if (LJ_TARGET_IOS) {
6329 dasm_put(Dst, 1602); 6329 dasm_put(Dst, 1602);
6330 } 6330 }
6331 dasm_put(Dst, 1604); 6331 dasm_put(Dst, 1604);
6332 if (LJ_TARGET_OSX) { 6332 if (LJ_TARGET_IOS) {
6333 dasm_put(Dst, 1607); 6333 dasm_put(Dst, 1607);
6334 } 6334 }
6335 dasm_put(Dst, 1609, -LJ_TISNUM); 6335 dasm_put(Dst, 1609, -LJ_TISNUM);
6336 if (LJ_TARGET_OSX) { 6336 if (LJ_TARGET_IOS) {
6337 dasm_put(Dst, 1621); 6337 dasm_put(Dst, 1621);
6338 } 6338 }
6339 dasm_put(Dst, 1623); 6339 dasm_put(Dst, 1623);
6340 if (LJ_TARGET_OSX) { 6340 if (LJ_TARGET_IOS) {
6341 dasm_put(Dst, 1626); 6341 dasm_put(Dst, 1626);
6342 } 6342 }
6343 dasm_put(Dst, 1628, -LJ_TISNUM); 6343 dasm_put(Dst, 1628, -LJ_TISNUM);
6344 if (LJ_TARGET_OSX) { 6344 if (LJ_TARGET_IOS) {
6345 dasm_put(Dst, 1640); 6345 dasm_put(Dst, 1640);
6346 } 6346 }
6347 dasm_put(Dst, 1642); 6347 dasm_put(Dst, 1642);
6348 if (LJ_TARGET_OSX) { 6348 if (LJ_TARGET_IOS) {
6349 dasm_put(Dst, 1645); 6349 dasm_put(Dst, 1645);
6350 } 6350 }
6351 dasm_put(Dst, 1647, -LJ_TISNUM); 6351 dasm_put(Dst, 1647, -LJ_TISNUM);
6352 if (LJ_TARGET_OSX) { 6352 if (LJ_TARGET_IOS) {
6353 dasm_put(Dst, 1659); 6353 dasm_put(Dst, 1659);
6354 } 6354 }
6355 dasm_put(Dst, 1661); 6355 dasm_put(Dst, 1661);
6356 if (LJ_TARGET_OSX) { 6356 if (LJ_TARGET_IOS) {
6357 dasm_put(Dst, 1664); 6357 dasm_put(Dst, 1664);
6358 } 6358 }
6359 dasm_put(Dst, 1666, -LJ_TISNUM); 6359 dasm_put(Dst, 1666, -LJ_TISNUM);
6360 if (LJ_TARGET_OSX) { 6360 if (LJ_TARGET_IOS) {
6361 dasm_put(Dst, 1678); 6361 dasm_put(Dst, 1678);
6362 } 6362 }
6363 dasm_put(Dst, 1680); 6363 dasm_put(Dst, 1680);
6364 if (LJ_TARGET_OSX) { 6364 if (LJ_TARGET_IOS) {
6365 dasm_put(Dst, 1683); 6365 dasm_put(Dst, 1683);
6366 } 6366 }
6367 dasm_put(Dst, 1685, -LJ_TISNUM); 6367 dasm_put(Dst, 1685, -LJ_TISNUM);
6368 if (LJ_TARGET_OSX) { 6368 if (LJ_TARGET_IOS) {
6369 dasm_put(Dst, 1697); 6369 dasm_put(Dst, 1697);
6370 } 6370 }
6371 dasm_put(Dst, 1699); 6371 dasm_put(Dst, 1699);
6372 if (LJ_TARGET_OSX) { 6372 if (LJ_TARGET_IOS) {
6373 dasm_put(Dst, 1702); 6373 dasm_put(Dst, 1702);
6374 } 6374 }
6375 dasm_put(Dst, 1704, -LJ_TISNUM); 6375 dasm_put(Dst, 1704, -LJ_TISNUM);
6376 if (LJ_TARGET_OSX) { 6376 if (LJ_TARGET_IOS) {
6377 dasm_put(Dst, 1716); 6377 dasm_put(Dst, 1716);
6378 } 6378 }
6379 dasm_put(Dst, 1718); 6379 dasm_put(Dst, 1718);
6380 if (LJ_TARGET_OSX) { 6380 if (LJ_TARGET_IOS) {
6381 dasm_put(Dst, 1721); 6381 dasm_put(Dst, 1721);
6382 } 6382 }
6383 dasm_put(Dst, 1723, -LJ_TISNUM); 6383 dasm_put(Dst, 1723, -LJ_TISNUM);
6384 if (LJ_TARGET_OSX) { 6384 if (LJ_TARGET_IOS) {
6385 dasm_put(Dst, 1735); 6385 dasm_put(Dst, 1735);
6386 } 6386 }
6387 dasm_put(Dst, 1737); 6387 dasm_put(Dst, 1737);
6388 if (LJ_TARGET_OSX) { 6388 if (LJ_TARGET_IOS) {
6389 dasm_put(Dst, 1740); 6389 dasm_put(Dst, 1740);
6390 } 6390 }
6391 dasm_put(Dst, 1742, -LJ_TISNUM); 6391 dasm_put(Dst, 1742, -LJ_TISNUM);
6392 if (LJ_TARGET_OSX) { 6392 if (LJ_TARGET_IOS) {
6393 dasm_put(Dst, 1754); 6393 dasm_put(Dst, 1754);
6394 } 6394 }
6395 dasm_put(Dst, 1756); 6395 dasm_put(Dst, 1756);
6396 if (LJ_TARGET_OSX) { 6396 if (LJ_TARGET_IOS) {
6397 dasm_put(Dst, 1759); 6397 dasm_put(Dst, 1759);
6398 } 6398 }
6399 dasm_put(Dst, 1761, -LJ_TISNUM); 6399 dasm_put(Dst, 1761, -LJ_TISNUM);
6400 if (LJ_TARGET_OSX) { 6400 if (LJ_TARGET_IOS) {
6401 dasm_put(Dst, 1773); 6401 dasm_put(Dst, 1773);
6402 } 6402 }
6403 dasm_put(Dst, 1775); 6403 dasm_put(Dst, 1775);
6404 if (LJ_TARGET_OSX) { 6404 if (LJ_TARGET_IOS) {
6405 dasm_put(Dst, 1778); 6405 dasm_put(Dst, 1778);
6406 } 6406 }
6407 dasm_put(Dst, 1780, -LJ_TISNUM); 6407 dasm_put(Dst, 1780, -LJ_TISNUM);
6408 if (LJ_TARGET_OSX) { 6408 if (LJ_TARGET_IOS) {
6409 dasm_put(Dst, 1792); 6409 dasm_put(Dst, 1792);
6410 } 6410 }
6411 dasm_put(Dst, 1794); 6411 dasm_put(Dst, 1794);
6412 if (LJ_TARGET_OSX) { 6412 if (LJ_TARGET_IOS) {
6413 dasm_put(Dst, 1797); 6413 dasm_put(Dst, 1797);
6414 } 6414 }
6415 dasm_put(Dst, 1799, -LJ_TISNUM, -LJ_TISNUM); 6415 dasm_put(Dst, 1799, -LJ_TISNUM, -LJ_TISNUM);
6416 if (LJ_TARGET_OSX) { 6416 if (LJ_TARGET_IOS) {
6417 dasm_put(Dst, 1814); 6417 dasm_put(Dst, 1814);
6418 } 6418 }
6419 dasm_put(Dst, 1816); 6419 dasm_put(Dst, 1816);
6420 if (LJ_TARGET_OSX) { 6420 if (LJ_TARGET_IOS) {
6421 dasm_put(Dst, 1819); 6421 dasm_put(Dst, 1819);
6422 } 6422 }
6423 dasm_put(Dst, 1821, -LJ_TISNUM, -LJ_TISNUM); 6423 dasm_put(Dst, 1821, -LJ_TISNUM, -LJ_TISNUM);
6424 if (LJ_TARGET_OSX) { 6424 if (LJ_TARGET_IOS) {
6425 dasm_put(Dst, 1836); 6425 dasm_put(Dst, 1836);
6426 } 6426 }
6427 dasm_put(Dst, 1838); 6427 dasm_put(Dst, 1838);
6428 if (LJ_TARGET_OSX) { 6428 if (LJ_TARGET_IOS) {
6429 dasm_put(Dst, 1841); 6429 dasm_put(Dst, 1841);
6430 } 6430 }
6431 dasm_put(Dst, 1843, -LJ_TISNUM, -LJ_TISNUM); 6431 dasm_put(Dst, 1843, -LJ_TISNUM, -LJ_TISNUM);
6432 if (LJ_TARGET_OSX) { 6432 if (LJ_TARGET_IOS) {
6433 dasm_put(Dst, 1858); 6433 dasm_put(Dst, 1858);
6434 } 6434 }
6435 dasm_put(Dst, 1860); 6435 dasm_put(Dst, 1860);
6436 if (LJ_TARGET_OSX) { 6436 if (LJ_TARGET_IOS) {
6437 dasm_put(Dst, 1863); 6437 dasm_put(Dst, 1863);
6438 } 6438 }
6439 dasm_put(Dst, 1865, -LJ_TISNUM, Dt8(->upvalue[0]), -LJ_TISNUM, -LJ_TISNUM); 6439 dasm_put(Dst, 1865, -LJ_TISNUM, Dt8(->upvalue[0]), -LJ_TISNUM, -LJ_TISNUM);
6440 if (LJ_TARGET_OSX) { 6440 if (LJ_TARGET_IOS) {
6441 dasm_put(Dst, 1898); 6441 dasm_put(Dst, 1898);
6442 } 6442 }
6443 dasm_put(Dst, 1900); 6443 dasm_put(Dst, 1900);
6444 if (LJ_TARGET_OSX) { 6444 if (LJ_TARGET_IOS) {
6445 dasm_put(Dst, 1903); 6445 dasm_put(Dst, 1903);
6446 } 6446 }
6447 dasm_put(Dst, 1905, -LJ_TISNUM); 6447 dasm_put(Dst, 1905, -LJ_TISNUM);
6448 if (LJ_TARGET_OSX) { 6448 if (LJ_TARGET_IOS) {
6449 dasm_put(Dst, 1918); 6449 dasm_put(Dst, 1918);
6450 } 6450 }
6451 dasm_put(Dst, 1920); 6451 dasm_put(Dst, 1920);
6452 if (LJ_TARGET_OSX) { 6452 if (LJ_TARGET_IOS) {
6453 dasm_put(Dst, 1923); 6453 dasm_put(Dst, 1923);
6454 } 6454 }
6455 dasm_put(Dst, 1925, ~LJ_TISNUM, (2+1)*8, -LJ_TISNUM); 6455 dasm_put(Dst, 1925, ~LJ_TISNUM, (2+1)*8, -LJ_TISNUM);
6456 if (LJ_TARGET_OSX) { 6456 if (LJ_TARGET_IOS) {
6457 dasm_put(Dst, 1947); 6457 dasm_put(Dst, 1947);
6458 } 6458 }
6459 dasm_put(Dst, 1949); 6459 dasm_put(Dst, 1949);
6460 if (LJ_TARGET_OSX) { 6460 if (LJ_TARGET_IOS) {
6461 dasm_put(Dst, 1952); 6461 dasm_put(Dst, 1952);
6462 } 6462 }
6463 dasm_put(Dst, 1954, (2+1)*8, -LJ_TISNUM, -LJ_TISNUM, -LJ_TISNUM); 6463 dasm_put(Dst, 1954, (2+1)*8, -LJ_TISNUM, -LJ_TISNUM, -LJ_TISNUM);
@@ -6468,11 +6468,11 @@ static void build_subroutines(BuildCtx *ctx)
6468 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)); 6468 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));
6469 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)); 6469 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));
6470 dasm_put(Dst, 2347, -LJ_TSTR, Dt5(->len), DISPATCH_GL(tmpbuf.sz), DISPATCH_GL(tmpbuf.buf), sizeof(GCstr), -LJ_TTAB); 6470 dasm_put(Dst, 2347, -LJ_TSTR, Dt5(->len), DISPATCH_GL(tmpbuf.sz), DISPATCH_GL(tmpbuf.buf), sizeof(GCstr), -LJ_TTAB);
6471 if (LJ_TARGET_OSX) { 6471 if (LJ_TARGET_IOS) {
6472 dasm_put(Dst, 2385); 6472 dasm_put(Dst, 2385);
6473 } 6473 }
6474 dasm_put(Dst, 2387); 6474 dasm_put(Dst, 2387);
6475 if (LJ_TARGET_OSX) { 6475 if (LJ_TARGET_IOS) {
6476 dasm_put(Dst, 2390); 6476 dasm_put(Dst, 2390);
6477 } 6477 }
6478 dasm_put(Dst, 2392, ~LJ_TISNUM, -LJ_TISNUM, ~LJ_TISNUM, -LJ_TISNUM, -LJ_TISNUM); 6478 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)
6709 dasm_put(Dst, 3647, Dt6(->metatable)); 6709 dasm_put(Dst, 3647, Dt6(->metatable));
6710#endif 6710#endif
6711 dasm_put(Dst, 3654); 6711 dasm_put(Dst, 3654);
6712 if (LJ_TARGET_OSX) { 6712 if (LJ_TARGET_IOS) {
6713 dasm_put(Dst, 3656); 6713 dasm_put(Dst, 3656);
6714 } 6714 }
6715 dasm_put(Dst, 3658); 6715 dasm_put(Dst, 3658);
6716 if (LJ_TARGET_OSX) { 6716 if (LJ_TARGET_IOS) {
6717 dasm_put(Dst, 3661); 6717 dasm_put(Dst, 3661);
6718 } 6718 }
6719 dasm_put(Dst, 3663); 6719 dasm_put(Dst, 3663);
@@ -7050,11 +7050,11 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
7050 dasm_put(Dst, 4152); 7050 dasm_put(Dst, 4152);
7051 break; 7051 break;
7052 } 7052 }
7053 if (LJ_TARGET_OSX) { 7053 if (LJ_TARGET_IOS) {
7054 dasm_put(Dst, 4155); 7054 dasm_put(Dst, 4155);
7055 } 7055 }
7056 dasm_put(Dst, 4157); 7056 dasm_put(Dst, 4157);
7057 if (LJ_TARGET_OSX) { 7057 if (LJ_TARGET_IOS) {
7058 dasm_put(Dst, 4160); 7058 dasm_put(Dst, 4160);
7059 } 7059 }
7060 dasm_put(Dst, 4162); 7060 dasm_put(Dst, 4162);
@@ -7094,7 +7094,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
7094 break; 7094 break;
7095 case BC_USETV: 7095 case BC_USETV:
7096 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); 7096 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);
7097 if (LJ_TARGET_OSX) { 7097 if (LJ_TARGET_IOS) {
7098 dasm_put(Dst, 4326); 7098 dasm_put(Dst, 4326);
7099 } else { 7099 } else {
7100 dasm_put(Dst, 4333); 7100 dasm_put(Dst, 4333);
@@ -7103,7 +7103,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
7103 break; 7103 break;
7104 case BC_USETS: 7104 case BC_USETS:
7105 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); 7105 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);
7106 if (LJ_TARGET_OSX) { 7106 if (LJ_TARGET_IOS) {
7107 dasm_put(Dst, 4375); 7107 dasm_put(Dst, 4375);
7108 } else { 7108 } else {
7109 dasm_put(Dst, 4382); 7109 dasm_put(Dst, 4382);
@@ -7178,7 +7178,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
7178 7178
7179 case BC_TSETM: 7179 case BC_TSETM:
7180 dasm_put(Dst, 4958, Dt6(->asize), Dt6(->array), Dt6(->marked), LJ_GC_BLACK, Dt1(->base)); 7180 dasm_put(Dst, 4958, Dt6(->asize), Dt6(->array), Dt6(->marked), LJ_GC_BLACK, Dt1(->base));
7181 if (LJ_TARGET_OSX) { 7181 if (LJ_TARGET_IOS) {
7182 dasm_put(Dst, 5003, Dt1(->base)); 7182 dasm_put(Dst, 5003, Dt1(->base));
7183 } 7183 }
7184 dasm_put(Dst, 5006, DISPATCH_GL(gc.grayagain), LJ_GC_BLACK, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); 7184 dasm_put(Dst, 5006, DISPATCH_GL(gc.grayagain), LJ_GC_BLACK, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist));
diff --git a/src/lj_arch.h b/src/lj_arch.h
index 1f8e1026..ce169b33 100644
--- a/src/lj_arch.h
+++ b/src/lj_arch.h
@@ -96,6 +96,7 @@
96#define LJ_TARGET_WINDOWS (LUAJIT_OS == LUAJIT_OS_WINDOWS) 96#define LJ_TARGET_WINDOWS (LUAJIT_OS == LUAJIT_OS_WINDOWS)
97#define LJ_TARGET_LINUX (LUAJIT_OS == LUAJIT_OS_LINUX) 97#define LJ_TARGET_LINUX (LUAJIT_OS == LUAJIT_OS_LINUX)
98#define LJ_TARGET_OSX (LUAJIT_OS == LUAJIT_OS_OSX) 98#define LJ_TARGET_OSX (LUAJIT_OS == LUAJIT_OS_OSX)
99#define LJ_TARGET_IOS (LJ_TARGET_OSX && LUAJIT_TARGET == LUAJIT_ARCH_ARM)
99#define LJ_TARGET_POSIX (LUAJIT_OS > LUAJIT_OS_WINDOWS) 100#define LJ_TARGET_POSIX (LUAJIT_OS > LUAJIT_OS_WINDOWS)
100#define LJ_TARGET_DLOPEN LJ_TARGET_POSIX 101#define LJ_TARGET_DLOPEN LJ_TARGET_POSIX
101 102
@@ -149,10 +150,6 @@
149#define LJ_TARGET_MASKROT 1 150#define LJ_TARGET_MASKROT 1
150#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */ 151#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */
151#define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL 152#define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL
152#if LJ_TARGET_OSX
153/* Runtime code generation is restricted on iOS. Complain to Apple, not me. */
154#define LJ_ARCH_NOJIT 1
155#endif
156 153
157#elif LUAJIT_TARGET == LUAJIT_ARCH_PPC 154#elif LUAJIT_TARGET == LUAJIT_ARCH_PPC
158 155
@@ -243,7 +240,7 @@
243#if defined(__ARM_PCS_VFP) 240#if defined(__ARM_PCS_VFP)
244#error "No support for ARM hard-float ABI (yet)" 241#error "No support for ARM hard-float ABI (yet)"
245#endif 242#endif
246#if !(__ARM_EABI__ || LJ_TARGET_OSX) 243#if !(__ARM_EABI__ || LJ_TARGET_IOS)
247#error "Only ARM EABI or iOS 3.0+ ABI is supported" 244#error "Only ARM EABI or iOS 3.0+ ABI is supported"
248#endif 245#endif
249#elif LJ_TARGET_PPC || LJ_TARGET_PPCSPE 246#elif LJ_TARGET_PPC || LJ_TARGET_PPCSPE
@@ -272,8 +269,15 @@
272#define LJ_DUALNUM 0 269#define LJ_DUALNUM 0
273#endif 270#endif
274 271
272#if LJ_TARGET_IOS
273/* Runtime code generation is restricted on iOS. Complain to Apple, not me. */
274#ifndef LUAJIT_ENABLE_JIT
275#define LJ_OS_NOJIT 1
276#endif
277#endif
278
275/* Disable or enable the JIT compiler. */ 279/* Disable or enable the JIT compiler. */
276#if defined(LUAJIT_DISABLE_JIT) || defined(LJ_ARCH_NOJIT) 280#if defined(LUAJIT_DISABLE_JIT) || defined(LJ_ARCH_NOJIT) || defined(LJ_OS_NOJIT)
277#define LJ_HASJIT 0 281#define LJ_HASJIT 0
278#else 282#else
279#define LJ_HASJIT 1 283#define LJ_HASJIT 1
@@ -316,7 +320,7 @@
316#define LUAJIT_NO_EXP2 320#define LUAJIT_NO_EXP2
317#endif 321#endif
318 322
319#if defined(__symbian__) || (LJ_TARGET_ARM && LJ_TARGET_OSX) 323#if defined(__symbian__) || LJ_TARGET_IOS
320#define LUAJIT_NO_UNWIND 324#define LUAJIT_NO_UNWIND
321#endif 325#endif
322 326
diff --git a/src/lj_ccallback.c b/src/lj_ccallback.c
index 482553f0..c3f37f2d 100644
--- a/src/lj_ccallback.c
+++ b/src/lj_ccallback.c
@@ -25,7 +25,14 @@
25 25
26#define CALLBACK_MCODE_SIZE (LJ_PAGESIZE * LJ_NUM_CBPAGE) 26#define CALLBACK_MCODE_SIZE (LJ_PAGESIZE * LJ_NUM_CBPAGE)
27 27
28#if LJ_TARGET_X86ORX64 28#if LJ_OS_NOJIT
29
30/* Disabled callback support. */
31#define CALLBACK_SLOT2OFS(slot) (0*(slot))
32#define CALLBACK_OFS2SLOT(ofs) (0*(ofs))
33#define CALLBACK_MAX_SLOT 0
34
35#elif LJ_TARGET_X86ORX64
29 36
30#define CALLBACK_MCODE_HEAD (LJ_64 ? 8 : 0) 37#define CALLBACK_MCODE_HEAD (LJ_64 ? 8 : 0)
31#define CALLBACK_MCODE_GROUP (-2+1+2+5+(LJ_64 ? 6 : 5)) 38#define CALLBACK_MCODE_GROUP (-2+1+2+5+(LJ_64 ? 6 : 5))
@@ -93,7 +100,10 @@ MSize lj_ccallback_ptr2slot(CTState *cts, void *p)
93} 100}
94 101
95/* Initialize machine code for callback function pointers. */ 102/* Initialize machine code for callback function pointers. */
96#if LJ_TARGET_X86ORX64 103#if LJ_OS_NOJIT
104/* Disabled callback support. */
105#define callback_mcode_init(g, p) UNUSED(p)
106#elif LJ_TARGET_X86ORX64
97static void callback_mcode_init(global_State *g, uint8_t *page) 107static void callback_mcode_init(global_State *g, uint8_t *page)
98{ 108{
99 uint8_t *p = page; 109 uint8_t *p = page;
diff --git a/src/lj_errmsg.h b/src/lj_errmsg.h
index d1db4386..5ba619bf 100644
--- a/src/lj_errmsg.h
+++ b/src/lj_errmsg.h
@@ -162,7 +162,11 @@ ERRDEF(FFI_BADIDX, LUA_QS " cannot be indexed")
162ERRDEF(FFI_WRCONST, "attempt to write to constant location") 162ERRDEF(FFI_WRCONST, "attempt to write to constant location")
163ERRDEF(FFI_NODECL, "missing declaration for symbol " LUA_QS) 163ERRDEF(FFI_NODECL, "missing declaration for symbol " LUA_QS)
164ERRDEF(FFI_BADCBACK, "bad callback") 164ERRDEF(FFI_BADCBACK, "bad callback")
165#if LJ_OS_NOJIT
166ERRDEF(FFI_CBACKOV, "no support for callbacks on this OS")
167#else
165ERRDEF(FFI_CBACKOV, "too many callbacks") 168ERRDEF(FFI_CBACKOV, "too many callbacks")
169#endif
166ERRDEF(FFI_NYIPACKBIT, "NYI: packed bit fields") 170ERRDEF(FFI_NYIPACKBIT, "NYI: packed bit fields")
167ERRDEF(FFI_NYICALL, "NYI: cannot call this C function (yet)") 171ERRDEF(FFI_NYICALL, "NYI: cannot call this C function (yet)")
168#endif 172#endif
diff --git a/src/lj_ircall.h b/src/lj_ircall.h
index 39f054a9..7f08bc4a 100644
--- a/src/lj_ircall.h
+++ b/src/lj_ircall.h
@@ -209,7 +209,7 @@ LJ_DATA const CCallInfo lj_ir_callinfo[IRCALL__MAX+1];
209#define fp64_ul2d __aeabi_ul2d 209#define fp64_ul2d __aeabi_ul2d
210#define fp64_l2f __aeabi_l2f 210#define fp64_l2f __aeabi_l2f
211#define fp64_ul2f __aeabi_ul2f 211#define fp64_ul2f __aeabi_ul2f
212#if LJ_TARGET_OSX 212#if LJ_TARGET_IOS
213#define fp64_d2l __fixdfdi 213#define fp64_d2l __fixdfdi
214#define fp64_d2ul __fixunsdfdi 214#define fp64_d2ul __fixunsdfdi
215#define fp64_f2l __fixsfdi 215#define fp64_f2l __fixsfdi
diff --git a/src/lj_mcode.c b/src/lj_mcode.c
index fb6b6dce..41f7951a 100644
--- a/src/lj_mcode.c
+++ b/src/lj_mcode.c
@@ -25,7 +25,7 @@
25#include <valgrind/valgrind.h> 25#include <valgrind/valgrind.h>
26#endif 26#endif
27 27
28#if !LJ_TARGET_X86ORX64 && LJ_TARGET_OSX 28#if LJ_TARGET_IOS
29void sys_icache_invalidate(void *start, size_t len); 29void sys_icache_invalidate(void *start, size_t len);
30#endif 30#endif
31 31
@@ -37,7 +37,7 @@ void lj_mcode_sync(void *start, void *end)
37#endif 37#endif
38#if LJ_TARGET_X86ORX64 38#if LJ_TARGET_X86ORX64
39 UNUSED(start); UNUSED(end); 39 UNUSED(start); UNUSED(end);
40#elif LJ_TARGET_OSX 40#elif LJ_TARGET_IOS
41 sys_icache_invalidate(start, (char *)end-(char *)start); 41 sys_icache_invalidate(start, (char *)end-(char *)start);
42#elif LJ_TARGET_PPC 42#elif LJ_TARGET_PPC
43 lj_vm_cachesync(start, end); 43 lj_vm_cachesync(start, end);