summaryrefslogtreecommitdiff
path: root/src/buildvm_ppcspe.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildvm_ppcspe.h')
-rw-r--r--src/buildvm_ppcspe.h438
1 files changed, 225 insertions, 213 deletions
diff --git a/src/buildvm_ppcspe.h b/src/buildvm_ppcspe.h
index 0cedee2c..f3af36b0 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
15static const unsigned int build_actionlist[4907] = { 15static const unsigned int build_actionlist[4918] = {
160x00010001, 160x00010001,
170x00060014, 170x00060014,
180x72000000, 180x72000000,
@@ -1056,9 +1056,14 @@ static const unsigned int build_actionlist[4907] = {
10560x40800000, 10560x40800000,
10570x00050842, 10570x00050842,
10580x00000000, 10580x00000000,
10590x81230000,
10600x00098200,
10590x100a0301, 10610x100a0301,
10600x00090cab, 10620x00090cab,
10630x28090000,
10610x3a8efff8, 10640x3a8efff8,
10650x40820000,
10660x00050842,
10620x106e0321, 10670x106e0321,
10630x134e0b21, 10680x134e0b21,
10640x39800000, 10690x39800000,
@@ -1115,13 +1120,13 @@ static const unsigned int build_actionlist[4907] = {
11150x00098200, 11200x00098200,
11160x41820000, 11210x41820000,
11170x00050843, 11220x00050843,
11230x00000000,
11180x7d244b78, 11240x7d244b78,
11190x48000001, 11250x48000001,
11200x0003000c, 11260x0003000c,
11210x28030000, 11270x28030000,
11220x39800000, 11280x39800000,
11230x00098200, 11290x00098200,
11240x00000000,
11250x41820000, 11300x41820000,
11260x00050843, 11310x00050843,
11270x11030301, 11320x11030301,
@@ -1136,9 +1141,14 @@ static const unsigned int build_actionlist[4907] = {
11360x820efff8, 11410x820efff8,
11370x40800000, 11420x40800000,
11380x00050842, 11430x00050842,
11440x81230000,
11450x00098200,
11390x100a0301, 11460x100a0301,
11400x00090cab, 11470x00090cab,
11480x28090000,
11410x3a8efff8, 11490x3a8efff8,
11500x40820000,
11510x00050842,
11420x11000229, 11520x11000229,
11430x106e0321, 11530x106e0321,
11440x110e0b21, 11540x110e0b21,
@@ -1174,6 +1184,7 @@ static const unsigned int build_actionlist[4907] = {
11740x1004ca34, 11840x1004ca34,
11750x40800000, 11850x40800000,
11760x00050842, 11860x00050842,
11870x00000000,
11770x39ce0010, 11880x39ce0010,
11780x54c607fe, 11890x54c607fe,
11790x000900ab, 11900x000900ab,
@@ -1185,7 +1196,6 @@ static const unsigned int build_actionlist[4907] = {
11850x48000000, 11960x48000000,
11860x00050024, 11970x00050024,
11870x00060052, 11980x00060052,
11880x00000000,
11890x280b0008, 11990x280b0008,
11900x106e0301, 12000x106e0301,
11910x41800000, 12010x41800000,
@@ -1240,6 +1250,7 @@ static const unsigned int build_actionlist[4907] = {
12400x48000000, 12500x48000000,
12410x0005000c, 12510x0005000c,
12420x0006000d, 12520x0006000d,
12530x00000000,
12430x38a00000, 12540x38a00000,
12440x7c751b78, 12550x7c751b78,
12450x38c00000, 12560x38c00000,
@@ -1250,7 +1261,6 @@ static const unsigned int build_actionlist[4907] = {
12500x00098200, 12610x00098200,
12510x28030000, 12620x28030000,
12520x00090200, 12630x00090200,
12530x00000000,
12540x80d50000, 12640x80d50000,
12550x00098200, 12650x00098200,
12560x38000000, 12660x38000000,
@@ -1298,6 +1308,7 @@ static const unsigned int build_actionlist[4907] = {
12980x48000000, 13080x48000000,
12990x00050018, 13090x00050018,
13000x00060012, 13100x00060012,
13110x00000000,
13010x72000000, 13120x72000000,
13020x00090200, 13130x00090200,
13030x38c6fff8, 13140x38c6fff8,
@@ -1308,7 +1319,6 @@ static const unsigned int build_actionlist[4907] = {
13080x00098200, 13190x00098200,
13090x39800000, 13200x39800000,
13100x00098200, 13210x00098200,
13110x00000000,
13120x910efff8, 13220x910efff8,
13130x3a8efff8, 13230x3a8efff8,
13140x100e0321, 13240x100e0321,
@@ -1359,6 +1369,7 @@ static const unsigned int build_actionlist[4907] = {
13590x91d20000, 13690x91d20000,
13600x00098200, 13700x00098200,
13610x0006000c, 13710x0006000c,
13720x00000000,
13620x7c085800, 13730x7c085800,
13630x100e4300, 13740x100e4300,
13640x41820000, 13750x41820000,
@@ -1368,7 +1379,6 @@ static const unsigned int build_actionlist[4907] = {
13680x48000000, 13790x48000000,
13690x0005000c, 13800x0005000c,
13700x0006000d, 13810x0006000d,
13710x00000000,
13720x38a00000, 13820x38a00000,
13730x7c751b78, 13830x7c751b78,
13740x38c00000, 13840x38c00000,
@@ -1420,6 +1430,7 @@ static const unsigned int build_actionlist[4907] = {
14200x7d936378, 14300x7d936378,
14210x41820000, 14310x41820000,
14220x00050817, 14320x00050817,
14330x00000000,
14230x48000000, 14340x48000000,
14240x00050018, 14350x00050018,
14250x00060012, 14360x00060012,
@@ -1428,7 +1439,6 @@ static const unsigned int build_actionlist[4907] = {
14280x48000001, 14390x48000001,
14290x0003000d, 14400x0003000d,
14300x00060013, 14410x00060013,
14310x00000000,
14320x7e439378, 14420x7e439378,
14330x558400fe, 14430x558400fe,
14340x000900ab, 14440x000900ab,
@@ -1471,6 +1481,7 @@ static const unsigned int build_actionlist[4907] = {
14710x3a8efff8, 14810x3a8efff8,
14720x10740321, 14820x10740321,
14730x00060056, 14830x00060056,
14840x00000000,
14740x39800000, 14850x39800000,
14750x00098200, 14860x00098200,
14760x00060043, 14870x00060043,
@@ -1479,7 +1490,6 @@ static const unsigned int build_actionlist[4907] = {
14790x7d936378, 14900x7d936378,
14800x40820000, 14910x40820000,
14810x00050818, 14920x00050818,
14820x00000000,
14830x80f0fffc, 14930x80f0fffc,
14840x54ea5d78, 14940x54ea5d78,
14850x0006000f, 14950x0006000f,
@@ -1547,6 +1557,7 @@ static const unsigned int build_actionlist[4907] = {
15470x00050842, 15570x00050842,
15480x48000001, 15580x48000001,
15490x0003000e, 15590x0003000e,
15600x00000000,
15500x1063222d, 15610x1063222d,
15510x48000000, 15620x48000000,
15520x00050045, 15630x00050045,
@@ -1559,7 +1570,6 @@ static const unsigned int build_actionlist[4907] = {
15590x1064222c, 15700x1064222c,
15600x40800000, 15710x40800000,
15610x00050842, 15720x00050842,
15620x00000000,
15630x48000001, 15730x48000001,
15640x0003000f, 15740x0003000f,
15650x1063222d, 15750x1063222d,
@@ -1608,6 +1618,7 @@ static const unsigned int build_actionlist[4907] = {
16080x48000000, 16180x48000000,
16090x00050045, 16190x00050045,
16100x00060060, 16200x00060060,
16210x00000000,
16110x280b0008, 16220x280b0008,
16120x108e0301, 16230x108e0301,
16130x41800000, 16240x41800000,
@@ -1622,7 +1633,6 @@ static const unsigned int build_actionlist[4907] = {
16220x48000000, 16330x48000000,
16230x00050045, 16340x00050045,
16240x00060061, 16350x00060061,
16250x00000000,
16260x280b0008, 16360x280b0008,
16270x108e0301, 16370x108e0301,
16280x41800000, 16380x41800000,
@@ -1673,6 +1683,7 @@ static const unsigned int build_actionlist[4907] = {
16730x1064222c, 16830x1064222c,
16740x40800000, 16840x40800000,
16750x00050842, 16850x00050842,
16860x00000000,
16760x48000001, 16870x48000001,
16770x00030017, 16880x00030017,
16780x1063222d, 16890x1063222d,
@@ -1687,7 +1698,6 @@ static const unsigned int build_actionlist[4907] = {
16870x1064222c, 16980x1064222c,
16880x40800000, 16990x40800000,
16890x00050842, 17000x00050842,
16900x00000000,
16910x48000001, 17010x48000001,
16920x00030018, 17020x00030018,
16930x1063222d, 17030x1063222d,
@@ -1738,6 +1748,7 @@ static const unsigned int build_actionlist[4907] = {
17380x48000000, 17480x48000000,
17390x00050045, 17490x00050045,
17400x00060069, 17500x00060069,
17510x00000000,
17410x280b0010, 17520x280b0010,
17420x108e0301, 17530x108e0301,
17430x10ce0b01, 17540x10ce0b01,
@@ -1754,7 +1765,6 @@ static const unsigned int build_actionlist[4907] = {
17540x48000000, 17650x48000000,
17550x00050045, 17660x00050045,
17560x0006006a, 17670x0006006a,
17570x00000000,
17580x280b0010, 17680x280b0010,
17590x108e0301, 17690x108e0301,
17600x10ce0b01, 17700x10ce0b01,
@@ -1805,6 +1815,7 @@ static const unsigned int build_actionlist[4907] = {
18050x108e0301, 18150x108e0301,
18060x41800000, 18160x41800000,
18070x00050842, 18170x00050842,
18180x00000000,
18080x1004b232, 18190x1004b232,
18090x1064222c, 18200x1064222c,
18100x40800000, 18210x40800000,
@@ -1822,7 +1833,6 @@ static const unsigned int build_actionlist[4907] = {
18220x10740321, 18330x10740321,
18230x39800000, 18340x39800000,
18240x00098200, 18350x00098200,
18250x00000000,
18260x10940b21, 18360x10940b21,
18270x48000000, 18370x48000000,
18280x00050043, 18380x00050043,
@@ -1879,6 +1889,7 @@ static const unsigned int build_actionlist[4907] = {
18790x40800000, 18890x40800000,
18800x00050842, 18900x00050842,
18810x0006000b, 18910x0006000b,
18920x00000000,
18820x108e4300, 18930x108e4300,
18830x7c885840, 18940x7c885840,
18840x1004b232, 18950x1004b232,
@@ -1893,7 +1904,6 @@ static const unsigned int build_actionlist[4907] = {
18930x48000000, 19040x48000000,
18940x0005000b, 19050x0005000b,
18950x00060072, 19060x00060072,
18960x00000000,
18970x280b0008, 19070x280b0008,
18980x106e0301, 19080x106e0301,
18990x41800000, 19090x41800000,
@@ -1945,6 +1955,7 @@ static const unsigned int build_actionlist[4907] = {
19450x1003b232, 19550x1003b232,
19460x38910000, 19560x38910000,
19470x00098200, 19570x00098200,
19580x00000000,
19480x40800000, 19590x40800000,
19490x00050842, 19600x00050842,
19500x10001afa, 19610x10001afa,
@@ -1957,7 +1968,6 @@ static const unsigned int build_actionlist[4907] = {
19570x7e439378, 19680x7e439378,
19580x91d20000, 19690x91d20000,
19590x00098200, 19700x00098200,
19600x00000000,
19610x9201000c, 19710x9201000c,
19620x48000001, 19720x48000001,
19630x00030021, 19730x00030021,
@@ -2007,6 +2017,7 @@ static const unsigned int build_actionlist[4907] = {
20070x40810000, 20170x40810000,
20080x00050807, 20180x00050807,
20090x0006000d, 20190x0006000d,
20200x00000000,
20100x7ca84851, 20210x7ca84851,
20110x38830000, 20220x38830000,
20120x00098200, 20230x00098200,
@@ -2022,7 +2033,6 @@ static const unsigned int build_actionlist[4907] = {
20220x48000000, 20330x48000000,
20230x0005000c, 20340x0005000c,
20240x00060011, 20350x00060011,
20250x00000000,
20260x2c860000, 20360x2c860000,
20270x7d00309e, 20370x7d00309e,
20280x7d00411e, 20380x7d00411e,
@@ -2070,6 +2080,7 @@ static const unsigned int build_actionlist[4907] = {
20700x41840000, 20800x41840000,
20710x00050842, 20810x00050842,
20720x0006000b, 20820x0006000b,
20830x00000000,
20730x28090000, 20840x28090000,
20740x7c0449ae, 20850x7c0449ae,
20750x3929ffff, 20860x3929ffff,
@@ -2084,7 +2095,6 @@ static const unsigned int build_actionlist[4907] = {
20840x48000000, 20950x48000000,
20850x00050045, 20960x00050045,
20860x00060078, 20970x00060078,
20870x00000000,
20880x80110000, 20980x80110000,
20890x00098200, 20990x00098200,
20900x81110000, 21000x81110000,
@@ -2127,6 +2137,7 @@ static const unsigned int build_actionlist[4907] = {
21270x00098200, 21370x00098200,
21280x81110000, 21380x81110000,
21290x00098200, 21390x00098200,
21400x00000000,
21300x7c004040, 21410x7c004040,
21310x40800001, 21420x40800001,
21320x0005084b, 21430x0005084b,
@@ -2143,7 +2154,6 @@ static const unsigned int build_actionlist[4907] = {
21430x00098200, 21540x00098200,
21440x38630000, 21550x38630000,
21450x00098200, 21560x00098200,
21460x00000000,
21470x80910000, 21570x80910000,
21480x00098200, 21580x00098200,
21490x7c082840, 21590x7c082840,
@@ -2191,6 +2201,7 @@ static const unsigned int build_actionlist[4907] = {
21910x41800000, 22010x41800000,
21920x00050842, 22020x00050842,
21930x0006000b, 22030x0006000b,
22040x00000000,
21940x7c092840, 22050x7c092840,
21950x7d0348ae, 22060x7d0348ae,
21960x40800000, 22070x40800000,
@@ -2211,7 +2222,6 @@ static const unsigned int build_actionlist[4907] = {
22110x1003c234, 22220x1003c234,
22120x40800000, 22230x40800000,
22130x00050842, 22240x00050842,
22140x00000000,
22150x48000001, 22250x48000001,
22160x00030022, 22260x00030022,
22170x10601af1, 22270x10601af1,
@@ -2261,6 +2271,7 @@ static const unsigned int build_actionlist[4907] = {
22610x1003b232, 22710x1003b232,
22620x40800000, 22720x40800000,
22630x00050842, 22730x00050842,
22740x00000000,
22640x1063dae0, 22750x1063dae0,
22650x39000008, 22760x39000008,
22660x0006000b, 22770x0006000b,
@@ -2277,7 +2288,6 @@ static const unsigned int build_actionlist[4907] = {
22770x48000000, 22880x48000000,
22780x0005000b, 22890x0005000b,
22790x00060080, 22900x00060080,
22800x00000000,
22810x280b0008, 22910x280b0008,
22820x106e0301, 22920x106e0301,
22830x41800000, 22930x41800000,
@@ -2338,6 +2348,7 @@ static const unsigned int build_actionlist[4907] = {
23380x1000b232, 23480x1000b232,
23390x40830000, 23490x40830000,
23400x00050842, 23500x00050842,
23510x00000000,
23410x1084dae0, 23520x1084dae0,
23420x1063dae0, 23530x1063dae0,
23430x548406fe, 23540x548406fe,
@@ -2363,7 +2374,6 @@ static const unsigned int build_actionlist[4907] = {
23630x48000000, 23740x48000000,
23640x00050045, 23750x00050045,
23650x00060085, 23760x00060085,
23660x00000000,
23670x280b0010, 23770x280b0010,
23680x106e0301, 23780x106e0301,
23690x108e0b01, 23790x108e0b01,
@@ -2426,6 +2436,7 @@ static const unsigned int build_actionlist[4907] = {
24260x7c004840, 24360x7c004840,
24270x91d20000, 24370x91d20000,
24280x00098200, 24380x00098200,
24390x00000000,
24290x91120000, 24400x91120000,
24300x00098200, 24410x00098200,
24310x7e439378, 24420x7e439378,
@@ -2442,7 +2453,6 @@ static const unsigned int build_actionlist[4907] = {
24420x41810000, 24530x41810000,
24430x00050843, 24540x00050843,
24440x0006000b, 24550x0006000b,
24450x00000000,
24460x80120000, 24560x80120000,
24470x00098200, 24570x00098200,
24480x814efffc, 24580x814efffc,
@@ -2490,6 +2500,7 @@ static const unsigned int build_actionlist[4907] = {
24900x9201000c, 25000x9201000c,
24910x90120000, 25010x90120000,
24920x00098200, 25020x00098200,
25030x00000000,
24930x7e439378, 25040x7e439378,
24940x48000001, 25050x48000001,
24950x00030023, 25060x00030023,
@@ -5297,74 +5308,75 @@ static void build_subroutines(BuildCtx *ctx)
5297 dasm_put(Dst, 854, 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])); 5308 dasm_put(Dst, 854, 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]));
5298 dasm_put(Dst, 910, Dt6(->metatable), Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); 5309 dasm_put(Dst, 910, Dt6(->metatable), Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist));
5299 dasm_put(Dst, 970, DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM]), Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->top), (2+1)*8); 5310 dasm_put(Dst, 970, DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM]), Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->top), (2+1)*8);
5300 dasm_put(Dst, 1043, Dt8(->upvalue[0]), (3+1)*8, Dt6(->asize), Dt6(->array), 31-3, (0+1)*8, (2+1)*8, Dt6(->hmask), (0+1)*8, (0+1)*8); 5311 dasm_put(Dst, 1043, Dt6(->metatable), Dt8(->upvalue[0]), (3+1)*8, Dt6(->asize), Dt6(->array), 31-3, (0+1)*8, (2+1)*8, Dt6(->hmask), (0+1)*8);
5301 dasm_put(Dst, 1109, Dt8(->upvalue[0]), (3+1)*8, DISPATCH_GL(hookmask), 32-HOOK_ACTIVE_SHIFT, 8+FRAME_PCALL, DISPATCH_GL(hookmask), 32-HOOK_ACTIVE_SHIFT, 16+FRAME_PCALL); 5312 dasm_put(Dst, 1108, (0+1)*8, Dt6(->metatable), Dt8(->upvalue[0]), (3+1)*8, DISPATCH_GL(hookmask), 32-HOOK_ACTIVE_SHIFT, 8+FRAME_PCALL, DISPATCH_GL(hookmask));
5302 dasm_put(Dst, 1173, LJ_TTHREAD, Dt1(->status), Dt1(->cframe), Dt1(->top), LUA_YIELD, Dt1(->base), Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->top), Dt1(->base), LUA_YIELD); 5313 dasm_put(Dst, 1172, 32-HOOK_ACTIVE_SHIFT, 16+FRAME_PCALL, LJ_TTHREAD, Dt1(->status), Dt1(->cframe), Dt1(->top), LUA_YIELD, Dt1(->base), Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->top));
5303 dasm_put(Dst, 1238, Dt1(->top), ~LJ_VMST_INTERP, Dt1(->base), DISPATCH_GL(vmstate), Dt1(->maxstack), Dt1(->top), FRAME_TYPE, LJ_TTRUE, FRAME_TYPE, LJ_TFALSE, Dt1(->top), (2+1)*8); 5314 dasm_put(Dst, 1238, Dt1(->base), LUA_YIELD, Dt1(->top), ~LJ_VMST_INTERP, Dt1(->base), DISPATCH_GL(vmstate), Dt1(->maxstack), Dt1(->top), FRAME_TYPE, LJ_TTRUE);
5304 dasm_put(Dst, 1296, 32-3, Dt8(->upvalue[0].gcr), Dt1(->status), Dt1(->cframe), Dt1(->top), LUA_YIELD, Dt1(->base), Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->top)); 5315 dasm_put(Dst, 1296, FRAME_TYPE, LJ_TFALSE, Dt1(->top), (2+1)*8, 32-3, Dt8(->upvalue[0].gcr), Dt1(->status), Dt1(->cframe), Dt1(->top), LUA_YIELD, Dt1(->base), Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->top));
5305 dasm_put(Dst, 1356, Dt1(->base), LUA_YIELD, Dt1(->top), ~LJ_VMST_INTERP, Dt1(->base), DISPATCH_GL(vmstate), Dt1(->maxstack), Dt1(->top), FRAME_TYPE); 5316 dasm_put(Dst, 1357, Dt1(->base), LUA_YIELD, Dt1(->top), ~LJ_VMST_INTERP, Dt1(->base), DISPATCH_GL(vmstate), Dt1(->maxstack), Dt1(->top), FRAME_TYPE);
5306 dasm_put(Dst, 1416, 32-3, Dt1(->cframe), Dt1(->base), CFRAME_RESUME, Dt1(->top), LUA_YIELD, Dt1(->cframe), Dt1(->status), (1+1)*8, FRAME_TYPE); 5317 dasm_put(Dst, 1418, 32-3, Dt1(->cframe), Dt1(->base), CFRAME_RESUME, Dt1(->top), LUA_YIELD, Dt1(->cframe), Dt1(->status));
5307 dasm_put(Dst, 1467); 5318 dasm_put(Dst, 1469, (1+1)*8, FRAME_TYPE);
5308 dasm_put(Dst, 1547); 5319 dasm_put(Dst, 1545);
5309 dasm_put(Dst, 1610); 5320 dasm_put(Dst, 1606);
5310 dasm_put(Dst, 1675); 5321 dasm_put(Dst, 1671);
5311 dasm_put(Dst, 1742, Dt8(->upvalue[0]), DISPATCH_GL(tmptv), DISPATCH_GL(tmptv), (2+1)*8); 5322 dasm_put(Dst, 1736, Dt8(->upvalue[0]));
5312 dasm_put(Dst, 1810, (2+1)*8); 5323 dasm_put(Dst, 1803, DISPATCH_GL(tmptv), DISPATCH_GL(tmptv), (2+1)*8, (2+1)*8);
5313 dasm_put(Dst, 1881, Dt5(->len), Dt5(->len), (0+1)*8, Dt5([1]), (1+1)*8, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), DISPATCH_GL(tmptv), Dt1(->base)); 5324 dasm_put(Dst, 1877, Dt5(->len), Dt5(->len), (0+1)*8, Dt5([1]), (1+1)*8, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), DISPATCH_GL(tmptv));
5314 dasm_put(Dst, 1945, Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt5(->len), sizeof(GCstr)-1); 5325 dasm_put(Dst, 1943, Dt1(->base), Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt5(->len));
5315 dasm_put(Dst, 2010, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt5(->len), DISPATCH_GL(tmpbuf.sz), Dt5([1]), DISPATCH_GL(tmpbuf.buf), DISPATCH_GL(strempty)); 5326 dasm_put(Dst, 2005, sizeof(GCstr)-1, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt5(->len), DISPATCH_GL(tmpbuf.sz), Dt5([1]), DISPATCH_GL(tmpbuf.buf));
5316 dasm_put(Dst, 2072, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), 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)); 5327 dasm_put(Dst, 2068, DISPATCH_GL(strempty), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), DISPATCH_GL(tmpbuf.sz), Dt5(->len), sizeof(GCstr), DISPATCH_GL(tmpbuf.buf), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold));
5317 dasm_put(Dst, 2131, DISPATCH_GL(tmpbuf.buf), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), DISPATCH_GL(tmpbuf.sz), Dt5(->len), sizeof(GCstr), DISPATCH_GL(tmpbuf.buf)); 5328 dasm_put(Dst, 2125, 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));
5318 dasm_put(Dst, 2199); 5329 dasm_put(Dst, 2189);
5319 dasm_put(Dst, 2265); 5330 dasm_put(Dst, 2259);
5320 dasm_put(Dst, 2351, Dt8(->f), 8*LUA_MINSTACK-8, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), 31-3); 5331 dasm_put(Dst, 2336, Dt8(->f), 8*LUA_MINSTACK-8, Dt1(->maxstack), Dt1(->base));
5321 dasm_put(Dst, 2430, Dt1(->top), Dt7(->pc), FRAME_TYPE, LUA_MINSTACK, Dt1(->base), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); 5332 dasm_put(Dst, 2424, Dt1(->top), Dt1(->base), 31-3, Dt1(->top), Dt7(->pc), FRAME_TYPE, LUA_MINSTACK, Dt1(->base), Dt1(->base), Dt1(->top));
5333 dasm_put(Dst, 2488, Dt1(->base), Dt1(->top));
5322#if LJ_HASJIT 5334#if LJ_HASJIT
5323 dasm_put(Dst, 2490); 5335 dasm_put(Dst, 2501);
5324#endif 5336#endif
5325 dasm_put(Dst, 2492, 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)); 5337 dasm_put(Dst, 2503, 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));
5326 dasm_put(Dst, 2539, GG_DISP2STATIC); 5338 dasm_put(Dst, 2550, GG_DISP2STATIC);
5327#if LJ_HASJIT 5339#if LJ_HASJIT
5328 dasm_put(Dst, 2557); 5340 dasm_put(Dst, 2568);
5329#endif 5341#endif
5330 dasm_put(Dst, 2559); 5342 dasm_put(Dst, 2570);
5331#if LJ_HASJIT 5343#if LJ_HASJIT
5332 dasm_put(Dst, 2562); 5344 dasm_put(Dst, 2573);
5333#endif 5345#endif
5334 dasm_put(Dst, 2565); 5346 dasm_put(Dst, 2576);
5335#if LJ_HASJIT 5347#if LJ_HASJIT
5336 dasm_put(Dst, 2567); 5348 dasm_put(Dst, 2578);
5337#endif 5349#endif
5338 dasm_put(Dst, 2570, Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); 5350 dasm_put(Dst, 2581, Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top));
5339#if LJ_HASJIT 5351#if LJ_HASJIT
5340 dasm_put(Dst, 2592); 5352 dasm_put(Dst, 2603);
5341#endif 5353#endif
5342 dasm_put(Dst, 2594); 5354 dasm_put(Dst, 2605);
5343#if LJ_HASJIT 5355#if LJ_HASJIT
5344 dasm_put(Dst, 2596); 5356 dasm_put(Dst, 2607);
5345#endif 5357#endif
5346 dasm_put(Dst, 2598); 5358 dasm_put(Dst, 2609);
5347#if LJ_HASJIT 5359#if LJ_HASJIT
5348 dasm_put(Dst, 2675); 5360 dasm_put(Dst, 2686);
5349#else 5361#else
5350 dasm_put(Dst, 2698); 5362 dasm_put(Dst, 2709);
5351#endif 5363#endif
5352 dasm_put(Dst, 2701); 5364 dasm_put(Dst, 2712);
5353#if LJ_HASJIT 5365#if LJ_HASJIT
5354 dasm_put(Dst, 2703); 5366 dasm_put(Dst, 2714);
5355#endif 5367#endif
5356 dasm_put(Dst, 2705); 5368 dasm_put(Dst, 2716);
5357#if LJ_HASJIT 5369#if LJ_HASJIT
5358 dasm_put(Dst, 2707); 5370 dasm_put(Dst, 2718);
5359#endif 5371#endif
5360 dasm_put(Dst, 2709); 5372 dasm_put(Dst, 2720);
5361} 5373}
5362 5374
5363/* Generate the code for a single instruction. */ 5375/* Generate the code for a single instruction. */
5364static void build_ins(BuildCtx *ctx, BCOp op, int defop) 5376static void build_ins(BuildCtx *ctx, BCOp op, int defop)
5365{ 5377{
5366 int vk = 0; 5378 int vk = 0;
5367 dasm_put(Dst, 2771, defop); 5379 dasm_put(Dst, 2782, defop);
5368 5380
5369 switch (op) { 5381 switch (op) {
5370 5382
@@ -5373,112 +5385,112 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
5373 /* Remember: all ops branch for a true comparison, fall through otherwise. */ 5385 /* Remember: all ops branch for a true comparison, fall through otherwise. */
5374 5386
5375 case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: 5387 case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:
5376 dasm_put(Dst, 2773, -(BCBIAS_J*4 >> 16)); 5388 dasm_put(Dst, 2784, -(BCBIAS_J*4 >> 16));
5377 if (op == BC_ISLE || op == BC_ISGT) { 5389 if (op == BC_ISLE || op == BC_ISGT) {
5378 dasm_put(Dst, 2787); 5390 dasm_put(Dst, 2798);
5379 } 5391 }
5380 if (op == BC_ISLT || op == BC_ISLE) { 5392 if (op == BC_ISLT || op == BC_ISLE) {
5381 dasm_put(Dst, 2790); 5393 dasm_put(Dst, 2801);
5382 } else { 5394 } else {
5383 dasm_put(Dst, 2792); 5395 dasm_put(Dst, 2803);
5384 } 5396 }
5385 dasm_put(Dst, 2794); 5397 dasm_put(Dst, 2805);
5386 break; 5398 break;
5387 5399
5388 case BC_ISEQV: case BC_ISNEV: 5400 case BC_ISEQV: case BC_ISNEV:
5389 vk = op == BC_ISEQV; 5401 vk = op == BC_ISEQV;
5390 dasm_put(Dst, 2805, -(BCBIAS_J*4 >> 16)); 5402 dasm_put(Dst, 2816, -(BCBIAS_J*4 >> 16));
5391 if (vk) { 5403 if (vk) {
5392 dasm_put(Dst, 2819); 5404 dasm_put(Dst, 2830);
5393 } else { 5405 } else {
5394 dasm_put(Dst, 2821); 5406 dasm_put(Dst, 2832);
5395 } 5407 }
5396 dasm_put(Dst, 2823, ~LJ_TISPRI, ~LJ_TISTABUD); 5408 dasm_put(Dst, 2834, ~LJ_TISPRI, ~LJ_TISTABUD);
5397 if (vk) { 5409 if (vk) {
5398 dasm_put(Dst, 2845); 5410 dasm_put(Dst, 2856);
5399 } else { 5411 } else {
5400 dasm_put(Dst, 2847); 5412 dasm_put(Dst, 2858);
5401 } 5413 }
5402 dasm_put(Dst, 2849); 5414 dasm_put(Dst, 2860);
5403 if (vk) { 5415 if (vk) {
5404 dasm_put(Dst, 2851); 5416 dasm_put(Dst, 2862);
5405 } else { 5417 } else {
5406 dasm_put(Dst, 2853); 5418 dasm_put(Dst, 2864);
5407 } 5419 }
5408 dasm_put(Dst, 2855, Dt6(->metatable), 1-vk, Dt6(->nomm), 1<<MM_eq); 5420 dasm_put(Dst, 2866, Dt6(->metatable), 1-vk, Dt6(->nomm), 1<<MM_eq);
5409 break; 5421 break;
5410 5422
5411 case BC_ISEQS: case BC_ISNES: 5423 case BC_ISEQS: case BC_ISNES:
5412 vk = op == BC_ISEQS; 5424 vk = op == BC_ISEQS;
5413 dasm_put(Dst, 2876, 32-1, -(BCBIAS_J*4 >> 16)); 5425 dasm_put(Dst, 2887, 32-1, -(BCBIAS_J*4 >> 16));
5414 if (vk) { 5426 if (vk) {
5415 dasm_put(Dst, 2890); 5427 dasm_put(Dst, 2901);
5416 } else { 5428 } else {
5417 dasm_put(Dst, 2892); 5429 dasm_put(Dst, 2903);
5418 } 5430 }
5419 dasm_put(Dst, 2894); 5431 dasm_put(Dst, 2905);
5420 break; 5432 break;
5421 5433
5422 case BC_ISEQN: case BC_ISNEN: 5434 case BC_ISEQN: case BC_ISNEN:
5423 vk = op == BC_ISEQN; 5435 vk = op == BC_ISEQN;
5424 dasm_put(Dst, 2905, -(BCBIAS_J*4 >> 16)); 5436 dasm_put(Dst, 2916, -(BCBIAS_J*4 >> 16));
5425 if (vk) { 5437 if (vk) {
5426 dasm_put(Dst, 2919); 5438 dasm_put(Dst, 2930);
5427 } else { 5439 } else {
5428 dasm_put(Dst, 2922); 5440 dasm_put(Dst, 2933);
5429 } 5441 }
5430 dasm_put(Dst, 2924); 5442 dasm_put(Dst, 2935);
5431 if (!vk) { 5443 if (!vk) {
5432 dasm_put(Dst, 2936); 5444 dasm_put(Dst, 2947);
5433 } 5445 }
5434 break; 5446 break;
5435 5447
5436 case BC_ISEQP: case BC_ISNEP: 5448 case BC_ISEQP: case BC_ISNEP:
5437 vk = op == BC_ISEQP; 5449 vk = op == BC_ISEQP;
5438 dasm_put(Dst, 2942, 32-3, -(BCBIAS_J*4 >> 16)); 5450 dasm_put(Dst, 2953, 32-3, -(BCBIAS_J*4 >> 16));
5439 if (vk) { 5451 if (vk) {
5440 dasm_put(Dst, 2954); 5452 dasm_put(Dst, 2965);
5441 } else { 5453 } else {
5442 dasm_put(Dst, 2956); 5454 dasm_put(Dst, 2967);
5443 } 5455 }
5444 dasm_put(Dst, 2958); 5456 dasm_put(Dst, 2969);
5445 break; 5457 break;
5446 5458
5447 /* -- Unary test and copy ops ------------------------------------------- */ 5459 /* -- Unary test and copy ops ------------------------------------------- */
5448 5460
5449 case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: 5461 case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF:
5450 dasm_put(Dst, 2969); 5462 dasm_put(Dst, 2980);
5451 if (op == BC_IST || op == BC_ISF) { 5463 if (op == BC_IST || op == BC_ISF) {
5452 dasm_put(Dst, 2975, -(BCBIAS_J*4 >> 16)); 5464 dasm_put(Dst, 2986, -(BCBIAS_J*4 >> 16));
5453 if (op == BC_IST) { 5465 if (op == BC_IST) {
5454 dasm_put(Dst, 2980); 5466 dasm_put(Dst, 2991);
5455 } else { 5467 } else {
5456 dasm_put(Dst, 2982); 5468 dasm_put(Dst, 2993);
5457 } 5469 }
5458 } else { 5470 } else {
5459 if (op == BC_ISTC) { 5471 if (op == BC_ISTC) {
5460 dasm_put(Dst, 2984); 5472 dasm_put(Dst, 2995);
5461 } else { 5473 } else {
5462 dasm_put(Dst, 2987); 5474 dasm_put(Dst, 2998);
5463 } 5475 }
5464 dasm_put(Dst, 2990, -(BCBIAS_J*4 >> 16)); 5476 dasm_put(Dst, 3001, -(BCBIAS_J*4 >> 16));
5465 } 5477 }
5466 dasm_put(Dst, 2997); 5478 dasm_put(Dst, 3008);
5467 break; 5479 break;
5468 5480
5469 /* -- Unary ops --------------------------------------------------------- */ 5481 /* -- Unary ops --------------------------------------------------------- */
5470 5482
5471 case BC_MOV: 5483 case BC_MOV:
5472 dasm_put(Dst, 3008); 5484 dasm_put(Dst, 3019);
5473 break; 5485 break;
5474 case BC_NOT: 5486 case BC_NOT:
5475 dasm_put(Dst, 3021, LJ_TTRUE); 5487 dasm_put(Dst, 3032, LJ_TTRUE);
5476 break; 5488 break;
5477 case BC_UNM: 5489 case BC_UNM:
5478 dasm_put(Dst, 3037); 5490 dasm_put(Dst, 3048);
5479 break; 5491 break;
5480 case BC_LEN: 5492 case BC_LEN:
5481 dasm_put(Dst, 3054, Dt5(->len)); 5493 dasm_put(Dst, 3065, Dt5(->len));
5482 break; 5494 break;
5483 5495
5484 /* -- Binary ops -------------------------------------------------------- */ 5496 /* -- Binary ops -------------------------------------------------------- */
@@ -5488,257 +5500,257 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
5488 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 5500 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
5489 switch (vk) { 5501 switch (vk) {
5490 case 0: 5502 case 0:
5491 dasm_put(Dst, 3082); 5503 dasm_put(Dst, 3093);
5492 break; 5504 break;
5493 case 1: 5505 case 1:
5494 dasm_put(Dst, 3088); 5506 dasm_put(Dst, 3099);
5495 break; 5507 break;
5496 default: 5508 default:
5497 dasm_put(Dst, 3094); 5509 dasm_put(Dst, 3105);
5498 break; 5510 break;
5499 } 5511 }
5500 dasm_put(Dst, 3101); 5512 dasm_put(Dst, 3112);
5501 break; 5513 break;
5502 case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: 5514 case BC_SUBVN: case BC_SUBNV: case BC_SUBVV:
5503 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 5515 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
5504 switch (vk) { 5516 switch (vk) {
5505 case 0: 5517 case 0:
5506 dasm_put(Dst, 3114); 5518 dasm_put(Dst, 3125);
5507 break; 5519 break;
5508 case 1: 5520 case 1:
5509 dasm_put(Dst, 3120); 5521 dasm_put(Dst, 3131);
5510 break; 5522 break;
5511 default: 5523 default:
5512 dasm_put(Dst, 3126); 5524 dasm_put(Dst, 3137);
5513 break; 5525 break;
5514 } 5526 }
5515 dasm_put(Dst, 3133); 5527 dasm_put(Dst, 3144);
5516 break; 5528 break;
5517 case BC_MULVN: case BC_MULNV: case BC_MULVV: 5529 case BC_MULVN: case BC_MULNV: case BC_MULVV:
5518 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 5530 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
5519 switch (vk) { 5531 switch (vk) {
5520 case 0: 5532 case 0:
5521 dasm_put(Dst, 3146); 5533 dasm_put(Dst, 3157);
5522 break; 5534 break;
5523 case 1: 5535 case 1:
5524 dasm_put(Dst, 3152); 5536 dasm_put(Dst, 3163);
5525 break; 5537 break;
5526 default: 5538 default:
5527 dasm_put(Dst, 3158); 5539 dasm_put(Dst, 3169);
5528 break; 5540 break;
5529 } 5541 }
5530 dasm_put(Dst, 3165); 5542 dasm_put(Dst, 3176);
5531 break; 5543 break;
5532 case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: 5544 case BC_DIVVN: case BC_DIVNV: case BC_DIVVV:
5533 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 5545 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
5534 switch (vk) { 5546 switch (vk) {
5535 case 0: 5547 case 0:
5536 dasm_put(Dst, 3178); 5548 dasm_put(Dst, 3189);
5537 break; 5549 break;
5538 case 1: 5550 case 1:
5539 dasm_put(Dst, 3184); 5551 dasm_put(Dst, 3195);
5540 break; 5552 break;
5541 default: 5553 default:
5542 dasm_put(Dst, 3190); 5554 dasm_put(Dst, 3201);
5543 break; 5555 break;
5544 } 5556 }
5545 dasm_put(Dst, 3197); 5557 dasm_put(Dst, 3208);
5546 break; 5558 break;
5547 case BC_MODVN: 5559 case BC_MODVN:
5548 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 5560 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
5549 switch (vk) { 5561 switch (vk) {
5550 case 0: 5562 case 0:
5551 dasm_put(Dst, 3210); 5563 dasm_put(Dst, 3221);
5552 break; 5564 break;
5553 case 1: 5565 case 1:
5554 dasm_put(Dst, 3216); 5566 dasm_put(Dst, 3227);
5555 break; 5567 break;
5556 default: 5568 default:
5557 dasm_put(Dst, 3222); 5569 dasm_put(Dst, 3233);
5558 break; 5570 break;
5559 } 5571 }
5560 dasm_put(Dst, 3229); 5572 dasm_put(Dst, 3240);
5561 break; 5573 break;
5562 case BC_MODNV: case BC_MODVV: 5574 case BC_MODNV: case BC_MODVV:
5563 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 5575 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
5564 switch (vk) { 5576 switch (vk) {
5565 case 0: 5577 case 0:
5566 dasm_put(Dst, 3247); 5578 dasm_put(Dst, 3258);
5567 break; 5579 break;
5568 case 1: 5580 case 1:
5569 dasm_put(Dst, 3253); 5581 dasm_put(Dst, 3264);
5570 break; 5582 break;
5571 default: 5583 default:
5572 dasm_put(Dst, 3259); 5584 dasm_put(Dst, 3270);
5573 break; 5585 break;
5574 } 5586 }
5575 dasm_put(Dst, 3266); 5587 dasm_put(Dst, 3277);
5576 break; 5588 break;
5577 case BC_POW: 5589 case BC_POW:
5578 dasm_put(Dst, 3269); 5590 dasm_put(Dst, 3280);
5579 break; 5591 break;
5580 5592
5581 case BC_CAT: 5593 case BC_CAT:
5582 dasm_put(Dst, 3291, Dt1(->base), 32-3, Dt1(->base)); 5594 dasm_put(Dst, 3302, Dt1(->base), 32-3, Dt1(->base));
5583 break; 5595 break;
5584 5596
5585 /* -- Constant ops ------------------------------------------------------ */ 5597 /* -- Constant ops ------------------------------------------------------ */
5586 5598
5587 case BC_KSTR: 5599 case BC_KSTR:
5588 dasm_put(Dst, 3321, 32-1); 5600 dasm_put(Dst, 3332, 32-1);
5589 break; 5601 break;
5590 case BC_KSHORT: 5602 case BC_KSHORT:
5591 dasm_put(Dst, 3338, 32-3); 5603 dasm_put(Dst, 3349, 32-3);
5592 break; 5604 break;
5593 case BC_KNUM: 5605 case BC_KNUM:
5594 dasm_put(Dst, 3354); 5606 dasm_put(Dst, 3365);
5595 break; 5607 break;
5596 case BC_KPRI: 5608 case BC_KPRI:
5597 dasm_put(Dst, 3367, 32-3); 5609 dasm_put(Dst, 3378, 32-3);
5598 break; 5610 break;
5599 case BC_KNIL: 5611 case BC_KNIL:
5600 dasm_put(Dst, 3382); 5612 dasm_put(Dst, 3393);
5601 break; 5613 break;
5602 5614
5603 /* -- Upvalue and function ops ------------------------------------------ */ 5615 /* -- Upvalue and function ops ------------------------------------------ */
5604 5616
5605 case BC_UGET: 5617 case BC_UGET:
5606 dasm_put(Dst, 3401, 32-1, offsetof(GCfuncL, uvptr), DtA(->v)); 5618 dasm_put(Dst, 3412, 32-1, offsetof(GCfuncL, uvptr), DtA(->v));
5607 break; 5619 break;
5608 case BC_USETV: 5620 case BC_USETV:
5609 dasm_put(Dst, 3422, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, DtA(->closed), -LJ_TISNUM, LJ_TISGCV - LJ_TISNUM, Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G); 5621 dasm_put(Dst, 3433, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, DtA(->closed), -LJ_TISNUM, LJ_TISGCV - LJ_TISNUM, Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G);
5610 break; 5622 break;
5611 case BC_USETS: 5623 case BC_USETS:
5612 dasm_put(Dst, 3474, 32-1, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, Dt5(->marked), DtA(->closed), LJ_GC_WHITES, GG_DISP2G); 5624 dasm_put(Dst, 3485, 32-1, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, Dt5(->marked), DtA(->closed), LJ_GC_WHITES, GG_DISP2G);
5613 break; 5625 break;
5614 case BC_USETN: 5626 case BC_USETN:
5615 dasm_put(Dst, 3523, 32-1, offsetof(GCfuncL, uvptr), DtA(->v)); 5627 dasm_put(Dst, 3534, 32-1, offsetof(GCfuncL, uvptr), DtA(->v));
5616 break; 5628 break;
5617 case BC_USETP: 5629 case BC_USETP:
5618 dasm_put(Dst, 3544, 32-1, offsetof(GCfuncL, uvptr), 32-3, DtA(->v)); 5630 dasm_put(Dst, 3555, 32-1, offsetof(GCfuncL, uvptr), 32-3, DtA(->v));
5619 break; 5631 break;
5620 5632
5621 case BC_UCLO: 5633 case BC_UCLO:
5622 dasm_put(Dst, 3567, Dt1(->openupval), 32-1, -(BCBIAS_J*4 >> 16), Dt1(->base), Dt1(->base)); 5634 dasm_put(Dst, 3578, Dt1(->openupval), 32-1, -(BCBIAS_J*4 >> 16), Dt1(->base), Dt1(->base));
5623 break; 5635 break;
5624 5636
5625 case BC_FNEW: 5637 case BC_FNEW:
5626 dasm_put(Dst, 3597, 32-1, Dt1(->base), Dt1(->base)); 5638 dasm_put(Dst, 3608, 32-1, Dt1(->base), Dt1(->base));
5627 break; 5639 break;
5628 5640
5629 /* -- Table ops --------------------------------------------------------- */ 5641 /* -- Table ops --------------------------------------------------------- */
5630 5642
5631 case BC_TNEW: 5643 case BC_TNEW:
5632 case BC_TDUP: 5644 case BC_TDUP:
5633 dasm_put(Dst, 3623, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base)); 5645 dasm_put(Dst, 3634, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base));
5634 if (op == BC_TNEW) { 5646 if (op == BC_TNEW) {
5635 dasm_put(Dst, 3636); 5647 dasm_put(Dst, 3647);
5636 } else { 5648 } else {
5637 dasm_put(Dst, 3644, 32-1); 5649 dasm_put(Dst, 3655, 32-1);
5638 } 5650 }
5639 dasm_put(Dst, 3651, Dt1(->base)); 5651 dasm_put(Dst, 3662, Dt1(->base));
5640 break; 5652 break;
5641 5653
5642 case BC_GGET: 5654 case BC_GGET:
5643 case BC_GSET: 5655 case BC_GSET:
5644 dasm_put(Dst, 3674, 32-1, Dt7(->env)); 5656 dasm_put(Dst, 3685, 32-1, Dt7(->env));
5645 if (op == BC_GGET) { 5657 if (op == BC_GGET) {
5646 dasm_put(Dst, 3682); 5658 dasm_put(Dst, 3693);
5647 } else { 5659 } else {
5648 dasm_put(Dst, 3685); 5660 dasm_put(Dst, 3696);
5649 } 5661 }
5650 break; 5662 break;
5651 5663
5652 case BC_TGETV: 5664 case BC_TGETV:
5653 dasm_put(Dst, 3688, Dt6(->asize), Dt6(->array), 31-3, Dt6(->metatable), Dt6(->nomm), 1<<MM_index); 5665 dasm_put(Dst, 3699, Dt6(->asize), Dt6(->array), 31-3, Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
5654 break; 5666 break;
5655 case BC_TGETS: 5667 case BC_TGETS:
5656 dasm_put(Dst, 3746, 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); 5668 dasm_put(Dst, 3757, 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);
5657 dasm_put(Dst, 3810); 5669 dasm_put(Dst, 3821);
5658 break; 5670 break;
5659 case BC_TGETB: 5671 case BC_TGETB:
5660 dasm_put(Dst, 3815, 32-3, Dt6(->asize), Dt6(->array), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); 5672 dasm_put(Dst, 3826, 32-3, Dt6(->asize), Dt6(->array), Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
5661 break; 5673 break;
5662 5674
5663 case BC_TSETV: 5675 case BC_TSETV:
5664 dasm_put(Dst, 3859, Dt6(->asize), Dt6(->array), 31-3, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex); 5676 dasm_put(Dst, 3870, Dt6(->asize), Dt6(->array), 31-3, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex);
5665 dasm_put(Dst, 3926, DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); 5677 dasm_put(Dst, 3937, DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist));
5666 break; 5678 break;
5667 case BC_TSETS: 5679 case BC_TSETS:
5668 dasm_put(Dst, 3938, 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)); 5680 dasm_put(Dst, 3949, 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));
5669 dasm_put(Dst, 3999, 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)); 5681 dasm_put(Dst, 4010, 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));
5670 dasm_put(Dst, 4050, Dt6(->marked), Dt6(->gclist)); 5682 dasm_put(Dst, 4061, Dt6(->marked), Dt6(->gclist));
5671 break; 5683 break;
5672 case BC_TSETB: 5684 case BC_TSETB:
5673 dasm_put(Dst, 4057, 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)); 5685 dasm_put(Dst, 4068, 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));
5674 dasm_put(Dst, 4117, Dt6(->gclist)); 5686 dasm_put(Dst, 4128, Dt6(->gclist));
5675 break; 5687 break;
5676 5688
5677 case BC_TSETM: 5689 case BC_TSETM:
5678 dasm_put(Dst, 4122, 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)); 5690 dasm_put(Dst, 4133, 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));
5679 dasm_put(Dst, 4191); 5691 dasm_put(Dst, 4202);
5680 break; 5692 break;
5681 5693
5682 /* -- Calls and vararg handling ----------------------------------------- */ 5694 /* -- Calls and vararg handling ----------------------------------------- */
5683 5695
5684 case BC_CALLM: 5696 case BC_CALLM:
5685 dasm_put(Dst, 4194); 5697 dasm_put(Dst, 4205);
5686 break; 5698 break;
5687 case BC_CALL: 5699 case BC_CALL:
5688 dasm_put(Dst, 4196, Dt7(->pc)); 5700 dasm_put(Dst, 4207, Dt7(->pc));
5689 break; 5701 break;
5690 5702
5691 case BC_CALLMT: 5703 case BC_CALLMT:
5692 dasm_put(Dst, 4216); 5704 dasm_put(Dst, 4227);
5693 break; 5705 break;
5694 case BC_CALLT: 5706 case BC_CALLT:
5695 dasm_put(Dst, 4218, FRAME_TYPE, Dt7(->ffid), FRAME_VARG, Dt7(->pc), -4-8, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP); 5707 dasm_put(Dst, 4229, FRAME_TYPE, Dt7(->ffid), FRAME_VARG, Dt7(->pc), -4-8, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP);
5696 dasm_put(Dst, 4283, FRAME_TYPE); 5708 dasm_put(Dst, 4294, FRAME_TYPE);
5697 break; 5709 break;
5698 5710
5699 case BC_ITERC: 5711 case BC_ITERC:
5700 dasm_put(Dst, 4290, Dt7(->pc)); 5712 dasm_put(Dst, 4301, Dt7(->pc));
5701 break; 5713 break;
5702 5714
5703 case BC_ITERN: 5715 case BC_ITERN:
5704#if LJ_HASJIT 5716#if LJ_HASJIT
5705#endif 5717#endif
5706 dasm_put(Dst, 4316, Dt6(->asize), Dt6(->array), 31-3, -(BCBIAS_J*4 >> 16), Dt6(->hmask), Dt6(->node), 31-5, 31-3, DtB(->key), -(BCBIAS_J*4 >> 16)); 5718 dasm_put(Dst, 4327, Dt6(->asize), Dt6(->array), 31-3, -(BCBIAS_J*4 >> 16), Dt6(->hmask), Dt6(->node), 31-5, 31-3, DtB(->key), -(BCBIAS_J*4 >> 16));
5707 dasm_put(Dst, 4395); 5719 dasm_put(Dst, 4406);
5708 break; 5720 break;
5709 5721
5710 case BC_ISNEXT: 5722 case BC_ISNEXT:
5711 dasm_put(Dst, 4399, 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)); 5723 dasm_put(Dst, 4410, 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));
5712 break; 5724 break;
5713 5725
5714 case BC_VARG: 5726 case BC_VARG:
5715 dasm_put(Dst, 4450, FRAME_VARG, Dt1(->maxstack), Dt1(->top), Dt1(->base), 32-3, Dt1(->base)); 5727 dasm_put(Dst, 4461, FRAME_VARG, Dt1(->maxstack), Dt1(->top), Dt1(->base), 32-3, Dt1(->base));
5716 dasm_put(Dst, 4530); 5728 dasm_put(Dst, 4541);
5717 break; 5729 break;
5718 5730
5719 /* -- Returns ----------------------------------------------------------- */ 5731 /* -- Returns ----------------------------------------------------------- */
5720 5732
5721 case BC_RETM: 5733 case BC_RETM:
5722 dasm_put(Dst, 4536); 5734 dasm_put(Dst, 4547);
5723 break; 5735 break;
5724 5736
5725 case BC_RET: 5737 case BC_RET:
5726 dasm_put(Dst, 4538, FRAME_TYPE, FRAME_VARG, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP); 5738 dasm_put(Dst, 4549, FRAME_TYPE, FRAME_VARG, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP);
5727 break; 5739 break;
5728 5740
5729 case BC_RET0: case BC_RET1: 5741 case BC_RET0: case BC_RET1:
5730 dasm_put(Dst, 4608, FRAME_TYPE, FRAME_VARG); 5742 dasm_put(Dst, 4619, FRAME_TYPE, FRAME_VARG);
5731 if (op == BC_RET1) { 5743 if (op == BC_RET1) {
5732 dasm_put(Dst, 4621); 5744 dasm_put(Dst, 4632);
5733 } 5745 }
5734 dasm_put(Dst, 4624, Dt7(->pc), PC2PROTO(k)); 5746 dasm_put(Dst, 4635, Dt7(->pc), PC2PROTO(k));
5735 break; 5747 break;
5736 5748
5737 /* -- Loops and branches ------------------------------------------------ */ 5749 /* -- Loops and branches ------------------------------------------------ */
5738 5750
5739 case BC_FORL: 5751 case BC_FORL:
5740#if LJ_HASJIT 5752#if LJ_HASJIT
5741 dasm_put(Dst, 4652); 5753 dasm_put(Dst, 4663);
5742#endif 5754#endif
5743 break; 5755 break;
5744 5756
@@ -5750,35 +5762,35 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
5750 case BC_FORI: 5762 case BC_FORI:
5751 case BC_IFORL: 5763 case BC_IFORL:
5752 vk = (op == BC_IFORL || op == BC_JFORL); 5764 vk = (op == BC_IFORL || op == BC_JFORL);
5753 dasm_put(Dst, 4654, FORL_IDX*8, FORL_STEP*8, FORL_STOP*8); 5765 dasm_put(Dst, 4665, FORL_IDX*8, FORL_STEP*8, FORL_STOP*8);
5754 if (!vk) { 5766 if (!vk) {
5755 dasm_put(Dst, 4662); 5767 dasm_put(Dst, 4673);
5756 } 5768 }
5757 if (vk) { 5769 if (vk) {
5758 dasm_put(Dst, 4670, FORL_IDX*8); 5770 dasm_put(Dst, 4681, FORL_IDX*8);
5759 } 5771 }
5760 dasm_put(Dst, 4674, FORL_EXT*8); 5772 dasm_put(Dst, 4685, FORL_EXT*8);
5761 if (op != BC_JFORL) { 5773 if (op != BC_JFORL) {
5762 dasm_put(Dst, 4682, 32-1); 5774 dasm_put(Dst, 4693, 32-1);
5763 if (op == BC_JFORI) { 5775 if (op == BC_JFORI) {
5764 dasm_put(Dst, 4686, -(BCBIAS_J*4 >> 16)); 5776 dasm_put(Dst, 4697, -(BCBIAS_J*4 >> 16));
5765 } else { 5777 } else {
5766 dasm_put(Dst, 4689, -(BCBIAS_J*4 >> 16)); 5778 dasm_put(Dst, 4700, -(BCBIAS_J*4 >> 16));
5767 } 5779 }
5768 } 5780 }
5769 if (op == BC_FORI) { 5781 if (op == BC_FORI) {
5770 dasm_put(Dst, 4692); 5782 dasm_put(Dst, 4703);
5771 } else if (op == BC_IFORL) { 5783 } else if (op == BC_IFORL) {
5772 dasm_put(Dst, 4694); 5784 dasm_put(Dst, 4705);
5773 } else { 5785 } else {
5774 dasm_put(Dst, 4696, BC_JLOOP); 5786 dasm_put(Dst, 4707, BC_JLOOP);
5775 } 5787 }
5776 dasm_put(Dst, 4699); 5788 dasm_put(Dst, 4710);
5777 break; 5789 break;
5778 5790
5779 case BC_ITERL: 5791 case BC_ITERL:
5780#if LJ_HASJIT 5792#if LJ_HASJIT
5781 dasm_put(Dst, 4714); 5793 dasm_put(Dst, 4725);
5782#endif 5794#endif
5783 break; 5795 break;
5784 5796
@@ -5787,40 +5799,40 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
5787 break; 5799 break;
5788#endif 5800#endif
5789 case BC_IITERL: 5801 case BC_IITERL:
5790 dasm_put(Dst, 4716); 5802 dasm_put(Dst, 4727);
5791 if (op == BC_JITERL) { 5803 if (op == BC_JITERL) {
5792 dasm_put(Dst, 4722); 5804 dasm_put(Dst, 4733);
5793 } else { 5805 } else {
5794 dasm_put(Dst, 4724, 32-1, -(BCBIAS_J*4 >> 16)); 5806 dasm_put(Dst, 4735, 32-1, -(BCBIAS_J*4 >> 16));
5795 } 5807 }
5796 dasm_put(Dst, 4731); 5808 dasm_put(Dst, 4742);
5797 break; 5809 break;
5798 5810
5799 case BC_LOOP: 5811 case BC_LOOP:
5800#if LJ_HASJIT 5812#if LJ_HASJIT
5801 dasm_put(Dst, 4743); 5813 dasm_put(Dst, 4754);
5802#endif 5814#endif
5803 break; 5815 break;
5804 5816
5805 case BC_ILOOP: 5817 case BC_ILOOP:
5806 dasm_put(Dst, 4745); 5818 dasm_put(Dst, 4756);
5807 break; 5819 break;
5808 5820
5809 case BC_JLOOP: 5821 case BC_JLOOP:
5810#if LJ_HASJIT 5822#if LJ_HASJIT
5811 dasm_put(Dst, 4756); 5823 dasm_put(Dst, 4767);
5812#endif 5824#endif
5813 break; 5825 break;
5814 5826
5815 case BC_JMP: 5827 case BC_JMP:
5816 dasm_put(Dst, 4758, 32-1, -(BCBIAS_J*4 >> 16)); 5828 dasm_put(Dst, 4769, 32-1, -(BCBIAS_J*4 >> 16));
5817 break; 5829 break;
5818 5830
5819 /* -- Function headers -------------------------------------------------- */ 5831 /* -- Function headers -------------------------------------------------- */
5820 5832
5821 case BC_FUNCF: 5833 case BC_FUNCF:
5822#if LJ_HASJIT 5834#if LJ_HASJIT
5823 dasm_put(Dst, 4774); 5835 dasm_put(Dst, 4785);
5824#endif 5836#endif
5825 case BC_FUNCV: /* NYI: compiled vararg functions. */ 5837 case BC_FUNCV: /* NYI: compiled vararg functions. */
5826 break; 5838 break;
@@ -5830,38 +5842,38 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
5830 break; 5842 break;
5831#endif 5843#endif
5832 case BC_IFUNCF: 5844 case BC_IFUNCF:
5833 dasm_put(Dst, 4776, Dt1(->maxstack), -4+PC2PROTO(numparams), -4+PC2PROTO(k), 31-3); 5845 dasm_put(Dst, 4787, Dt1(->maxstack), -4+PC2PROTO(numparams), -4+PC2PROTO(k), 31-3);
5834 if (op == BC_JFUNCF) { 5846 if (op == BC_JFUNCF) {
5835 dasm_put(Dst, 4794); 5847 dasm_put(Dst, 4805);
5836 } else { 5848 } else {
5837 dasm_put(Dst, 4796); 5849 dasm_put(Dst, 4807);
5838 } 5850 }
5839 dasm_put(Dst, 4805); 5851 dasm_put(Dst, 4816);
5840 break; 5852 break;
5841 5853
5842 case BC_JFUNCV: 5854 case BC_JFUNCV:
5843#if !LJ_HASJIT 5855#if !LJ_HASJIT
5844 break; 5856 break;
5845#endif 5857#endif
5846 dasm_put(Dst, 4811); 5858 dasm_put(Dst, 4822);
5847 break; /* NYI: compiled vararg functions. */ 5859 break; /* NYI: compiled vararg functions. */
5848 5860
5849 case BC_IFUNCV: 5861 case BC_IFUNCV:
5850 dasm_put(Dst, 4813, Dt1(->maxstack), 8+FRAME_VARG, -4+PC2PROTO(k), -4+PC2PROTO(numparams)); 5862 dasm_put(Dst, 4824, Dt1(->maxstack), 8+FRAME_VARG, -4+PC2PROTO(k), -4+PC2PROTO(numparams));
5851 break; 5863 break;
5852 5864
5853 case BC_FUNCC: 5865 case BC_FUNCC:
5854 case BC_FUNCCW: 5866 case BC_FUNCCW:
5855 if (op == BC_FUNCC) { 5867 if (op == BC_FUNCC) {
5856 dasm_put(Dst, 4863, Dt8(->f)); 5868 dasm_put(Dst, 4874, Dt8(->f));
5857 } else { 5869 } else {
5858 dasm_put(Dst, 4866, DISPATCH_GL(wrapf)); 5870 dasm_put(Dst, 4877, DISPATCH_GL(wrapf));
5859 } 5871 }
5860 dasm_put(Dst, 4869, Dt1(->maxstack), Dt1(->base), Dt1(->top), ~LJ_VMST_C); 5872 dasm_put(Dst, 4880, Dt1(->maxstack), Dt1(->base), Dt1(->top), ~LJ_VMST_C);
5861 if (op == BC_FUNCCW) { 5873 if (op == BC_FUNCCW) {
5862 dasm_put(Dst, 4882, Dt8(->f)); 5874 dasm_put(Dst, 4893, Dt8(->f));
5863 } 5875 }
5864 dasm_put(Dst, 4885, DISPATCH_GL(vmstate), Dt1(->top), 31-3, Dt1(->base), ~LJ_VMST_INTERP, DISPATCH_GL(vmstate)); 5876 dasm_put(Dst, 4896, DISPATCH_GL(vmstate), Dt1(->top), 31-3, Dt1(->base), ~LJ_VMST_INTERP, DISPATCH_GL(vmstate));
5865 break; 5877 break;
5866 5878
5867 /* ---------------------------------------------------------------------- */ 5879 /* ---------------------------------------------------------------------- */
@@ -5881,7 +5893,7 @@ static int build_backend(BuildCtx *ctx)
5881 5893
5882 build_subroutines(ctx); 5894 build_subroutines(ctx);
5883 5895
5884 dasm_put(Dst, 4906); 5896 dasm_put(Dst, 4917);
5885 for (op = 0; op < BC__MAX; op++) 5897 for (op = 0; op < BC__MAX; op++)
5886 build_ins(ctx, (BCOp)op, op); 5898 build_ins(ctx, (BCOp)op, op);
5887 5899