diff options
author | Mike Pall <mike> | 2011-07-13 21:32:28 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2011-07-13 21:33:51 +0200 |
commit | 6599bc7db2fd10cb5c3aa38c59bed64c12f893a8 (patch) | |
tree | 1ba4fba74a4bc1d5044313853dbca8adc6fa3735 | |
parent | 9687472454515f8d5c3aca587eb07375c2bd92a7 (diff) | |
download | luajit-6599bc7db2fd10cb5c3aa38c59bed64c12f893a8.tar.gz luajit-6599bc7db2fd10cb5c3aa38c59bed64c12f893a8.tar.bz2 luajit-6599bc7db2fd10cb5c3aa38c59bed64c12f893a8.zip |
PPCSPE: Fix dispatch for binop metamethods.
-rw-r--r-- | src/buildvm_ppcspe.dasc | 1 | ||||
-rw-r--r-- | src/buildvm_ppcspe.h | 433 |
2 files changed, 218 insertions, 216 deletions
diff --git a/src/buildvm_ppcspe.dasc b/src/buildvm_ppcspe.dasc index 18e160e9..5d85961b 100644 --- a/src/buildvm_ppcspe.dasc +++ b/src/buildvm_ppcspe.dasc | |||
@@ -802,6 +802,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
802 | | // BASE = old base, CRET1 = new base, stack = cont/func/o1/o2 | 802 | | // BASE = old base, CRET1 = new base, stack = cont/func/o1/o2 |
803 | | sub TMP1, CRET1, BASE | 803 | | sub TMP1, CRET1, BASE |
804 | | stw PC, -16(CRET1) // [cont|PC] | 804 | | stw PC, -16(CRET1) // [cont|PC] |
805 | | mr TMP2, BASE | ||
805 | | addi PC, TMP1, FRAME_CONT | 806 | | addi PC, TMP1, FRAME_CONT |
806 | | mr BASE, CRET1 | 807 | | mr BASE, CRET1 |
807 | | li NARGS8:RC, 16 // 2 args for func(o1, o2). | 808 | | li NARGS8:RC, 16 // 2 args for func(o1, o2). |
diff --git a/src/buildvm_ppcspe.h b/src/buildvm_ppcspe.h index 6dde1956..cf3c226e 100644 --- a/src/buildvm_ppcspe.h +++ b/src/buildvm_ppcspe.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #define DASM_SECTION_CODE_OP 0 | 12 | #define DASM_SECTION_CODE_OP 0 |
13 | #define DASM_SECTION_CODE_SUB 1 | 13 | #define DASM_SECTION_CODE_SUB 1 |
14 | #define DASM_MAXSECTION 2 | 14 | #define DASM_MAXSECTION 2 |
15 | static const unsigned int build_actionlist[4992] = { | 15 | static const unsigned int build_actionlist[4993] = { |
16 | 0x00010001, | 16 | 0x00010001, |
17 | 0x00060014, | 17 | 0x00060014, |
18 | 0x72000000, | 18 | 0x72000000, |
@@ -733,6 +733,7 @@ static const unsigned int build_actionlist[4992] = { | |||
733 | 0x00060035, | 733 | 0x00060035, |
734 | 0x7d0e1850, | 734 | 0x7d0e1850, |
735 | 0x9203fff0, | 735 | 0x9203fff0, |
736 | 0x7dc97378, | ||
736 | 0x3a080000, | 737 | 0x3a080000, |
737 | 0x00098200, | 738 | 0x00098200, |
738 | 0x7c6e1b78, | 739 | 0x7c6e1b78, |
@@ -5376,104 +5377,104 @@ static void build_subroutines(BuildCtx *ctx) | |||
5376 | dasm_put(Dst, 637, -(BCBIAS_J*4 >> 16), LJ_TTRUE, LJ_TFALSE, Dt1(->base)); | 5377 | dasm_put(Dst, 637, -(BCBIAS_J*4 >> 16), LJ_TTRUE, LJ_TFALSE, Dt1(->base)); |
5377 | dasm_put(Dst, 706, Dt1(->base), FRAME_CONT); | 5378 | dasm_put(Dst, 706, Dt1(->base), FRAME_CONT); |
5378 | #ifdef LUAJIT_ENABLE_LUA52COMPAT | 5379 | #ifdef LUAJIT_ENABLE_LUA52COMPAT |
5379 | dasm_put(Dst, 728); | 5380 | dasm_put(Dst, 729); |
5380 | #endif | 5381 | #endif |
5381 | dasm_put(Dst, 730, Dt1(->base)); | 5382 | dasm_put(Dst, 731, Dt1(->base)); |
5382 | #ifdef LUAJIT_ENABLE_LUA52COMPAT | 5383 | #ifdef LUAJIT_ENABLE_LUA52COMPAT |
5383 | dasm_put(Dst, 738); | 5384 | dasm_put(Dst, 739); |
5384 | #else | 5385 | #else |
5385 | dasm_put(Dst, 745); | 5386 | dasm_put(Dst, 746); |
5386 | #endif | 5387 | #endif |
5387 | dasm_put(Dst, 748, Dt1(->base), Dt7(->pc), Dt1(->base), Dt1(->base)); | 5388 | dasm_put(Dst, 749, Dt1(->base), Dt7(->pc), Dt1(->base), Dt1(->base)); |
5388 | #if LJ_HASJIT | 5389 | #if LJ_HASJIT |
5389 | dasm_put(Dst, 796); | 5390 | dasm_put(Dst, 797); |
5390 | #endif | 5391 | #endif |
5391 | dasm_put(Dst, 798); | 5392 | dasm_put(Dst, 799); |
5392 | #if LJ_HASJIT | 5393 | #if LJ_HASJIT |
5393 | dasm_put(Dst, 800, BC_JFORI); | 5394 | dasm_put(Dst, 801, BC_JFORI); |
5394 | #endif | 5395 | #endif |
5395 | dasm_put(Dst, 803); | 5396 | dasm_put(Dst, 804); |
5396 | #if LJ_HASJIT | 5397 | #if LJ_HASJIT |
5397 | dasm_put(Dst, 805, BC_JFORI); | 5398 | dasm_put(Dst, 806, BC_JFORI); |
5398 | #endif | 5399 | #endif |
5399 | dasm_put(Dst, 808, BC_FORI, ~LJ_TNUMX, 31-3, Dt8(->upvalue), Dt6(->metatable), DISPATCH_GL(gcroot[GCROOT_MMNAME+MM_metatable])); | 5400 | dasm_put(Dst, 809, BC_FORI, ~LJ_TNUMX, 31-3, Dt8(->upvalue), Dt6(->metatable), DISPATCH_GL(gcroot[GCROOT_MMNAME+MM_metatable])); |
5400 | dasm_put(Dst, 873, Dt6(->hmask), Dt5(->hash), Dt6(->node), 31-5, 31-3, DtB(->key), DtB(->val), DtB(->next), LJ_TUDATA, 31-2, 4*~LJ_TNUMX, DISPATCH_GL(gcroot[GCROOT_BASEMT])); | 5401 | dasm_put(Dst, 874, Dt6(->hmask), Dt5(->hash), Dt6(->node), 31-5, 31-3, DtB(->key), DtB(->val), DtB(->next), LJ_TUDATA, 31-2, 4*~LJ_TNUMX, DISPATCH_GL(gcroot[GCROOT_BASEMT])); |
5401 | dasm_put(Dst, 929, Dt6(->metatable), Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); | 5402 | dasm_put(Dst, 930, Dt6(->metatable), Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); |
5402 | dasm_put(Dst, 989, DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM]), Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->top), (2+1)*8); | 5403 | dasm_put(Dst, 990, DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM]), Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->top), (2+1)*8); |
5403 | #ifdef LUAJIT_ENABLE_LUA52COMPAT | 5404 | #ifdef LUAJIT_ENABLE_LUA52COMPAT |
5404 | dasm_put(Dst, 1062, Dt6(->metatable), Dt8(->upvalue[0])); | 5405 | dasm_put(Dst, 1063, Dt6(->metatable), Dt8(->upvalue[0])); |
5405 | #else | 5406 | #else |
5406 | dasm_put(Dst, 1071, Dt8(->upvalue[0])); | 5407 | dasm_put(Dst, 1072, Dt8(->upvalue[0])); |
5407 | #endif | 5408 | #endif |
5408 | dasm_put(Dst, 1075, (3+1)*8, Dt6(->asize), Dt6(->array), 31-3, (0+1)*8, (2+1)*8, Dt6(->hmask), (0+1)*8, (0+1)*8); | 5409 | dasm_put(Dst, 1076, (3+1)*8, Dt6(->asize), Dt6(->array), 31-3, (0+1)*8, (2+1)*8, Dt6(->hmask), (0+1)*8, (0+1)*8); |
5409 | dasm_put(Dst, 1139); | 5410 | dasm_put(Dst, 1140); |
5410 | #ifdef LUAJIT_ENABLE_LUA52COMPAT | 5411 | #ifdef LUAJIT_ENABLE_LUA52COMPAT |
5411 | dasm_put(Dst, 1152, Dt6(->metatable), Dt8(->upvalue[0])); | 5412 | dasm_put(Dst, 1153, Dt6(->metatable), Dt8(->upvalue[0])); |
5412 | #else | 5413 | #else |
5413 | dasm_put(Dst, 1161, Dt8(->upvalue[0])); | 5414 | dasm_put(Dst, 1162, Dt8(->upvalue[0])); |
5414 | #endif | 5415 | #endif |
5415 | dasm_put(Dst, 1165, (3+1)*8, DISPATCH_GL(hookmask), 32-HOOK_ACTIVE_SHIFT, 8+FRAME_PCALL, DISPATCH_GL(hookmask), 32-HOOK_ACTIVE_SHIFT, 16+FRAME_PCALL, LJ_TTHREAD, Dt1(->status), Dt1(->cframe), Dt1(->top)); | 5416 | dasm_put(Dst, 1166, (3+1)*8, DISPATCH_GL(hookmask), 32-HOOK_ACTIVE_SHIFT, 8+FRAME_PCALL, DISPATCH_GL(hookmask), 32-HOOK_ACTIVE_SHIFT, 16+FRAME_PCALL, LJ_TTHREAD, Dt1(->status), Dt1(->cframe), Dt1(->top)); |
5416 | dasm_put(Dst, 1226, LUA_YIELD, Dt1(->base), Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->top), Dt1(->base), LUA_YIELD, Dt1(->top), ~LJ_VMST_INTERP, Dt1(->base), DISPATCH_GL(vmstate), Dt1(->maxstack)); | 5417 | dasm_put(Dst, 1227, LUA_YIELD, Dt1(->base), Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->top), Dt1(->base), LUA_YIELD, Dt1(->top), ~LJ_VMST_INTERP, Dt1(->base), DISPATCH_GL(vmstate), Dt1(->maxstack)); |
5417 | dasm_put(Dst, 1289, Dt1(->top), FRAME_TYPE, LJ_TTRUE, FRAME_TYPE, LJ_TFALSE, Dt1(->top), (2+1)*8, 32-3); | 5418 | dasm_put(Dst, 1290, Dt1(->top), FRAME_TYPE, LJ_TTRUE, FRAME_TYPE, LJ_TFALSE, Dt1(->top), (2+1)*8, 32-3); |
5418 | dasm_put(Dst, 1349, Dt8(->upvalue[0].gcr), Dt1(->status), Dt1(->cframe), Dt1(->top), LUA_YIELD, Dt1(->base), Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->top), Dt1(->base), LUA_YIELD, Dt1(->top), ~LJ_VMST_INTERP); | 5419 | dasm_put(Dst, 1350, Dt8(->upvalue[0].gcr), Dt1(->status), Dt1(->cframe), Dt1(->top), LUA_YIELD, Dt1(->base), Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->top), Dt1(->base), LUA_YIELD, Dt1(->top), ~LJ_VMST_INTERP); |
5419 | dasm_put(Dst, 1408, Dt1(->base), DISPATCH_GL(vmstate), Dt1(->maxstack), Dt1(->top), FRAME_TYPE, 32-3, Dt1(->cframe)); | 5420 | dasm_put(Dst, 1409, Dt1(->base), DISPATCH_GL(vmstate), Dt1(->maxstack), Dt1(->top), FRAME_TYPE, 32-3, Dt1(->cframe)); |
5420 | dasm_put(Dst, 1465, Dt1(->base), CFRAME_RESUME, Dt1(->top), LUA_YIELD, Dt1(->cframe), Dt1(->status), (1+1)*8, FRAME_TYPE); | 5421 | dasm_put(Dst, 1466, Dt1(->base), CFRAME_RESUME, Dt1(->top), LUA_YIELD, Dt1(->cframe), Dt1(->status), (1+1)*8, FRAME_TYPE); |
5421 | dasm_put(Dst, 1530); | 5422 | dasm_put(Dst, 1531); |
5422 | dasm_put(Dst, 1599); | 5423 | dasm_put(Dst, 1600); |
5423 | dasm_put(Dst, 1662); | 5424 | dasm_put(Dst, 1663); |
5424 | dasm_put(Dst, 1727); | 5425 | dasm_put(Dst, 1728); |
5425 | dasm_put(Dst, 1797, Dt8(->upvalue[0]), DISPATCH_GL(tmptv), DISPATCH_GL(tmptv), (2+1)*8, (2+1)*8); | 5426 | dasm_put(Dst, 1798, Dt8(->upvalue[0]), DISPATCH_GL(tmptv), DISPATCH_GL(tmptv), (2+1)*8, (2+1)*8); |
5426 | dasm_put(Dst, 1869, Dt5(->len)); | 5427 | dasm_put(Dst, 1870, Dt5(->len)); |
5427 | dasm_put(Dst, 1936, Dt5(->len), (0+1)*8, Dt5([1]), (1+1)*8, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), DISPATCH_GL(tmptv), Dt1(->base), Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold)); | 5428 | dasm_put(Dst, 1937, Dt5(->len), (0+1)*8, Dt5([1]), (1+1)*8, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), DISPATCH_GL(tmptv), Dt1(->base), Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold)); |
5428 | dasm_put(Dst, 1996, Dt5(->len), sizeof(GCstr)-1, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold)); | 5429 | dasm_put(Dst, 1997, Dt5(->len), sizeof(GCstr)-1, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold)); |
5429 | dasm_put(Dst, 2062, Dt5(->len), DISPATCH_GL(tmpbuf.sz), Dt5([1]), DISPATCH_GL(tmpbuf.buf), DISPATCH_GL(strempty), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold)); | 5430 | dasm_put(Dst, 2063, Dt5(->len), DISPATCH_GL(tmpbuf.sz), Dt5([1]), DISPATCH_GL(tmpbuf.buf), DISPATCH_GL(strempty), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold)); |
5430 | dasm_put(Dst, 2121, DISPATCH_GL(tmpbuf.sz), Dt5(->len), sizeof(GCstr), DISPATCH_GL(tmpbuf.buf), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), DISPATCH_GL(tmpbuf.sz), Dt5(->len), sizeof(GCstr), DISPATCH_GL(tmpbuf.buf)); | 5431 | dasm_put(Dst, 2122, DISPATCH_GL(tmpbuf.sz), Dt5(->len), sizeof(GCstr), DISPATCH_GL(tmpbuf.buf), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), DISPATCH_GL(tmpbuf.sz), Dt5(->len), sizeof(GCstr), DISPATCH_GL(tmpbuf.buf)); |
5431 | dasm_put(Dst, 2180, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), DISPATCH_GL(tmpbuf.sz), Dt5(->len), sizeof(GCstr), DISPATCH_GL(tmpbuf.buf)); | 5432 | dasm_put(Dst, 2181, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), DISPATCH_GL(tmpbuf.sz), Dt5(->len), sizeof(GCstr), DISPATCH_GL(tmpbuf.buf)); |
5432 | dasm_put(Dst, 2247); | 5433 | dasm_put(Dst, 2248); |
5433 | dasm_put(Dst, 2318); | 5434 | dasm_put(Dst, 2319); |
5434 | dasm_put(Dst, 2406, Dt8(->f), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), 31-3, Dt1(->top), Dt7(->pc)); | 5435 | dasm_put(Dst, 2407, Dt8(->f), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), 31-3, Dt1(->top), Dt7(->pc)); |
5435 | dasm_put(Dst, 2485, FRAME_TYPE, LUA_MINSTACK, Dt1(->base), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); | 5436 | dasm_put(Dst, 2486, FRAME_TYPE, LUA_MINSTACK, Dt1(->base), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); |
5436 | #if LJ_HASJIT | 5437 | #if LJ_HASJIT |
5437 | dasm_put(Dst, 2527); | 5438 | dasm_put(Dst, 2528); |
5438 | #endif | 5439 | #endif |
5439 | dasm_put(Dst, 2529, DISPATCH_GL(hookmask), HOOK_ACTIVE, GG_DISP2STATIC, DISPATCH_GL(hookmask), DISPATCH_GL(hookcount), HOOK_ACTIVE, 31-LUA_HOOKLINE, DISPATCH_GL(hookcount), Dt1(->base), Dt1(->base)); | 5440 | dasm_put(Dst, 2530, DISPATCH_GL(hookmask), HOOK_ACTIVE, GG_DISP2STATIC, DISPATCH_GL(hookmask), DISPATCH_GL(hookcount), HOOK_ACTIVE, 31-LUA_HOOKLINE, DISPATCH_GL(hookcount), Dt1(->base), Dt1(->base)); |
5440 | dasm_put(Dst, 2576, GG_DISP2STATIC); | 5441 | dasm_put(Dst, 2577, GG_DISP2STATIC); |
5441 | #if LJ_HASJIT | 5442 | #if LJ_HASJIT |
5442 | dasm_put(Dst, 2594); | 5443 | dasm_put(Dst, 2595); |
5443 | #endif | 5444 | #endif |
5444 | dasm_put(Dst, 2596); | 5445 | dasm_put(Dst, 2597); |
5445 | #if LJ_HASJIT | 5446 | #if LJ_HASJIT |
5446 | dasm_put(Dst, 2599); | 5447 | dasm_put(Dst, 2600); |
5447 | #endif | 5448 | #endif |
5448 | dasm_put(Dst, 2602); | 5449 | dasm_put(Dst, 2603); |
5449 | #if LJ_HASJIT | 5450 | #if LJ_HASJIT |
5450 | dasm_put(Dst, 2604); | 5451 | dasm_put(Dst, 2605); |
5451 | #endif | 5452 | #endif |
5452 | dasm_put(Dst, 2607, Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); | 5453 | dasm_put(Dst, 2608, Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); |
5453 | #if LJ_HASJIT | 5454 | #if LJ_HASJIT |
5454 | dasm_put(Dst, 2629); | 5455 | dasm_put(Dst, 2630); |
5455 | #endif | 5456 | #endif |
5456 | dasm_put(Dst, 2631); | 5457 | dasm_put(Dst, 2632); |
5457 | #if LJ_HASJIT | 5458 | #if LJ_HASJIT |
5458 | dasm_put(Dst, 2633); | 5459 | dasm_put(Dst, 2634); |
5459 | #endif | 5460 | #endif |
5460 | dasm_put(Dst, 2635); | 5461 | dasm_put(Dst, 2636); |
5461 | #if LJ_HASJIT | 5462 | #if LJ_HASJIT |
5462 | dasm_put(Dst, 2719); | 5463 | dasm_put(Dst, 2720); |
5463 | #else | 5464 | #else |
5464 | dasm_put(Dst, 2742); | 5465 | dasm_put(Dst, 2743); |
5465 | #endif | 5466 | #endif |
5466 | dasm_put(Dst, 2745); | 5467 | dasm_put(Dst, 2746); |
5467 | #if LJ_HASJIT | 5468 | #if LJ_HASJIT |
5468 | dasm_put(Dst, 2747); | 5469 | dasm_put(Dst, 2748); |
5469 | #endif | 5470 | #endif |
5470 | dasm_put(Dst, 2749); | 5471 | dasm_put(Dst, 2750); |
5471 | #if LJ_HASJIT | 5472 | #if LJ_HASJIT |
5472 | dasm_put(Dst, 2751); | 5473 | dasm_put(Dst, 2752); |
5473 | #endif | 5474 | #endif |
5474 | dasm_put(Dst, 2753); | 5475 | dasm_put(Dst, 2754); |
5475 | #if LJ_HASFFI | 5476 | #if LJ_HASFFI |
5476 | dasm_put(Dst, 2816); | 5477 | dasm_put(Dst, 2817); |
5477 | #endif | 5478 | #endif |
5478 | } | 5479 | } |
5479 | 5480 | ||
@@ -5481,7 +5482,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
5481 | static void build_ins(BuildCtx *ctx, BCOp op, int defop) | 5482 | static void build_ins(BuildCtx *ctx, BCOp op, int defop) |
5482 | { | 5483 | { |
5483 | int vk = 0; | 5484 | int vk = 0; |
5484 | dasm_put(Dst, 2818, defop); | 5485 | dasm_put(Dst, 2819, defop); |
5485 | 5486 | ||
5486 | switch (op) { | 5487 | switch (op) { |
5487 | 5488 | ||
@@ -5490,118 +5491,118 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
5490 | /* Remember: all ops branch for a true comparison, fall through otherwise. */ | 5491 | /* Remember: all ops branch for a true comparison, fall through otherwise. */ |
5491 | 5492 | ||
5492 | case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: | 5493 | case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: |
5493 | dasm_put(Dst, 2820, -(BCBIAS_J*4 >> 16)); | 5494 | dasm_put(Dst, 2821, -(BCBIAS_J*4 >> 16)); |
5494 | if (op == BC_ISLE || op == BC_ISGT) { | 5495 | if (op == BC_ISLE || op == BC_ISGT) { |
5495 | dasm_put(Dst, 2834); | 5496 | dasm_put(Dst, 2835); |
5496 | } | 5497 | } |
5497 | if (op == BC_ISLT || op == BC_ISLE) { | 5498 | if (op == BC_ISLT || op == BC_ISLE) { |
5498 | dasm_put(Dst, 2837); | 5499 | dasm_put(Dst, 2838); |
5499 | } else { | 5500 | } else { |
5500 | dasm_put(Dst, 2839); | 5501 | dasm_put(Dst, 2840); |
5501 | } | 5502 | } |
5502 | dasm_put(Dst, 2841); | 5503 | dasm_put(Dst, 2842); |
5503 | break; | 5504 | break; |
5504 | 5505 | ||
5505 | case BC_ISEQV: case BC_ISNEV: | 5506 | case BC_ISEQV: case BC_ISNEV: |
5506 | vk = op == BC_ISEQV; | 5507 | vk = op == BC_ISEQV; |
5507 | dasm_put(Dst, 2852, -(BCBIAS_J*4 >> 16)); | 5508 | dasm_put(Dst, 2853, -(BCBIAS_J*4 >> 16)); |
5508 | if (vk) { | 5509 | if (vk) { |
5509 | dasm_put(Dst, 2866); | 5510 | dasm_put(Dst, 2867); |
5510 | } else { | 5511 | } else { |
5511 | dasm_put(Dst, 2868); | 5512 | dasm_put(Dst, 2869); |
5512 | } | 5513 | } |
5513 | dasm_put(Dst, 2870, ~LJ_TISPRI, ~LJ_TISTABUD); | 5514 | dasm_put(Dst, 2871, ~LJ_TISPRI, ~LJ_TISTABUD); |
5514 | if (vk) { | 5515 | if (vk) { |
5515 | dasm_put(Dst, 2892); | 5516 | dasm_put(Dst, 2893); |
5516 | } else { | 5517 | } else { |
5517 | dasm_put(Dst, 2894); | 5518 | dasm_put(Dst, 2895); |
5518 | } | 5519 | } |
5519 | dasm_put(Dst, 2896); | 5520 | dasm_put(Dst, 2897); |
5520 | if (vk) { | 5521 | if (vk) { |
5521 | dasm_put(Dst, 2898); | 5522 | dasm_put(Dst, 2899); |
5522 | } else { | 5523 | } else { |
5523 | dasm_put(Dst, 2900); | 5524 | dasm_put(Dst, 2901); |
5524 | } | 5525 | } |
5525 | dasm_put(Dst, 2902, Dt6(->metatable), 1-vk, Dt6(->nomm), 1<<MM_eq); | 5526 | dasm_put(Dst, 2903, Dt6(->metatable), 1-vk, Dt6(->nomm), 1<<MM_eq); |
5526 | break; | 5527 | break; |
5527 | 5528 | ||
5528 | case BC_ISEQS: case BC_ISNES: | 5529 | case BC_ISEQS: case BC_ISNES: |
5529 | vk = op == BC_ISEQS; | 5530 | vk = op == BC_ISEQS; |
5530 | dasm_put(Dst, 2923, 32-1, -(BCBIAS_J*4 >> 16)); | 5531 | dasm_put(Dst, 2924, 32-1, -(BCBIAS_J*4 >> 16)); |
5531 | if (vk) { | 5532 | if (vk) { |
5532 | dasm_put(Dst, 2937); | 5533 | dasm_put(Dst, 2938); |
5533 | } else { | 5534 | } else { |
5534 | dasm_put(Dst, 2939); | 5535 | dasm_put(Dst, 2940); |
5535 | } | 5536 | } |
5536 | dasm_put(Dst, 2941); | 5537 | dasm_put(Dst, 2942); |
5537 | break; | 5538 | break; |
5538 | 5539 | ||
5539 | case BC_ISEQN: case BC_ISNEN: | 5540 | case BC_ISEQN: case BC_ISNEN: |
5540 | vk = op == BC_ISEQN; | 5541 | vk = op == BC_ISEQN; |
5541 | dasm_put(Dst, 2952, -(BCBIAS_J*4 >> 16)); | 5542 | dasm_put(Dst, 2953, -(BCBIAS_J*4 >> 16)); |
5542 | if (vk) { | 5543 | if (vk) { |
5543 | dasm_put(Dst, 2966); | 5544 | dasm_put(Dst, 2967); |
5544 | } else { | 5545 | } else { |
5545 | dasm_put(Dst, 2969); | 5546 | dasm_put(Dst, 2970); |
5546 | } | 5547 | } |
5547 | dasm_put(Dst, 2971); | 5548 | dasm_put(Dst, 2972); |
5548 | if (!vk) { | 5549 | if (!vk) { |
5549 | dasm_put(Dst, 2983); | 5550 | dasm_put(Dst, 2984); |
5550 | } | 5551 | } |
5551 | break; | 5552 | break; |
5552 | 5553 | ||
5553 | case BC_ISEQP: case BC_ISNEP: | 5554 | case BC_ISEQP: case BC_ISNEP: |
5554 | vk = op == BC_ISEQP; | 5555 | vk = op == BC_ISEQP; |
5555 | dasm_put(Dst, 2989, 32-3, -(BCBIAS_J*4 >> 16)); | 5556 | dasm_put(Dst, 2990, 32-3, -(BCBIAS_J*4 >> 16)); |
5556 | if (vk) { | 5557 | if (vk) { |
5557 | dasm_put(Dst, 3001); | 5558 | dasm_put(Dst, 3002); |
5558 | } else { | 5559 | } else { |
5559 | dasm_put(Dst, 3003); | 5560 | dasm_put(Dst, 3004); |
5560 | } | 5561 | } |
5561 | dasm_put(Dst, 3005); | 5562 | dasm_put(Dst, 3006); |
5562 | break; | 5563 | break; |
5563 | 5564 | ||
5564 | /* -- Unary test and copy ops ------------------------------------------- */ | 5565 | /* -- Unary test and copy ops ------------------------------------------- */ |
5565 | 5566 | ||
5566 | case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: | 5567 | case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: |
5567 | dasm_put(Dst, 3016); | 5568 | dasm_put(Dst, 3017); |
5568 | if (op == BC_IST || op == BC_ISF) { | 5569 | if (op == BC_IST || op == BC_ISF) { |
5569 | dasm_put(Dst, 3022, -(BCBIAS_J*4 >> 16)); | 5570 | dasm_put(Dst, 3023, -(BCBIAS_J*4 >> 16)); |
5570 | if (op == BC_IST) { | 5571 | if (op == BC_IST) { |
5571 | dasm_put(Dst, 3027); | 5572 | dasm_put(Dst, 3028); |
5572 | } else { | 5573 | } else { |
5573 | dasm_put(Dst, 3029); | 5574 | dasm_put(Dst, 3030); |
5574 | } | 5575 | } |
5575 | } else { | 5576 | } else { |
5576 | if (op == BC_ISTC) { | 5577 | if (op == BC_ISTC) { |
5577 | dasm_put(Dst, 3031); | 5578 | dasm_put(Dst, 3032); |
5578 | } else { | 5579 | } else { |
5579 | dasm_put(Dst, 3034); | 5580 | dasm_put(Dst, 3035); |
5580 | } | 5581 | } |
5581 | dasm_put(Dst, 3037, -(BCBIAS_J*4 >> 16)); | 5582 | dasm_put(Dst, 3038, -(BCBIAS_J*4 >> 16)); |
5582 | } | 5583 | } |
5583 | dasm_put(Dst, 3044); | 5584 | dasm_put(Dst, 3045); |
5584 | break; | 5585 | break; |
5585 | 5586 | ||
5586 | /* -- Unary ops --------------------------------------------------------- */ | 5587 | /* -- Unary ops --------------------------------------------------------- */ |
5587 | 5588 | ||
5588 | case BC_MOV: | 5589 | case BC_MOV: |
5589 | dasm_put(Dst, 3055); | 5590 | dasm_put(Dst, 3056); |
5590 | break; | 5591 | break; |
5591 | case BC_NOT: | 5592 | case BC_NOT: |
5592 | dasm_put(Dst, 3068, LJ_TTRUE); | 5593 | dasm_put(Dst, 3069, LJ_TTRUE); |
5593 | break; | 5594 | break; |
5594 | case BC_UNM: | 5595 | case BC_UNM: |
5595 | dasm_put(Dst, 3084); | 5596 | dasm_put(Dst, 3085); |
5596 | break; | 5597 | break; |
5597 | case BC_LEN: | 5598 | case BC_LEN: |
5598 | dasm_put(Dst, 3101, Dt5(->len)); | 5599 | dasm_put(Dst, 3102, Dt5(->len)); |
5599 | #ifdef LUAJIT_ENABLE_LUA52COMPAT | 5600 | #ifdef LUAJIT_ENABLE_LUA52COMPAT |
5600 | dasm_put(Dst, 3125, Dt6(->metatable)); | 5601 | dasm_put(Dst, 3126, Dt6(->metatable)); |
5601 | #endif | 5602 | #endif |
5602 | dasm_put(Dst, 3132); | 5603 | dasm_put(Dst, 3133); |
5603 | #ifdef LUAJIT_ENABLE_LUA52COMPAT | 5604 | #ifdef LUAJIT_ENABLE_LUA52COMPAT |
5604 | dasm_put(Dst, 3138, Dt6(->nomm), 1<<MM_len); | 5605 | dasm_put(Dst, 3139, Dt6(->nomm), 1<<MM_len); |
5605 | #endif | 5606 | #endif |
5606 | break; | 5607 | break; |
5607 | 5608 | ||
@@ -5612,262 +5613,262 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
5612 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 5613 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
5613 | switch (vk) { | 5614 | switch (vk) { |
5614 | case 0: | 5615 | case 0: |
5615 | dasm_put(Dst, 3148); | 5616 | dasm_put(Dst, 3149); |
5616 | break; | 5617 | break; |
5617 | case 1: | 5618 | case 1: |
5618 | dasm_put(Dst, 3154); | 5619 | dasm_put(Dst, 3155); |
5619 | break; | 5620 | break; |
5620 | default: | 5621 | default: |
5621 | dasm_put(Dst, 3160); | 5622 | dasm_put(Dst, 3161); |
5622 | break; | 5623 | break; |
5623 | } | 5624 | } |
5624 | dasm_put(Dst, 3167); | 5625 | dasm_put(Dst, 3168); |
5625 | break; | 5626 | break; |
5626 | case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: | 5627 | case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: |
5627 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 5628 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
5628 | switch (vk) { | 5629 | switch (vk) { |
5629 | case 0: | 5630 | case 0: |
5630 | dasm_put(Dst, 3180); | 5631 | dasm_put(Dst, 3181); |
5631 | break; | 5632 | break; |
5632 | case 1: | 5633 | case 1: |
5633 | dasm_put(Dst, 3186); | 5634 | dasm_put(Dst, 3187); |
5634 | break; | 5635 | break; |
5635 | default: | 5636 | default: |
5636 | dasm_put(Dst, 3192); | 5637 | dasm_put(Dst, 3193); |
5637 | break; | 5638 | break; |
5638 | } | 5639 | } |
5639 | dasm_put(Dst, 3199); | 5640 | dasm_put(Dst, 3200); |
5640 | break; | 5641 | break; |
5641 | case BC_MULVN: case BC_MULNV: case BC_MULVV: | 5642 | case BC_MULVN: case BC_MULNV: case BC_MULVV: |
5642 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 5643 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
5643 | switch (vk) { | 5644 | switch (vk) { |
5644 | case 0: | 5645 | case 0: |
5645 | dasm_put(Dst, 3212); | 5646 | dasm_put(Dst, 3213); |
5646 | break; | 5647 | break; |
5647 | case 1: | 5648 | case 1: |
5648 | dasm_put(Dst, 3218); | 5649 | dasm_put(Dst, 3219); |
5649 | break; | 5650 | break; |
5650 | default: | 5651 | default: |
5651 | dasm_put(Dst, 3224); | 5652 | dasm_put(Dst, 3225); |
5652 | break; | 5653 | break; |
5653 | } | 5654 | } |
5654 | dasm_put(Dst, 3231); | 5655 | dasm_put(Dst, 3232); |
5655 | break; | 5656 | break; |
5656 | case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: | 5657 | case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: |
5657 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 5658 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
5658 | switch (vk) { | 5659 | switch (vk) { |
5659 | case 0: | 5660 | case 0: |
5660 | dasm_put(Dst, 3244); | 5661 | dasm_put(Dst, 3245); |
5661 | break; | 5662 | break; |
5662 | case 1: | 5663 | case 1: |
5663 | dasm_put(Dst, 3250); | 5664 | dasm_put(Dst, 3251); |
5664 | break; | 5665 | break; |
5665 | default: | 5666 | default: |
5666 | dasm_put(Dst, 3256); | 5667 | dasm_put(Dst, 3257); |
5667 | break; | 5668 | break; |
5668 | } | 5669 | } |
5669 | dasm_put(Dst, 3263); | 5670 | dasm_put(Dst, 3264); |
5670 | break; | 5671 | break; |
5671 | case BC_MODVN: | 5672 | case BC_MODVN: |
5672 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 5673 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
5673 | switch (vk) { | 5674 | switch (vk) { |
5674 | case 0: | 5675 | case 0: |
5675 | dasm_put(Dst, 3276); | 5676 | dasm_put(Dst, 3277); |
5676 | break; | 5677 | break; |
5677 | case 1: | 5678 | case 1: |
5678 | dasm_put(Dst, 3282); | 5679 | dasm_put(Dst, 3283); |
5679 | break; | 5680 | break; |
5680 | default: | 5681 | default: |
5681 | dasm_put(Dst, 3288); | 5682 | dasm_put(Dst, 3289); |
5682 | break; | 5683 | break; |
5683 | } | 5684 | } |
5684 | dasm_put(Dst, 3295); | 5685 | dasm_put(Dst, 3296); |
5685 | break; | 5686 | break; |
5686 | case BC_MODNV: case BC_MODVV: | 5687 | case BC_MODNV: case BC_MODVV: |
5687 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 5688 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
5688 | switch (vk) { | 5689 | switch (vk) { |
5689 | case 0: | 5690 | case 0: |
5690 | dasm_put(Dst, 3313); | 5691 | dasm_put(Dst, 3314); |
5691 | break; | 5692 | break; |
5692 | case 1: | 5693 | case 1: |
5693 | dasm_put(Dst, 3319); | 5694 | dasm_put(Dst, 3320); |
5694 | break; | 5695 | break; |
5695 | default: | 5696 | default: |
5696 | dasm_put(Dst, 3325); | 5697 | dasm_put(Dst, 3326); |
5697 | break; | 5698 | break; |
5698 | } | 5699 | } |
5699 | dasm_put(Dst, 3332); | 5700 | dasm_put(Dst, 3333); |
5700 | break; | 5701 | break; |
5701 | case BC_POW: | 5702 | case BC_POW: |
5702 | dasm_put(Dst, 3335); | 5703 | dasm_put(Dst, 3336); |
5703 | break; | 5704 | break; |
5704 | 5705 | ||
5705 | case BC_CAT: | 5706 | case BC_CAT: |
5706 | dasm_put(Dst, 3357, Dt1(->base), 32-3, Dt1(->base)); | 5707 | dasm_put(Dst, 3358, Dt1(->base), 32-3, Dt1(->base)); |
5707 | break; | 5708 | break; |
5708 | 5709 | ||
5709 | /* -- Constant ops ------------------------------------------------------ */ | 5710 | /* -- Constant ops ------------------------------------------------------ */ |
5710 | 5711 | ||
5711 | case BC_KSTR: | 5712 | case BC_KSTR: |
5712 | dasm_put(Dst, 3387, 32-1); | 5713 | dasm_put(Dst, 3388, 32-1); |
5713 | break; | 5714 | break; |
5714 | case BC_KCDATA: | 5715 | case BC_KCDATA: |
5715 | #if LJ_HASFFI | 5716 | #if LJ_HASFFI |
5716 | dasm_put(Dst, 3404, 32-1, LJ_TCDATA); | 5717 | dasm_put(Dst, 3405, 32-1, LJ_TCDATA); |
5717 | #endif | 5718 | #endif |
5718 | break; | 5719 | break; |
5719 | case BC_KSHORT: | 5720 | case BC_KSHORT: |
5720 | dasm_put(Dst, 3423, 32-3); | 5721 | dasm_put(Dst, 3424, 32-3); |
5721 | break; | 5722 | break; |
5722 | case BC_KNUM: | 5723 | case BC_KNUM: |
5723 | dasm_put(Dst, 3439); | 5724 | dasm_put(Dst, 3440); |
5724 | break; | 5725 | break; |
5725 | case BC_KPRI: | 5726 | case BC_KPRI: |
5726 | dasm_put(Dst, 3452, 32-3); | 5727 | dasm_put(Dst, 3453, 32-3); |
5727 | break; | 5728 | break; |
5728 | case BC_KNIL: | 5729 | case BC_KNIL: |
5729 | dasm_put(Dst, 3467); | 5730 | dasm_put(Dst, 3468); |
5730 | break; | 5731 | break; |
5731 | 5732 | ||
5732 | /* -- Upvalue and function ops ------------------------------------------ */ | 5733 | /* -- Upvalue and function ops ------------------------------------------ */ |
5733 | 5734 | ||
5734 | case BC_UGET: | 5735 | case BC_UGET: |
5735 | dasm_put(Dst, 3486, 32-1, offsetof(GCfuncL, uvptr), DtA(->v)); | 5736 | dasm_put(Dst, 3487, 32-1, offsetof(GCfuncL, uvptr), DtA(->v)); |
5736 | break; | 5737 | break; |
5737 | case BC_USETV: | 5738 | case BC_USETV: |
5738 | dasm_put(Dst, 3507, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, DtA(->closed), -(LJ_TISNUM+1), LJ_TISGCV - (LJ_TISNUM+1), Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G); | 5739 | dasm_put(Dst, 3508, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, DtA(->closed), -(LJ_TISNUM+1), LJ_TISGCV - (LJ_TISNUM+1), Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G); |
5739 | break; | 5740 | break; |
5740 | case BC_USETS: | 5741 | case BC_USETS: |
5741 | dasm_put(Dst, 3559, 32-1, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, Dt5(->marked), DtA(->closed), LJ_GC_WHITES, GG_DISP2G); | 5742 | dasm_put(Dst, 3560, 32-1, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, Dt5(->marked), DtA(->closed), LJ_GC_WHITES, GG_DISP2G); |
5742 | break; | 5743 | break; |
5743 | case BC_USETN: | 5744 | case BC_USETN: |
5744 | dasm_put(Dst, 3608, 32-1, offsetof(GCfuncL, uvptr), DtA(->v)); | 5745 | dasm_put(Dst, 3609, 32-1, offsetof(GCfuncL, uvptr), DtA(->v)); |
5745 | break; | 5746 | break; |
5746 | case BC_USETP: | 5747 | case BC_USETP: |
5747 | dasm_put(Dst, 3629, 32-1, offsetof(GCfuncL, uvptr), 32-3, DtA(->v)); | 5748 | dasm_put(Dst, 3630, 32-1, offsetof(GCfuncL, uvptr), 32-3, DtA(->v)); |
5748 | break; | 5749 | break; |
5749 | 5750 | ||
5750 | case BC_UCLO: | 5751 | case BC_UCLO: |
5751 | dasm_put(Dst, 3652, Dt1(->openupval), 32-1, -(BCBIAS_J*4 >> 16), Dt1(->base), Dt1(->base)); | 5752 | dasm_put(Dst, 3653, Dt1(->openupval), 32-1, -(BCBIAS_J*4 >> 16), Dt1(->base), Dt1(->base)); |
5752 | break; | 5753 | break; |
5753 | 5754 | ||
5754 | case BC_FNEW: | 5755 | case BC_FNEW: |
5755 | dasm_put(Dst, 3682, 32-1, Dt1(->base), Dt1(->base)); | 5756 | dasm_put(Dst, 3683, 32-1, Dt1(->base), Dt1(->base)); |
5756 | break; | 5757 | break; |
5757 | 5758 | ||
5758 | /* -- Table ops --------------------------------------------------------- */ | 5759 | /* -- Table ops --------------------------------------------------------- */ |
5759 | 5760 | ||
5760 | case BC_TNEW: | 5761 | case BC_TNEW: |
5761 | case BC_TDUP: | 5762 | case BC_TDUP: |
5762 | dasm_put(Dst, 3708, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base)); | 5763 | dasm_put(Dst, 3709, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base)); |
5763 | if (op == BC_TNEW) { | 5764 | if (op == BC_TNEW) { |
5764 | dasm_put(Dst, 3721); | 5765 | dasm_put(Dst, 3722); |
5765 | } else { | 5766 | } else { |
5766 | dasm_put(Dst, 3729, 32-1); | 5767 | dasm_put(Dst, 3730, 32-1); |
5767 | } | 5768 | } |
5768 | dasm_put(Dst, 3736, Dt1(->base)); | 5769 | dasm_put(Dst, 3737, Dt1(->base)); |
5769 | break; | 5770 | break; |
5770 | 5771 | ||
5771 | case BC_GGET: | 5772 | case BC_GGET: |
5772 | case BC_GSET: | 5773 | case BC_GSET: |
5773 | dasm_put(Dst, 3759, 32-1, Dt7(->env)); | 5774 | dasm_put(Dst, 3760, 32-1, Dt7(->env)); |
5774 | if (op == BC_GGET) { | 5775 | if (op == BC_GGET) { |
5775 | dasm_put(Dst, 3767); | 5776 | dasm_put(Dst, 3768); |
5776 | } else { | 5777 | } else { |
5777 | dasm_put(Dst, 3770); | 5778 | dasm_put(Dst, 3771); |
5778 | } | 5779 | } |
5779 | break; | 5780 | break; |
5780 | 5781 | ||
5781 | case BC_TGETV: | 5782 | case BC_TGETV: |
5782 | dasm_put(Dst, 3773, Dt6(->asize), Dt6(->array), 31-3, Dt6(->metatable), Dt6(->nomm), 1<<MM_index); | 5783 | dasm_put(Dst, 3774, Dt6(->asize), Dt6(->array), 31-3, Dt6(->metatable), Dt6(->nomm), 1<<MM_index); |
5783 | break; | 5784 | break; |
5784 | case BC_TGETS: | 5785 | case BC_TGETS: |
5785 | dasm_put(Dst, 3831, 32-1, Dt6(->hmask), Dt5(->hash), Dt6(->node), 31-5, 31-3, DtB(->key), DtB(->val), DtB(->next), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); | 5786 | dasm_put(Dst, 3832, 32-1, Dt6(->hmask), Dt5(->hash), Dt6(->node), 31-5, 31-3, DtB(->key), DtB(->val), DtB(->next), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); |
5786 | dasm_put(Dst, 3895); | 5787 | dasm_put(Dst, 3896); |
5787 | break; | 5788 | break; |
5788 | case BC_TGETB: | 5789 | case BC_TGETB: |
5789 | dasm_put(Dst, 3900, 32-3, Dt6(->asize), Dt6(->array), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); | 5790 | dasm_put(Dst, 3901, 32-3, Dt6(->asize), Dt6(->array), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); |
5790 | break; | 5791 | break; |
5791 | 5792 | ||
5792 | case BC_TSETV: | 5793 | case BC_TSETV: |
5793 | dasm_put(Dst, 3944, Dt6(->asize), Dt6(->array), 31-3, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex); | 5794 | dasm_put(Dst, 3945, Dt6(->asize), Dt6(->array), 31-3, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex); |
5794 | dasm_put(Dst, 4011, DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); | 5795 | dasm_put(Dst, 4012, DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); |
5795 | break; | 5796 | break; |
5796 | case BC_TSETS: | 5797 | case BC_TSETS: |
5797 | dasm_put(Dst, 4023, 32-1, Dt6(->hmask), Dt5(->hash), Dt6(->node), Dt6(->nomm), 31-5, 31-3, Dt6(->marked), DtB(->key), DtB(->val), LJ_GC_BLACK, DtB(->val), Dt6(->metatable)); | 5798 | dasm_put(Dst, 4024, 32-1, Dt6(->hmask), Dt5(->hash), Dt6(->node), Dt6(->nomm), 31-5, 31-3, Dt6(->marked), DtB(->key), DtB(->val), LJ_GC_BLACK, DtB(->val), Dt6(->metatable)); |
5798 | dasm_put(Dst, 4084, Dt6(->nomm), 1<<MM_newindex, DtB(->next), Dt6(->metatable), DISPATCH_GL(tmptv), Dt1(->base), Dt6(->nomm), 1<<MM_newindex, Dt1(->base), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain)); | 5799 | dasm_put(Dst, 4085, Dt6(->nomm), 1<<MM_newindex, DtB(->next), Dt6(->metatable), DISPATCH_GL(tmptv), Dt1(->base), Dt6(->nomm), 1<<MM_newindex, Dt1(->base), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain)); |
5799 | dasm_put(Dst, 4135, Dt6(->marked), Dt6(->gclist)); | 5800 | dasm_put(Dst, 4136, Dt6(->marked), Dt6(->gclist)); |
5800 | break; | 5801 | break; |
5801 | case BC_TSETB: | 5802 | case BC_TSETB: |
5802 | dasm_put(Dst, 4142, 32-3, Dt6(->asize), Dt6(->array), Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked)); | 5803 | dasm_put(Dst, 4143, 32-3, Dt6(->asize), Dt6(->array), Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked)); |
5803 | dasm_put(Dst, 4202, Dt6(->gclist)); | 5804 | dasm_put(Dst, 4203, Dt6(->gclist)); |
5804 | break; | 5805 | break; |
5805 | 5806 | ||
5806 | case BC_TSETM: | 5807 | case BC_TSETM: |
5807 | dasm_put(Dst, 4207, 32-3, Dt6(->asize), 31-3, Dt6(->marked), Dt6(->array), LJ_GC_BLACK, Dt1(->base), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); | 5808 | dasm_put(Dst, 4208, 32-3, Dt6(->asize), 31-3, Dt6(->marked), Dt6(->array), LJ_GC_BLACK, Dt1(->base), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); |
5808 | dasm_put(Dst, 4276); | 5809 | dasm_put(Dst, 4277); |
5809 | break; | 5810 | break; |
5810 | 5811 | ||
5811 | /* -- Calls and vararg handling ----------------------------------------- */ | 5812 | /* -- Calls and vararg handling ----------------------------------------- */ |
5812 | 5813 | ||
5813 | case BC_CALLM: | 5814 | case BC_CALLM: |
5814 | dasm_put(Dst, 4279); | 5815 | dasm_put(Dst, 4280); |
5815 | break; | 5816 | break; |
5816 | case BC_CALL: | 5817 | case BC_CALL: |
5817 | dasm_put(Dst, 4281, Dt7(->pc)); | 5818 | dasm_put(Dst, 4282, Dt7(->pc)); |
5818 | break; | 5819 | break; |
5819 | 5820 | ||
5820 | case BC_CALLMT: | 5821 | case BC_CALLMT: |
5821 | dasm_put(Dst, 4301); | 5822 | dasm_put(Dst, 4302); |
5822 | break; | 5823 | break; |
5823 | case BC_CALLT: | 5824 | case BC_CALLT: |
5824 | dasm_put(Dst, 4303, FRAME_TYPE, Dt7(->ffid), FRAME_VARG, Dt7(->pc), -4-8, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP); | 5825 | dasm_put(Dst, 4304, FRAME_TYPE, Dt7(->ffid), FRAME_VARG, Dt7(->pc), -4-8, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP); |
5825 | dasm_put(Dst, 4368, FRAME_TYPE); | 5826 | dasm_put(Dst, 4369, FRAME_TYPE); |
5826 | break; | 5827 | break; |
5827 | 5828 | ||
5828 | case BC_ITERC: | 5829 | case BC_ITERC: |
5829 | dasm_put(Dst, 4375, Dt7(->pc)); | 5830 | dasm_put(Dst, 4376, Dt7(->pc)); |
5830 | break; | 5831 | break; |
5831 | 5832 | ||
5832 | case BC_ITERN: | 5833 | case BC_ITERN: |
5833 | #if LJ_HASJIT | 5834 | #if LJ_HASJIT |
5834 | #endif | 5835 | #endif |
5835 | dasm_put(Dst, 4401, Dt6(->asize), Dt6(->array), 31-3, -(BCBIAS_J*4 >> 16), Dt6(->hmask), Dt6(->node), 31-5, 31-3, DtB(->key), -(BCBIAS_J*4 >> 16)); | 5836 | dasm_put(Dst, 4402, Dt6(->asize), Dt6(->array), 31-3, -(BCBIAS_J*4 >> 16), Dt6(->hmask), Dt6(->node), 31-5, 31-3, DtB(->key), -(BCBIAS_J*4 >> 16)); |
5836 | dasm_put(Dst, 4480); | 5837 | dasm_put(Dst, 4481); |
5837 | break; | 5838 | break; |
5838 | 5839 | ||
5839 | case BC_ISNEXT: | 5840 | case BC_ISNEXT: |
5840 | dasm_put(Dst, 4484, LJ_TTAB, LJ_TFUNC, LJ_TNIL, Dt8(->ffid), FF_next_N, 32-1, -(BCBIAS_J*4 >> 16), BC_JMP, BC_ITERC, -(BCBIAS_J*4 >> 16)); | 5841 | dasm_put(Dst, 4485, LJ_TTAB, LJ_TFUNC, LJ_TNIL, Dt8(->ffid), FF_next_N, 32-1, -(BCBIAS_J*4 >> 16), BC_JMP, BC_ITERC, -(BCBIAS_J*4 >> 16)); |
5841 | break; | 5842 | break; |
5842 | 5843 | ||
5843 | case BC_VARG: | 5844 | case BC_VARG: |
5844 | dasm_put(Dst, 4535, FRAME_VARG, Dt1(->maxstack), Dt1(->top), Dt1(->base), 32-3, Dt1(->base)); | 5845 | dasm_put(Dst, 4536, FRAME_VARG, Dt1(->maxstack), Dt1(->top), Dt1(->base), 32-3, Dt1(->base)); |
5845 | dasm_put(Dst, 4615); | 5846 | dasm_put(Dst, 4616); |
5846 | break; | 5847 | break; |
5847 | 5848 | ||
5848 | /* -- Returns ----------------------------------------------------------- */ | 5849 | /* -- Returns ----------------------------------------------------------- */ |
5849 | 5850 | ||
5850 | case BC_RETM: | 5851 | case BC_RETM: |
5851 | dasm_put(Dst, 4621); | 5852 | dasm_put(Dst, 4622); |
5852 | break; | 5853 | break; |
5853 | 5854 | ||
5854 | case BC_RET: | 5855 | case BC_RET: |
5855 | dasm_put(Dst, 4623, FRAME_TYPE, FRAME_VARG, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP); | 5856 | dasm_put(Dst, 4624, FRAME_TYPE, FRAME_VARG, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP); |
5856 | break; | 5857 | break; |
5857 | 5858 | ||
5858 | case BC_RET0: case BC_RET1: | 5859 | case BC_RET0: case BC_RET1: |
5859 | dasm_put(Dst, 4693, FRAME_TYPE, FRAME_VARG); | 5860 | dasm_put(Dst, 4694, FRAME_TYPE, FRAME_VARG); |
5860 | if (op == BC_RET1) { | 5861 | if (op == BC_RET1) { |
5861 | dasm_put(Dst, 4706); | 5862 | dasm_put(Dst, 4707); |
5862 | } | 5863 | } |
5863 | dasm_put(Dst, 4709, Dt7(->pc), PC2PROTO(k)); | 5864 | dasm_put(Dst, 4710, Dt7(->pc), PC2PROTO(k)); |
5864 | break; | 5865 | break; |
5865 | 5866 | ||
5866 | /* -- Loops and branches ------------------------------------------------ */ | 5867 | /* -- Loops and branches ------------------------------------------------ */ |
5867 | 5868 | ||
5868 | case BC_FORL: | 5869 | case BC_FORL: |
5869 | #if LJ_HASJIT | 5870 | #if LJ_HASJIT |
5870 | dasm_put(Dst, 4737); | 5871 | dasm_put(Dst, 4738); |
5871 | #endif | 5872 | #endif |
5872 | break; | 5873 | break; |
5873 | 5874 | ||
@@ -5879,35 +5880,35 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
5879 | case BC_FORI: | 5880 | case BC_FORI: |
5880 | case BC_IFORL: | 5881 | case BC_IFORL: |
5881 | vk = (op == BC_IFORL || op == BC_JFORL); | 5882 | vk = (op == BC_IFORL || op == BC_JFORL); |
5882 | dasm_put(Dst, 4739, FORL_IDX*8, FORL_STEP*8, FORL_STOP*8); | 5883 | dasm_put(Dst, 4740, FORL_IDX*8, FORL_STEP*8, FORL_STOP*8); |
5883 | if (!vk) { | 5884 | if (!vk) { |
5884 | dasm_put(Dst, 4747); | 5885 | dasm_put(Dst, 4748); |
5885 | } | 5886 | } |
5886 | if (vk) { | 5887 | if (vk) { |
5887 | dasm_put(Dst, 4755, FORL_IDX*8); | 5888 | dasm_put(Dst, 4756, FORL_IDX*8); |
5888 | } | 5889 | } |
5889 | dasm_put(Dst, 4759, FORL_EXT*8); | 5890 | dasm_put(Dst, 4760, FORL_EXT*8); |
5890 | if (op != BC_JFORL) { | 5891 | if (op != BC_JFORL) { |
5891 | dasm_put(Dst, 4767, 32-1); | 5892 | dasm_put(Dst, 4768, 32-1); |
5892 | if (op == BC_JFORI) { | 5893 | if (op == BC_JFORI) { |
5893 | dasm_put(Dst, 4771, -(BCBIAS_J*4 >> 16)); | 5894 | dasm_put(Dst, 4772, -(BCBIAS_J*4 >> 16)); |
5894 | } else { | 5895 | } else { |
5895 | dasm_put(Dst, 4774, -(BCBIAS_J*4 >> 16)); | 5896 | dasm_put(Dst, 4775, -(BCBIAS_J*4 >> 16)); |
5896 | } | 5897 | } |
5897 | } | 5898 | } |
5898 | if (op == BC_FORI) { | 5899 | if (op == BC_FORI) { |
5899 | dasm_put(Dst, 4777); | 5900 | dasm_put(Dst, 4778); |
5900 | } else if (op == BC_IFORL) { | 5901 | } else if (op == BC_IFORL) { |
5901 | dasm_put(Dst, 4779); | 5902 | dasm_put(Dst, 4780); |
5902 | } else { | 5903 | } else { |
5903 | dasm_put(Dst, 4781, BC_JLOOP); | 5904 | dasm_put(Dst, 4782, BC_JLOOP); |
5904 | } | 5905 | } |
5905 | dasm_put(Dst, 4784); | 5906 | dasm_put(Dst, 4785); |
5906 | break; | 5907 | break; |
5907 | 5908 | ||
5908 | case BC_ITERL: | 5909 | case BC_ITERL: |
5909 | #if LJ_HASJIT | 5910 | #if LJ_HASJIT |
5910 | dasm_put(Dst, 4799); | 5911 | dasm_put(Dst, 4800); |
5911 | #endif | 5912 | #endif |
5912 | break; | 5913 | break; |
5913 | 5914 | ||
@@ -5916,40 +5917,40 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
5916 | break; | 5917 | break; |
5917 | #endif | 5918 | #endif |
5918 | case BC_IITERL: | 5919 | case BC_IITERL: |
5919 | dasm_put(Dst, 4801); | 5920 | dasm_put(Dst, 4802); |
5920 | if (op == BC_JITERL) { | 5921 | if (op == BC_JITERL) { |
5921 | dasm_put(Dst, 4807); | 5922 | dasm_put(Dst, 4808); |
5922 | } else { | 5923 | } else { |
5923 | dasm_put(Dst, 4809, 32-1, -(BCBIAS_J*4 >> 16)); | 5924 | dasm_put(Dst, 4810, 32-1, -(BCBIAS_J*4 >> 16)); |
5924 | } | 5925 | } |
5925 | dasm_put(Dst, 4816); | 5926 | dasm_put(Dst, 4817); |
5926 | break; | 5927 | break; |
5927 | 5928 | ||
5928 | case BC_LOOP: | 5929 | case BC_LOOP: |
5929 | #if LJ_HASJIT | 5930 | #if LJ_HASJIT |
5930 | dasm_put(Dst, 4828); | 5931 | dasm_put(Dst, 4829); |
5931 | #endif | 5932 | #endif |
5932 | break; | 5933 | break; |
5933 | 5934 | ||
5934 | case BC_ILOOP: | 5935 | case BC_ILOOP: |
5935 | dasm_put(Dst, 4830); | 5936 | dasm_put(Dst, 4831); |
5936 | break; | 5937 | break; |
5937 | 5938 | ||
5938 | case BC_JLOOP: | 5939 | case BC_JLOOP: |
5939 | #if LJ_HASJIT | 5940 | #if LJ_HASJIT |
5940 | dasm_put(Dst, 4841); | 5941 | dasm_put(Dst, 4842); |
5941 | #endif | 5942 | #endif |
5942 | break; | 5943 | break; |
5943 | 5944 | ||
5944 | case BC_JMP: | 5945 | case BC_JMP: |
5945 | dasm_put(Dst, 4843, 32-1, -(BCBIAS_J*4 >> 16)); | 5946 | dasm_put(Dst, 4844, 32-1, -(BCBIAS_J*4 >> 16)); |
5946 | break; | 5947 | break; |
5947 | 5948 | ||
5948 | /* -- Function headers -------------------------------------------------- */ | 5949 | /* -- Function headers -------------------------------------------------- */ |
5949 | 5950 | ||
5950 | case BC_FUNCF: | 5951 | case BC_FUNCF: |
5951 | #if LJ_HASJIT | 5952 | #if LJ_HASJIT |
5952 | dasm_put(Dst, 4859); | 5953 | dasm_put(Dst, 4860); |
5953 | #endif | 5954 | #endif |
5954 | case BC_FUNCV: /* NYI: compiled vararg functions. */ | 5955 | case BC_FUNCV: /* NYI: compiled vararg functions. */ |
5955 | break; | 5956 | break; |
@@ -5959,38 +5960,38 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
5959 | break; | 5960 | break; |
5960 | #endif | 5961 | #endif |
5961 | case BC_IFUNCF: | 5962 | case BC_IFUNCF: |
5962 | dasm_put(Dst, 4861, Dt1(->maxstack), -4+PC2PROTO(numparams), -4+PC2PROTO(k), 31-3); | 5963 | dasm_put(Dst, 4862, Dt1(->maxstack), -4+PC2PROTO(numparams), -4+PC2PROTO(k), 31-3); |
5963 | if (op == BC_JFUNCF) { | 5964 | if (op == BC_JFUNCF) { |
5964 | dasm_put(Dst, 4879); | 5965 | dasm_put(Dst, 4880); |
5965 | } else { | 5966 | } else { |
5966 | dasm_put(Dst, 4881); | 5967 | dasm_put(Dst, 4882); |
5967 | } | 5968 | } |
5968 | dasm_put(Dst, 4890); | 5969 | dasm_put(Dst, 4891); |
5969 | break; | 5970 | break; |
5970 | 5971 | ||
5971 | case BC_JFUNCV: | 5972 | case BC_JFUNCV: |
5972 | #if !LJ_HASJIT | 5973 | #if !LJ_HASJIT |
5973 | break; | 5974 | break; |
5974 | #endif | 5975 | #endif |
5975 | dasm_put(Dst, 4896); | 5976 | dasm_put(Dst, 4897); |
5976 | break; /* NYI: compiled vararg functions. */ | 5977 | break; /* NYI: compiled vararg functions. */ |
5977 | 5978 | ||
5978 | case BC_IFUNCV: | 5979 | case BC_IFUNCV: |
5979 | dasm_put(Dst, 4898, Dt1(->maxstack), 8+FRAME_VARG, -4+PC2PROTO(k), -4+PC2PROTO(numparams)); | 5980 | dasm_put(Dst, 4899, Dt1(->maxstack), 8+FRAME_VARG, -4+PC2PROTO(k), -4+PC2PROTO(numparams)); |
5980 | break; | 5981 | break; |
5981 | 5982 | ||
5982 | case BC_FUNCC: | 5983 | case BC_FUNCC: |
5983 | case BC_FUNCCW: | 5984 | case BC_FUNCCW: |
5984 | if (op == BC_FUNCC) { | 5985 | if (op == BC_FUNCC) { |
5985 | dasm_put(Dst, 4948, Dt8(->f)); | 5986 | dasm_put(Dst, 4949, Dt8(->f)); |
5986 | } else { | 5987 | } else { |
5987 | dasm_put(Dst, 4951, DISPATCH_GL(wrapf)); | 5988 | dasm_put(Dst, 4952, DISPATCH_GL(wrapf)); |
5988 | } | 5989 | } |
5989 | dasm_put(Dst, 4954, Dt1(->maxstack), Dt1(->base), Dt1(->top), ~LJ_VMST_C); | 5990 | dasm_put(Dst, 4955, Dt1(->maxstack), Dt1(->base), Dt1(->top), ~LJ_VMST_C); |
5990 | if (op == BC_FUNCCW) { | 5991 | if (op == BC_FUNCCW) { |
5991 | dasm_put(Dst, 4967, Dt8(->f)); | 5992 | dasm_put(Dst, 4968, Dt8(->f)); |
5992 | } | 5993 | } |
5993 | dasm_put(Dst, 4970, DISPATCH_GL(vmstate), Dt1(->top), 31-3, Dt1(->base), ~LJ_VMST_INTERP, DISPATCH_GL(vmstate)); | 5994 | dasm_put(Dst, 4971, DISPATCH_GL(vmstate), Dt1(->top), 31-3, Dt1(->base), ~LJ_VMST_INTERP, DISPATCH_GL(vmstate)); |
5994 | break; | 5995 | break; |
5995 | 5996 | ||
5996 | /* ---------------------------------------------------------------------- */ | 5997 | /* ---------------------------------------------------------------------- */ |
@@ -6010,7 +6011,7 @@ static int build_backend(BuildCtx *ctx) | |||
6010 | 6011 | ||
6011 | build_subroutines(ctx); | 6012 | build_subroutines(ctx); |
6012 | 6013 | ||
6013 | dasm_put(Dst, 4991); | 6014 | dasm_put(Dst, 4992); |
6014 | for (op = 0; op < BC__MAX; op++) | 6015 | for (op = 0; op < BC__MAX; op++) |
6015 | build_ins(ctx, (BCOp)op, op); | 6016 | build_ins(ctx, (BCOp)op, op); |
6016 | 6017 | ||