aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2011-05-09 22:41:12 +0200
committerMike Pall <mike>2011-05-09 22:41:12 +0200
commit65d9c7cb5ed98bed14c4f5fe40fef6dfe56717b8 (patch)
treebc2716276adbe6122da32cac58c09f472f437d7c /src
parentc8308e2a87e36985bf169529c484d1eb8470c907 (diff)
downloadluajit-65d9c7cb5ed98bed14c4f5fe40fef6dfe56717b8.tar.gz
luajit-65d9c7cb5ed98bed14c4f5fe40fef6dfe56717b8.tar.bz2
luajit-65d9c7cb5ed98bed14c4f5fe40fef6dfe56717b8.zip
ARM: Fix table/userdata equality comparisons in interpreter.
Diffstat (limited to 'src')
-rw-r--r--src/buildvm_arm.dasc4
-rw-r--r--src/buildvm_arm.h818
2 files changed, 464 insertions, 358 deletions
diff --git a/src/buildvm_arm.dasc b/src/buildvm_arm.dasc
index 1cdfc54b..4d30a95b 100644
--- a/src/buildvm_arm.dasc
+++ b/src/buildvm_arm.dasc
@@ -2205,7 +2205,9 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
2205 | mov CARG2, CARG1 2205 | mov CARG2, CARG1
2206 | tst RA, #1<<MM_eq 2206 | tst RA, #1<<MM_eq
2207 | beq ->vmeta_equal // 'no __eq' flag not set? 2207 | beq ->vmeta_equal // 'no __eq' flag not set?
2208 if (!vk) { 2208 if (vk) {
2209 | b <2
2210 } else {
2209 |2: // Branch if different. 2211 |2: // Branch if different.
2210 | sub PC, RB, #0x20000 2212 | sub PC, RB, #0x20000
2211 |1: // Same. 2213 |1: // Same.
diff --git a/src/buildvm_arm.h b/src/buildvm_arm.h
index 9e0b2a55..8189fdb4 100644
--- a/src/buildvm_arm.h
+++ b/src/buildvm_arm.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[5407] = { 15static const unsigned int build_actionlist[5505] = {
160x00010001, 160x00010001,
170x00060014, 170x00060014,
180xe3160000, 180xe3160000,
@@ -2736,7 +2736,25 @@ static const unsigned int build_actionlist[5407] = {
27360xe12fff1e, 27360xe12fff1e,
27370x0006008a, 27370x0006008a,
27380x00000000, 27380x00000000,
27390xe7f001f0, 27390xe5570000,
27400x000d8180,
27410xe3100000,
27420x000a0000,
27430x1a000000,
27440x00050005,
27450xe5171000,
27460x000d8180,
27470xe3100000,
27480x000a0000,
27490x1a000000,
27500x00050001,
27510xe2411001,
27520xe3100000,
27530x000a0000,
27540x15071000,
27550x000d8180,
27560xea000000,
27570x00050001,
27400x00000000, 27580x00000000,
27410x0006008b, 27590x0006008b,
27420xe5570000, 27600xe5570000,
@@ -2800,7 +2818,26 @@ static const unsigned int build_actionlist[5407] = {
28000x0005000e, 28180x0005000e,
28010x0006008e, 28190x0006008e,
28020x00000000, 28200x00000000,
28030xe7f001f0, 28210xe5192008,
28220xe2470000,
28230x000a0000,
28240xe58d6008,
28250xe5122000,
28260x000d8180,
28270xe1a01006,
28280xe5078000,
28290x000d8180,
28300xe5522000,
28310x000d8180,
28320xe5089000,
28330x000d8180,
28340xe0892182,
28350xe5082000,
28360x000d8180,
28370xeb000000,
28380x0003002b,
28390xea000000,
28400x0005000d,
28040x00000000, 28410x00000000,
28050x0006008f, 28420x0006008f,
28060xe1a01006, 28430xe1a01006,
@@ -2822,7 +2859,7 @@ static const unsigned int build_actionlist[5407] = {
28220xe5083000, 28590xe5083000,
28230x000d8180, 28600x000d8180,
28240xeb000000, 28610xeb000000,
28250x0003002b, 28620x0003002c,
28260xe5189000, 28630xe5189000,
28270x000d8180, 28640x000d8180,
28280xe5183000, 28650xe5183000,
@@ -2854,7 +2891,7 @@ static const unsigned int build_actionlist[5407] = {
28540x00060096, 28910x00060096,
28550xe92d401f, 28920xe92d401f,
28560xeb000000, 28930xeb000000,
28570x0003002c, 28940x0003002d,
28580xeb000000, 28950xeb000000,
28590x0003000f, 28960x0003000f,
28600xe1cd20d8, 28970xe1cd20d8,
@@ -2863,7 +2900,7 @@ static const unsigned int build_actionlist[5407] = {
28630xe1cd20d0, 29000xe1cd20d0,
28640xe2211480, 29010xe2211480,
28650xeb000000, 29020xeb000000,
28660x0003002d, 29030x0003002e,
28670xe28dd014, 29040xe28dd014,
28680xe8bd8000, 29050xe8bd8000,
28690x00060097, 29060x00060097,
@@ -2911,14 +2948,14 @@ static const unsigned int build_actionlist[5407] = {
29110xe59dc000, 29480xe59dc000,
29120xe35c0001, 29490xe35c0001,
29130x3a000000, 29500x3a000000,
29140x0003002d,
29150x0a000000,
29160x0003002e, 29510x0003002e,
29520x0a000000,
29530x0003002f,
29170xe35c0003, 29540xe35c0003,
29180x3a000000, 29550x3a000000,
29190x00030021, 29560x00030021,
29200x0a000000, 29570x0a000000,
29210x0003002c, 29580x0003002d,
29220xe35c0005, 29590xe35c0005,
29230x3a000000, 29600x3a000000,
29240x00050096, 29610x00050096,
@@ -3119,6 +3156,9 @@ static const unsigned int build_actionlist[5407] = {
31190x0a000000, 31560x0a000000,
31200x00050039, 31570x00050039,
31210x00000000, 31580x00000000,
31590xea000000,
31600x0005000c,
31610x00000000,
31220x0006000c, 31620x0006000c,
31230xe24c6b80, 31630xe24c6b80,
31240x0006000b, 31640x0006000b,
@@ -3223,7 +3263,7 @@ static const unsigned int build_actionlist[5407] = {
32230xe1cb20d0, 32630xe1cb20d0,
32240x0006000f, 32640x0006000f,
32250xeb000000, 32650xeb000000,
32260x0003002f, 32660x00030030,
32270x00000000, 32670x00000000,
32280x024a6b80, 32680x024a6b80,
32290x00000000, 32690x00000000,
@@ -3460,7 +3500,7 @@ static const unsigned int build_actionlist[5407] = {
34600x0005003e, 35000x0005003e,
34610x00000000, 35010x00000000,
34620xeb000000, 35020xeb000000,
34630x0003002d, 35030x0003002e,
34640xe5d6c000, 35040xe5d6c000,
34650xea000000, 35050xea000000,
34660x0005000e, 35060x0005000e,
@@ -3551,7 +3591,7 @@ static const unsigned int build_actionlist[5407] = {
35510x0005003e, 35910x0005003e,
35520x00000000, 35920x00000000,
35530xeb000000, 35930xeb000000,
35540x0003002e, 35940x0003002f,
35550xe5d6c000, 35950xe5d6c000,
35560xea000000, 35960xea000000,
35570x0005000e, 35970x0005000e,
@@ -3700,7 +3740,7 @@ static const unsigned int build_actionlist[5407] = {
37000x0005003e, 37400x0005003e,
37010x00000000, 37410x00000000,
37020xeb000000, 37420xeb000000,
37030x0003002c, 37430x0003002d,
37040xe5d6c000, 37440xe5d6c000,
37050xe496e004, 37450xe496e004,
37060xe18900fa, 37460xe18900fa,
@@ -3884,7 +3924,7 @@ static const unsigned int build_actionlist[5407] = {
38840xe58d6008, 39240xe58d6008,
38850xe1a021a2, 39250xe1a021a2,
38860xeb000000, 39260xeb000000,
38870x00030030, 39270x00030031,
38880xe5189000, 39280xe5189000,
38890x000d8180, 39290x000d8180,
38900xe3500000, 39300xe3500000,
@@ -4033,11 +4073,11 @@ static const unsigned int build_actionlist[5407] = {
40330x0005000b, 40730x0005000b,
40340xe1a0b009, 40740xe1a0b009,
40350xeb000000, 40750xeb000000,
40360x00030031, 40760x00030032,
40370xe1a0900b, 40770xe1a0900b,
40380x00000000, 40780x00000000,
40390x1b000000, 40790x1b000000,
40400x00030031, 40800x00030032,
40410x00000000, 40810x00000000,
40420xea000000, 40820xea000000,
40430x0005000b, 40830x0005000b,
@@ -4082,11 +4122,11 @@ static const unsigned int build_actionlist[5407] = {
40820x0005000b, 41220x0005000b,
40830xe1a0b009, 41230xe1a0b009,
40840xeb000000, 41240xeb000000,
40850x00030031, 41250x00030032,
40860xe1a0900b, 41260xe1a0900b,
40870x00000000, 41270x00000000,
40880x1b000000, 41280x1b000000,
40890x00030031, 41290x00030032,
40900x00000000, 41300x00000000,
40910xea000000, 41310xea000000,
40920x0005000b, 41320x0005000b,
@@ -4136,7 +4176,7 @@ static const unsigned int build_actionlist[5407] = {
41360xe1a00008, 41760xe1a00008,
41370xe089100a, 41770xe089100a,
41380xeb000000, 41780xeb000000,
41390x00030032, 41790x00030033,
41400xe5189000, 41800xe5189000,
41410x000d8180, 41810x000d8180,
41420x0006000b, 41820x0006000b,
@@ -4155,7 +4195,7 @@ static const unsigned int build_actionlist[5407] = {
41550xe5192008, 41950xe5192008,
41560xe1a00008, 41960xe1a00008,
41570xeb000000, 41970xeb000000,
41580x00030033, 41980x00030034,
41590xe5189000, 41990xe5189000,
41600x000d8180, 42000x000d8180,
41610xe3e01000, 42010xe3e01000,
@@ -4190,11 +4230,11 @@ static const unsigned int build_actionlist[5407] = {
41900xe37b0001, 42300xe37b0001,
41910x02811002, 42310x02811002,
41920xeb000000, 42320xeb000000,
41930x00030034, 42330x00030035,
41940x00000000, 42340x00000000,
41950xe795110b, 42350xe795110b,
41960xeb000000, 42360xeb000000,
41970x00030035, 42370x00030036,
41980x00000000, 42380x00000000,
41990xe5189000, 42390xe5189000,
42000x000d8180, 42400x000d8180,
@@ -4209,7 +4249,7 @@ static const unsigned int build_actionlist[5407] = {
42090xe12fff1c, 42490xe12fff1c,
42100x0006000f, 42500x0006000f,
42110xeb000000, 42510xeb000000,
42120x00030036, 42520x00030037,
42130xe1a00008, 42530xe1a00008,
42140xea000000, 42540xea000000,
42150x0005000b, 42550x0005000b,
@@ -4572,7 +4612,7 @@ static const unsigned int build_actionlist[5407] = {
45720xe1a0100c, 46120xe1a0100c,
45730xe58d3004, 46130xe58d3004,
45740xeb000000, 46140xeb000000,
45750x00030037, 46150x00030038,
45760xe5189000, 46160xe5189000,
45770x000d8180, 46170x000d8180,
45780xe18920da, 46180xe18920da,
@@ -4703,7 +4743,7 @@ static const unsigned int build_actionlist[5407] = {
47030xe1a00008, 47430xe1a00008,
47040xe58d6008, 47440xe58d6008,
47050xeb000000, 47450xeb000000,
47060x00030038, 47460x00030039,
47070x00000000, 47470x00000000,
47080xe5189000, 47480xe5189000,
47090x000d8180, 47490x000d8180,
@@ -5143,9 +5183,18 @@ static const unsigned int build_actionlist[5407] = {
51430xea000000, 51830xea000000,
51440x0005000f, 51840x0005000f,
51450x00000000, 51850x00000000,
51460xe7f001f0, 51860xe1a000a6,
51870xe200007e,
51880xe2400000,
51890x000a0000,
51900xe19710b0,
51910xe2511001,
51920xe18710b0,
51930x0a000000,
51940x0005008e,
51470x00000000, 51950x00000000,
51480xe1aa00d9, 51960xe1aa00d9,
51970x00000000,
51490xe086b10b, 51980xe086b10b,
51500x00000000, 51990x00000000,
51510xe1ca20d8, 52000xe1ca20d8,
@@ -5176,7 +5225,8 @@ static const unsigned int build_actionlist[5407] = {
51760x00000000, 52250x00000000,
51770x6286bb80, 52260x6286bb80,
51780x00000000, 52270x00000000,
51790xe7f001f0, 52280x6a000000,
52290x00050002,
51800x00000000, 52300x00000000,
51810xe3520000, 52310xe3520000,
51820xba000000, 52320xba000000,
@@ -5187,14 +5237,19 @@ static const unsigned int build_actionlist[5407] = {
51870x00000000, 52370x00000000,
51880xc24b6b80, 52380xc24b6b80,
51890x00000000, 52390x00000000,
51900xe7f001f0, 52400xc24b6b80,
52410xe1a0b82e,
52420xda000000,
52430x00070000,
51910x00000000, 52440x00000000,
51920xd24b6b80, 52450xd24b6b80,
51930x00000000, 52460x00000000,
51940xe7f001f0, 52470xda000000,
52480x00070000,
51950x00000000, 52490x00000000,
51960xe1ca00f0, 52500xe1ca00f0,
51970x00000000, 52510x00000000,
52520x0006000c,
51980xe5d6c000, 52530xe5d6c000,
51990xe496e004, 52540xe496e004,
52000xe1ca01f8, 52550xe1ca01f8,
@@ -5229,7 +5284,7 @@ static const unsigned int build_actionlist[5407] = {
52290xba000000, 52840xba000000,
52300x00050008, 52850x00050008,
52310xeb000000, 52860xeb000000,
52320x0003002d, 52870x0003002e,
52330xe1ca00f0, 52880xe1ca00f0,
52340xe1ca20d8, 52890xe1ca20d8,
52350xe1ca01f8, 52900xe1ca01f8,
@@ -5240,11 +5295,15 @@ static const unsigned int build_actionlist[5407] = {
52400x00000000, 52950x00000000,
52410x824b6b80, 52960x824b6b80,
52420x00000000, 52970x00000000,
52430xe7f001f0, 52980x824b6b80,
52990xe1a0b82e,
53000x9a000000,
53010x00070000,
52440x00000000, 53020x00000000,
52450x924b6b80, 53030x924b6b80,
52460x00000000, 53040x00000000,
52470xe7f001f0, 53050x9a000000,
53060x00070000,
52480x00000000, 53070x00000000,
52490xe5d6c000, 53080xe5d6c000,
52500xe496e004, 53090xe496e004,
@@ -5253,7 +5312,7 @@ static const unsigned int build_actionlist[5407] = {
52530x00060012, 53120x00060012,
52540x00000000, 53130x00000000,
52550xeb000000, 53140xeb000000,
52560x0003002d, 53150x0003002e,
52570xe1ca00f0, 53160xe1ca00f0,
52580xe1ca01f8, 53170xe1ca01f8,
52590x00000000, 53180x00000000,
@@ -5263,11 +5322,23 @@ static const unsigned int build_actionlist[5407] = {
52630xea000000, 53220xea000000,
52640x00050010, 53230x00050010,
52650x00000000, 53240x00000000,
52660xe7f001f0, 53250xe1a000a6,
53260xe200007e,
53270xe2400000,
53280x000a0000,
53290xe19710b0,
53300xe2511001,
53310xe18710b0,
53320x0a000000,
53330x0005008e,
52670x00000000, 53340x00000000,
52680xe1aa00d9, 53350xe1aa00d9,
52690x00000000, 53360x00000000,
52700xe7f001f0, 53370xe3710000,
53380x000a0000,
53390x114a00f8,
53400x1a000000,
53410x00070000,
52710x00000000, 53420x00000000,
52720xe086b10b, 53430xe086b10b,
52730xe3710000, 53440xe3710000,
@@ -5282,7 +5353,15 @@ static const unsigned int build_actionlist[5407] = {
52820xe1a0b82e, 53530xe1a0b82e,
52830xe12fff1c, 53540xe12fff1c,
52840x00000000, 53550x00000000,
52850xe7f001f0, 53560xe1a000a6,
53570xe200007e,
53580xe2400000,
53590x000a0000,
53600xe19710b0,
53610xe2511001,
53620xe18710b0,
53630x0a000000,
53640x0005008e,
52860x00000000, 53650x00000000,
52870xe5d6c000, 53660xe5d6c000,
52880xe496e004, 53670xe496e004,
@@ -5291,7 +5370,16 @@ static const unsigned int build_actionlist[5407] = {
52910xe1a0b82e, 53700xe1a0b82e,
52920xe12fff1c, 53710xe12fff1c,
52930x00000000, 53720x00000000,
52940xe7f001f0, 53730xe5170000,
53740x000d8180,
53750xe790b10b,
53760xe51ba000,
53770x000d8180,
53780xe5079000,
53790x000d8180,
53800xe5078000,
53810x000d8180,
53820xe12fff1a,
52950x00000000, 53830x00000000,
52960xe086b10b, 53840xe086b10b,
52970xe24b6b80, 53850xe24b6b80,
@@ -5302,7 +5390,15 @@ static const unsigned int build_actionlist[5407] = {
53020xe1a0b82e, 53900xe1a0b82e,
53030xe12fff1c, 53910xe12fff1c,
53040x00000000, 53920x00000000,
53050xe7f001f0, 53930xe1a000a6,
53940xe200007e,
53950xe2400000,
53960x000a0000,
53970xe19710b0,
53980xe2511001,
53990xe18710b0,
54000x0a000000,
54010x00050090,
53060x00000000, 54020x00000000,
53070xe5180000, 54030xe5180000,
53080x000d8180, 54040x000d8180,
@@ -5322,7 +5418,9 @@ static const unsigned int build_actionlist[5407] = {
53220xda000000, 54180xda000000,
53230x00050003, 54190x00050003,
53240x00000000, 54200x00000000,
53250xe7f001f0, 54210xe1a0b82e,
54220xea000000,
54230x00070000,
53260x00000000, 54240x00000000,
53270xe797c10c, 54250xe797c10c,
53280xe004a2ae, 54260xe004a2ae,
@@ -5762,6 +5860,7 @@ static const char *const extnames[] = {
5762 "lj_tab_len", 5860 "lj_tab_len",
5763 "lj_gc_step", 5861 "lj_gc_step",
5764 "lj_dispatch_ins", 5862 "lj_dispatch_ins",
5863 "lj_trace_hot",
5765 "lj_dispatch_call", 5864 "lj_dispatch_call",
5766 "__aeabi_ddiv", 5865 "__aeabi_ddiv",
5767 "__aeabi_dadd", 5866 "__aeabi_dadd",
@@ -6098,54 +6197,54 @@ static void build_subroutines(BuildCtx *ctx)
6098 dasm_put(Dst, 2626, -LJ_TISNUM, -LJ_TISNUM, ~LJ_TISNUM, Dt1(->maxstack), Dt1(->top), Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->base), Dt1(->top), Dt7(->field_pc), FRAME_TYPE, FRAME_TYPEP); 6197 dasm_put(Dst, 2626, -LJ_TISNUM, -LJ_TISNUM, ~LJ_TISNUM, Dt1(->maxstack), Dt1(->top), Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->base), Dt1(->top), Dt7(->field_pc), FRAME_TYPE, FRAME_TYPEP);
6099 dasm_put(Dst, 2689, LUA_MINSTACK, Dt1(->base), Dt1(->base), Dt1(->top), Dt1(->base)); 6198 dasm_put(Dst, 2689, LUA_MINSTACK, Dt1(->base), Dt1(->base), Dt1(->top), Dt1(->base));
6100#if LJ_HASJIT 6199#if LJ_HASJIT
6101 dasm_put(Dst, 2723); 6200 dasm_put(Dst, 2723, DISPATCH_GL(hookmask), HOOK_VMEVENT, DISPATCH_GL(hookcount), HOOK_ACTIVE, LUA_MASKLINE|LUA_MASKCOUNT, DISPATCH_GL(hookcount));
6102#endif 6201#endif
6103 dasm_put(Dst, 2725, DISPATCH_GL(hookmask), HOOK_ACTIVE, GG_DISP2STATIC, DISPATCH_GL(hookmask), DISPATCH_GL(hookcount), HOOK_ACTIVE, LUA_MASKLINE|LUA_MASKCOUNT, DISPATCH_GL(hookcount), LUA_MASKLINE, Dt1(->base), Dt1(->base)); 6202 dasm_put(Dst, 2743, DISPATCH_GL(hookmask), HOOK_ACTIVE, GG_DISP2STATIC, DISPATCH_GL(hookmask), DISPATCH_GL(hookcount), HOOK_ACTIVE, LUA_MASKLINE|LUA_MASKCOUNT, DISPATCH_GL(hookcount), LUA_MASKLINE, Dt1(->base), Dt1(->base));
6104 dasm_put(Dst, 2771, GG_DISP2STATIC); 6203 dasm_put(Dst, 2789, GG_DISP2STATIC);
6105#if LJ_HASJIT 6204#if LJ_HASJIT
6106 dasm_put(Dst, 2787); 6205 dasm_put(Dst, 2805, -GG_DISP2J, Dt7(->field_pc), DISPATCH_J(L), PC2PROTO(framesize), Dt1(->base), Dt1(->top));
6107#endif 6206#endif
6108 dasm_put(Dst, 2789); 6207 dasm_put(Dst, 2826);
6109#if LJ_HASJIT 6208#if LJ_HASJIT
6110 dasm_put(Dst, 2792); 6209 dasm_put(Dst, 2829);
6111#endif 6210#endif
6112 dasm_put(Dst, 2795); 6211 dasm_put(Dst, 2832);
6113#if LJ_HASJIT 6212#if LJ_HASJIT
6114 dasm_put(Dst, 2797); 6213 dasm_put(Dst, 2834);
6115#endif 6214#endif
6116 dasm_put(Dst, 2800, Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); 6215 dasm_put(Dst, 2837, Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top));
6117#if LJ_HASJIT 6216#if LJ_HASJIT
6118 dasm_put(Dst, 2822); 6217 dasm_put(Dst, 2859);
6119#endif 6218#endif
6120 dasm_put(Dst, 2824); 6219 dasm_put(Dst, 2861);
6121#if LJ_HASJIT 6220#if LJ_HASJIT
6122 dasm_put(Dst, 2826); 6221 dasm_put(Dst, 2863);
6123#endif 6222#endif
6124 dasm_put(Dst, 2828); 6223 dasm_put(Dst, 2865);
6125#if LJ_HASJIT 6224#if LJ_HASJIT
6126 dasm_put(Dst, 2833); 6225 dasm_put(Dst, 2870);
6127#else 6226#else
6128 dasm_put(Dst, 2836); 6227 dasm_put(Dst, 2873);
6129#endif 6228#endif
6130 dasm_put(Dst, 2838); 6229 dasm_put(Dst, 2875);
6131 { 6230 {
6132 int i; 6231 int i;
6133 for (i = 31; i >= 0; i--) { 6232 for (i = 31; i >= 0; i--) {
6134 dasm_put(Dst, 2874, i, i); 6233 dasm_put(Dst, 2911, i, i);
6135 } 6234 }
6136 } 6235 }
6137 dasm_put(Dst, 2879); 6236 dasm_put(Dst, 2916);
6138#if LJ_HASJIT 6237#if LJ_HASJIT
6139 dasm_put(Dst, 2888); 6238 dasm_put(Dst, 2925);
6140#endif 6239#endif
6141 dasm_put(Dst, 2890); 6240 dasm_put(Dst, 2927);
6142#if LJ_HASJIT 6241#if LJ_HASJIT
6143 dasm_put(Dst, 2892); 6242 dasm_put(Dst, 2929);
6144#endif 6243#endif
6145 dasm_put(Dst, 2894); 6244 dasm_put(Dst, 2931);
6146#if LJ_HASFFI 6245#if LJ_HASFFI
6147#define DtE(_V) (int)(ptrdiff_t)&(((CCallState *)0)_V) 6246#define DtE(_V) (int)(ptrdiff_t)&(((CCallState *)0)_V)
6148 dasm_put(Dst, 2918, DtE(->spadj), DtE(->nsp), offsetof(CCallState, stack), DtE(->func), DtE(->gpr[0]), DtE(->gpr[1]), DtE(->gpr[2]), DtE(->gpr[3]), DtE(->gpr[0]), DtE(->gpr[1])); 6247 dasm_put(Dst, 2955, DtE(->spadj), DtE(->nsp), offsetof(CCallState, stack), DtE(->func), DtE(->gpr[0]), DtE(->gpr[1]), DtE(->gpr[2]), DtE(->gpr[3]), DtE(->gpr[0]), DtE(->gpr[1]));
6149#endif 6248#endif
6150} 6249}
6151 6250
@@ -6153,7 +6252,7 @@ static void build_subroutines(BuildCtx *ctx)
6153static void build_ins(BuildCtx *ctx, BCOp op, int defop) 6252static void build_ins(BuildCtx *ctx, BCOp op, int defop)
6154{ 6253{
6155 int vk = 0; 6254 int vk = 0;
6156 dasm_put(Dst, 2956, defop); 6255 dasm_put(Dst, 2993, defop);
6157 6256
6158 switch (op) { 6257 switch (op) {
6159 6258
@@ -6162,576 +6261,578 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
6162 /* Remember: all ops branch for a true comparison, fall through otherwise. */ 6261 /* Remember: all ops branch for a true comparison, fall through otherwise. */
6163 6262
6164 case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: 6263 case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:
6165 dasm_put(Dst, 2958, -LJ_TISNUM, -LJ_TISNUM); 6264 dasm_put(Dst, 2995, -LJ_TISNUM, -LJ_TISNUM);
6166 if (op == BC_ISLT) { 6265 if (op == BC_ISLT) {
6167 dasm_put(Dst, 2974); 6266 dasm_put(Dst, 3011);
6168 } else if (op == BC_ISGE) { 6267 } else if (op == BC_ISGE) {
6169 dasm_put(Dst, 2976); 6268 dasm_put(Dst, 3013);
6170 } else if (op == BC_ISLE) { 6269 } else if (op == BC_ISLE) {
6171 dasm_put(Dst, 2978); 6270 dasm_put(Dst, 3015);
6172 } else { 6271 } else {
6173 dasm_put(Dst, 2980); 6272 dasm_put(Dst, 3017);
6174 } 6273 }
6175 dasm_put(Dst, 2982, -LJ_TISNUM); 6274 dasm_put(Dst, 3019, -LJ_TISNUM);
6176 if (op == BC_ISLT) { 6275 if (op == BC_ISLT) {
6177 dasm_put(Dst, 3018); 6276 dasm_put(Dst, 3055);
6178 } else if (op == BC_ISGE) { 6277 } else if (op == BC_ISGE) {
6179 dasm_put(Dst, 3020); 6278 dasm_put(Dst, 3057);
6180 } else if (op == BC_ISLE) { 6279 } else if (op == BC_ISLE) {
6181 dasm_put(Dst, 3022); 6280 dasm_put(Dst, 3059);
6182 } else { 6281 } else {
6183 dasm_put(Dst, 3024); 6282 dasm_put(Dst, 3061);
6184 } 6283 }
6185 dasm_put(Dst, 3026); 6284 dasm_put(Dst, 3063);
6186 break; 6285 break;
6187 6286
6188 case BC_ISEQV: case BC_ISNEV: 6287 case BC_ISEQV: case BC_ISNEV:
6189 vk = op == BC_ISEQV; 6288 vk = op == BC_ISEQV;
6190 dasm_put(Dst, 3029, -LJ_TISNUM, -LJ_TISNUM); 6289 dasm_put(Dst, 3066, -LJ_TISNUM, -LJ_TISNUM);
6191 if (vk) { 6290 if (vk) {
6192 dasm_put(Dst, 3040); 6291 dasm_put(Dst, 3077);
6193 } else { 6292 } else {
6194 dasm_put(Dst, 3043); 6293 dasm_put(Dst, 3080);
6195 } 6294 }
6196 if (LJ_HASFFI) { 6295 if (LJ_HASFFI) {
6197 dasm_put(Dst, 3046, -LJ_TCDATA, -LJ_TCDATA); 6296 dasm_put(Dst, 3083, -LJ_TCDATA, -LJ_TCDATA);
6198 } 6297 }
6199 dasm_put(Dst, 3053, -LJ_TISPRI); 6298 dasm_put(Dst, 3090, -LJ_TISPRI);
6200 if (vk) { 6299 if (vk) {
6201 dasm_put(Dst, 3062, -LJ_TISTABUD); 6300 dasm_put(Dst, 3099, -LJ_TISTABUD);
6202 } else { 6301 } else {
6203 dasm_put(Dst, 3079, -LJ_TISTABUD); 6302 dasm_put(Dst, 3116, -LJ_TISTABUD);
6204 } 6303 }
6205 dasm_put(Dst, 3086, Dt6(->metatable)); 6304 dasm_put(Dst, 3123, Dt6(->metatable));
6206 if (vk) { 6305 if (vk) {
6207 dasm_put(Dst, 3090); 6306 dasm_put(Dst, 3127);
6208 } else { 6307 } else {
6209 dasm_put(Dst, 3093); 6308 dasm_put(Dst, 3130);
6210 } 6309 }
6211 dasm_put(Dst, 3096, Dt6(->nomm), 1-vk, 1<<MM_eq); 6310 dasm_put(Dst, 3133, Dt6(->nomm), 1-vk, 1<<MM_eq);
6212 if (!vk) { 6311 if (vk) {
6213 dasm_put(Dst, 3106); 6312 dasm_put(Dst, 3143);
6313 } else {
6314 dasm_put(Dst, 3146);
6214 } 6315 }
6215 break; 6316 break;
6216 6317
6217 case BC_ISEQS: case BC_ISNES: 6318 case BC_ISEQS: case BC_ISNES:
6218 vk = op == BC_ISEQS; 6319 vk = op == BC_ISEQS;
6219 dasm_put(Dst, 3116, -LJ_TSTR); 6320 dasm_put(Dst, 3156, -LJ_TSTR);
6220 if (LJ_HASFFI) { 6321 if (LJ_HASFFI) {
6221 dasm_put(Dst, 3125); 6322 dasm_put(Dst, 3165);
6222 } else { 6323 } else {
6223 dasm_put(Dst, 3129); 6324 dasm_put(Dst, 3169);
6224 } 6325 }
6225 if (vk) { 6326 if (vk) {
6226 dasm_put(Dst, 3131); 6327 dasm_put(Dst, 3171);
6227 } else { 6328 } else {
6228 dasm_put(Dst, 3134); 6329 dasm_put(Dst, 3174);
6229 } 6330 }
6230 dasm_put(Dst, 3137); 6331 dasm_put(Dst, 3177);
6231 if (LJ_HASFFI) { 6332 if (LJ_HASFFI) {
6232 dasm_put(Dst, 3144, -LJ_TCDATA); 6333 dasm_put(Dst, 3184, -LJ_TCDATA);
6233 } 6334 }
6234 break; 6335 break;
6235 6336
6236 case BC_ISEQN: case BC_ISNEN: 6337 case BC_ISEQN: case BC_ISNEN:
6237 vk = op == BC_ISEQN; 6338 vk = op == BC_ISEQN;
6238 dasm_put(Dst, 3152); 6339 dasm_put(Dst, 3192);
6239 if (vk) { 6340 if (vk) {
6240 dasm_put(Dst, 3159); 6341 dasm_put(Dst, 3199);
6241 } else { 6342 } else {
6242 dasm_put(Dst, 3161); 6343 dasm_put(Dst, 3201);
6243 } 6344 }
6244 dasm_put(Dst, 3163, -LJ_TISNUM, -LJ_TISNUM); 6345 dasm_put(Dst, 3203, -LJ_TISNUM, -LJ_TISNUM);
6245 if (vk) { 6346 if (vk) {
6246 dasm_put(Dst, 3173); 6347 dasm_put(Dst, 3213);
6247 } else { 6348 } else {
6248 dasm_put(Dst, 3176); 6349 dasm_put(Dst, 3216);
6249 } 6350 }
6250 dasm_put(Dst, 3179); 6351 dasm_put(Dst, 3219);
6251 if (LJ_HASFFI) { 6352 if (LJ_HASFFI) {
6252 dasm_put(Dst, 3188); 6353 dasm_put(Dst, 3228);
6253 } else { 6354 } else {
6254 if (!vk) { 6355 if (!vk) {
6255 dasm_put(Dst, 3191); 6356 dasm_put(Dst, 3231);
6256 } 6357 }
6257 dasm_put(Dst, 3193); 6358 dasm_put(Dst, 3233);
6258 } 6359 }
6259 dasm_put(Dst, 3196, -LJ_TISNUM); 6360 dasm_put(Dst, 3236, -LJ_TISNUM);
6260 if (vk) { 6361 if (vk) {
6261 dasm_put(Dst, 3212); 6362 dasm_put(Dst, 3252);
6262 } else { 6363 } else {
6263 dasm_put(Dst, 3214); 6364 dasm_put(Dst, 3254);
6264 } 6365 }
6265 dasm_put(Dst, 3216); 6366 dasm_put(Dst, 3256);
6266 if (LJ_HASFFI) { 6367 if (LJ_HASFFI) {
6267 dasm_put(Dst, 3219, -LJ_TCDATA); 6368 dasm_put(Dst, 3259, -LJ_TCDATA);
6268 } 6369 }
6269 break; 6370 break;
6270 6371
6271 case BC_ISEQP: case BC_ISNEP: 6372 case BC_ISEQP: case BC_ISNEP:
6272 vk = op == BC_ISEQP; 6373 vk = op == BC_ISEQP;
6273 dasm_put(Dst, 3227); 6374 dasm_put(Dst, 3267);
6274 if (LJ_HASFFI) { 6375 if (LJ_HASFFI) {
6275 dasm_put(Dst, 3233, -LJ_TCDATA); 6376 dasm_put(Dst, 3273, -LJ_TCDATA);
6276 } 6377 }
6277 dasm_put(Dst, 3238); 6378 dasm_put(Dst, 3278);
6278 if (vk) { 6379 if (vk) {
6279 dasm_put(Dst, 3240); 6380 dasm_put(Dst, 3280);
6280 } else { 6381 } else {
6281 dasm_put(Dst, 3242); 6382 dasm_put(Dst, 3282);
6282 } 6383 }
6283 dasm_put(Dst, 3244); 6384 dasm_put(Dst, 3284);
6284 break; 6385 break;
6285 6386
6286 /* -- Unary test and copy ops ------------------------------------------- */ 6387 /* -- Unary test and copy ops ------------------------------------------- */
6287 6388
6288 case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: 6389 case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF:
6289 dasm_put(Dst, 3251, -LJ_TTRUE); 6390 dasm_put(Dst, 3291, -LJ_TTRUE);
6290 if (op == BC_ISTC || op == BC_IST) { 6391 if (op == BC_ISTC || op == BC_IST) {
6291 dasm_put(Dst, 3259); 6392 dasm_put(Dst, 3299);
6292 if (op == BC_ISTC) { 6393 if (op == BC_ISTC) {
6293 dasm_put(Dst, 3261); 6394 dasm_put(Dst, 3301);
6294 } 6395 }
6295 } else { 6396 } else {
6296 dasm_put(Dst, 3263); 6397 dasm_put(Dst, 3303);
6297 if (op == BC_ISFC) { 6398 if (op == BC_ISFC) {
6298 dasm_put(Dst, 3265); 6399 dasm_put(Dst, 3305);
6299 } 6400 }
6300 } 6401 }
6301 dasm_put(Dst, 3267); 6402 dasm_put(Dst, 3307);
6302 break; 6403 break;
6303 6404
6304 /* -- Unary ops --------------------------------------------------------- */ 6405 /* -- Unary ops --------------------------------------------------------- */
6305 6406
6306 case BC_MOV: 6407 case BC_MOV:
6307 dasm_put(Dst, 3274); 6408 dasm_put(Dst, 3314);
6308 break; 6409 break;
6309 case BC_NOT: 6410 case BC_NOT:
6310 dasm_put(Dst, 3284, -LJ_TTRUE, ~LJ_TFALSE, ~LJ_TTRUE); 6411 dasm_put(Dst, 3324, -LJ_TTRUE, ~LJ_TFALSE, ~LJ_TTRUE);
6311 break; 6412 break;
6312 case BC_UNM: 6413 case BC_UNM:
6313 dasm_put(Dst, 3301, -LJ_TISNUM); 6414 dasm_put(Dst, 3341, -LJ_TISNUM);
6314 break; 6415 break;
6315 case BC_LEN: 6416 case BC_LEN:
6316 dasm_put(Dst, 3327, -LJ_TSTR, Dt5(->len), ~LJ_TISNUM, -LJ_TTAB); 6417 dasm_put(Dst, 3367, -LJ_TSTR, Dt5(->len), ~LJ_TISNUM, -LJ_TTAB);
6317 if (LJ_TARGET_OSX) { 6418 if (LJ_TARGET_OSX) {
6318 dasm_put(Dst, 3351); 6419 dasm_put(Dst, 3391);
6319 } 6420 }
6320 dasm_put(Dst, 3353); 6421 dasm_put(Dst, 3393);
6321 if (LJ_TARGET_OSX) { 6422 if (LJ_TARGET_OSX) {
6322 dasm_put(Dst, 3356); 6423 dasm_put(Dst, 3396);
6323 } 6424 }
6324 dasm_put(Dst, 3358); 6425 dasm_put(Dst, 3398);
6325 break; 6426 break;
6326 6427
6327 /* -- Binary ops -------------------------------------------------------- */ 6428 /* -- Binary ops -------------------------------------------------------- */
6328 6429
6329 6430
6330 case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: 6431 case BC_ADDVN: case BC_ADDNV: case BC_ADDVV:
6331 dasm_put(Dst, 3361); 6432 dasm_put(Dst, 3401);
6332 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 6433 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
6333 switch (vk) { 6434 switch (vk) {
6334 case 0: 6435 case 0:
6335 dasm_put(Dst, 3364); 6436 dasm_put(Dst, 3404);
6336 break; 6437 break;
6337 case 1: 6438 case 1:
6338 dasm_put(Dst, 3367); 6439 dasm_put(Dst, 3407);
6339 break; 6440 break;
6340 default: 6441 default:
6341 dasm_put(Dst, 3370); 6442 dasm_put(Dst, 3410);
6342 break; 6443 break;
6343 } 6444 }
6344 dasm_put(Dst, 3373); 6445 dasm_put(Dst, 3413);
6345 if (vk == 1) { 6446 if (vk == 1) {
6346 dasm_put(Dst, 3375, -LJ_TISNUM, -LJ_TISNUM); 6447 dasm_put(Dst, 3415, -LJ_TISNUM, -LJ_TISNUM);
6347 } else { 6448 } else {
6348 dasm_put(Dst, 3380, -LJ_TISNUM, -LJ_TISNUM); 6449 dasm_put(Dst, 3420, -LJ_TISNUM, -LJ_TISNUM);
6349 } 6450 }
6350 dasm_put(Dst, 3385); 6451 dasm_put(Dst, 3425);
6351 switch (vk) { 6452 switch (vk) {
6352 case 0: 6453 case 0:
6353 dasm_put(Dst, 3389); 6454 dasm_put(Dst, 3429);
6354 break; 6455 break;
6355 case 1: 6456 case 1:
6356 dasm_put(Dst, 3392); 6457 dasm_put(Dst, 3432);
6357 break; 6458 break;
6358 default: 6459 default:
6359 dasm_put(Dst, 3395); 6460 dasm_put(Dst, 3435);
6360 break; 6461 break;
6361 } 6462 }
6362 dasm_put(Dst, 3398); 6463 dasm_put(Dst, 3438);
6363 switch (vk) { 6464 switch (vk) {
6364 case 0: 6465 case 0:
6365 if (vk == 1) { 6466 if (vk == 1) {
6366 dasm_put(Dst, 3407, -LJ_TISNUM, -LJ_TISNUM); 6467 dasm_put(Dst, 3447, -LJ_TISNUM, -LJ_TISNUM);
6367 } else { 6468 } else {
6368 dasm_put(Dst, 3412, -LJ_TISNUM, -LJ_TISNUM); 6469 dasm_put(Dst, 3452, -LJ_TISNUM, -LJ_TISNUM);
6369 } 6470 }
6370 dasm_put(Dst, 3417); 6471 dasm_put(Dst, 3457);
6371 break; 6472 break;
6372 case 1: 6473 case 1:
6373 if (vk == 1) { 6474 if (vk == 1) {
6374 dasm_put(Dst, 3420, -LJ_TISNUM, -LJ_TISNUM); 6475 dasm_put(Dst, 3460, -LJ_TISNUM, -LJ_TISNUM);
6375 } else { 6476 } else {
6376 dasm_put(Dst, 3425, -LJ_TISNUM, -LJ_TISNUM); 6477 dasm_put(Dst, 3465, -LJ_TISNUM, -LJ_TISNUM);
6377 } 6478 }
6378 dasm_put(Dst, 3430); 6479 dasm_put(Dst, 3470);
6379 break; 6480 break;
6380 default: 6481 default:
6381 if (vk == 1) { 6482 if (vk == 1) {
6382 dasm_put(Dst, 3433, -LJ_TISNUM, -LJ_TISNUM); 6483 dasm_put(Dst, 3473, -LJ_TISNUM, -LJ_TISNUM);
6383 } else { 6484 } else {
6384 dasm_put(Dst, 3438, -LJ_TISNUM, -LJ_TISNUM); 6485 dasm_put(Dst, 3478, -LJ_TISNUM, -LJ_TISNUM);
6385 } 6486 }
6386 dasm_put(Dst, 3443); 6487 dasm_put(Dst, 3483);
6387 break; 6488 break;
6388 } 6489 }
6389 dasm_put(Dst, 3446); 6490 dasm_put(Dst, 3486);
6390 break; 6491 break;
6391 case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: 6492 case BC_SUBVN: case BC_SUBNV: case BC_SUBVV:
6392 dasm_put(Dst, 3452); 6493 dasm_put(Dst, 3492);
6393 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 6494 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
6394 switch (vk) { 6495 switch (vk) {
6395 case 0: 6496 case 0:
6396 dasm_put(Dst, 3455); 6497 dasm_put(Dst, 3495);
6397 break; 6498 break;
6398 case 1: 6499 case 1:
6399 dasm_put(Dst, 3458); 6500 dasm_put(Dst, 3498);
6400 break; 6501 break;
6401 default: 6502 default:
6402 dasm_put(Dst, 3461); 6503 dasm_put(Dst, 3501);
6403 break; 6504 break;
6404 } 6505 }
6405 dasm_put(Dst, 3464); 6506 dasm_put(Dst, 3504);
6406 if (vk == 1) { 6507 if (vk == 1) {
6407 dasm_put(Dst, 3466, -LJ_TISNUM, -LJ_TISNUM); 6508 dasm_put(Dst, 3506, -LJ_TISNUM, -LJ_TISNUM);
6408 } else { 6509 } else {
6409 dasm_put(Dst, 3471, -LJ_TISNUM, -LJ_TISNUM); 6510 dasm_put(Dst, 3511, -LJ_TISNUM, -LJ_TISNUM);
6410 } 6511 }
6411 dasm_put(Dst, 3476); 6512 dasm_put(Dst, 3516);
6412 switch (vk) { 6513 switch (vk) {
6413 case 0: 6514 case 0:
6414 dasm_put(Dst, 3480); 6515 dasm_put(Dst, 3520);
6415 break; 6516 break;
6416 case 1: 6517 case 1:
6417 dasm_put(Dst, 3483); 6518 dasm_put(Dst, 3523);
6418 break; 6519 break;
6419 default: 6520 default:
6420 dasm_put(Dst, 3486); 6521 dasm_put(Dst, 3526);
6421 break; 6522 break;
6422 } 6523 }
6423 dasm_put(Dst, 3489); 6524 dasm_put(Dst, 3529);
6424 switch (vk) { 6525 switch (vk) {
6425 case 0: 6526 case 0:
6426 if (vk == 1) { 6527 if (vk == 1) {
6427 dasm_put(Dst, 3498, -LJ_TISNUM, -LJ_TISNUM); 6528 dasm_put(Dst, 3538, -LJ_TISNUM, -LJ_TISNUM);
6428 } else { 6529 } else {
6429 dasm_put(Dst, 3503, -LJ_TISNUM, -LJ_TISNUM); 6530 dasm_put(Dst, 3543, -LJ_TISNUM, -LJ_TISNUM);
6430 } 6531 }
6431 dasm_put(Dst, 3508); 6532 dasm_put(Dst, 3548);
6432 break; 6533 break;
6433 case 1: 6534 case 1:
6434 if (vk == 1) { 6535 if (vk == 1) {
6435 dasm_put(Dst, 3511, -LJ_TISNUM, -LJ_TISNUM); 6536 dasm_put(Dst, 3551, -LJ_TISNUM, -LJ_TISNUM);
6436 } else { 6537 } else {
6437 dasm_put(Dst, 3516, -LJ_TISNUM, -LJ_TISNUM); 6538 dasm_put(Dst, 3556, -LJ_TISNUM, -LJ_TISNUM);
6438 } 6539 }
6439 dasm_put(Dst, 3521); 6540 dasm_put(Dst, 3561);
6440 break; 6541 break;
6441 default: 6542 default:
6442 if (vk == 1) { 6543 if (vk == 1) {
6443 dasm_put(Dst, 3524, -LJ_TISNUM, -LJ_TISNUM); 6544 dasm_put(Dst, 3564, -LJ_TISNUM, -LJ_TISNUM);
6444 } else { 6545 } else {
6445 dasm_put(Dst, 3529, -LJ_TISNUM, -LJ_TISNUM); 6546 dasm_put(Dst, 3569, -LJ_TISNUM, -LJ_TISNUM);
6446 } 6547 }
6447 dasm_put(Dst, 3534); 6548 dasm_put(Dst, 3574);
6448 break; 6549 break;
6449 } 6550 }
6450 dasm_put(Dst, 3537); 6551 dasm_put(Dst, 3577);
6451 break; 6552 break;
6452 case BC_MULVN: case BC_MULNV: case BC_MULVV: 6553 case BC_MULVN: case BC_MULNV: case BC_MULVV:
6453 dasm_put(Dst, 3543); 6554 dasm_put(Dst, 3583);
6454 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 6555 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
6455 switch (vk) { 6556 switch (vk) {
6456 case 0: 6557 case 0:
6457 dasm_put(Dst, 3546); 6558 dasm_put(Dst, 3586);
6458 break; 6559 break;
6459 case 1: 6560 case 1:
6460 dasm_put(Dst, 3549); 6561 dasm_put(Dst, 3589);
6461 break; 6562 break;
6462 default: 6563 default:
6463 dasm_put(Dst, 3552); 6564 dasm_put(Dst, 3592);
6464 break; 6565 break;
6465 } 6566 }
6466 dasm_put(Dst, 3555); 6567 dasm_put(Dst, 3595);
6467 if (vk == 1) { 6568 if (vk == 1) {
6468 dasm_put(Dst, 3557, -LJ_TISNUM, -LJ_TISNUM); 6569 dasm_put(Dst, 3597, -LJ_TISNUM, -LJ_TISNUM);
6469 } else { 6570 } else {
6470 dasm_put(Dst, 3562, -LJ_TISNUM, -LJ_TISNUM); 6571 dasm_put(Dst, 3602, -LJ_TISNUM, -LJ_TISNUM);
6471 } 6572 }
6472 dasm_put(Dst, 3567); 6573 dasm_put(Dst, 3607);
6473 switch (vk) { 6574 switch (vk) {
6474 case 0: 6575 case 0:
6475 dasm_put(Dst, 3572); 6576 dasm_put(Dst, 3612);
6476 break; 6577 break;
6477 case 1: 6578 case 1:
6478 dasm_put(Dst, 3575); 6579 dasm_put(Dst, 3615);
6479 break; 6580 break;
6480 default: 6581 default:
6481 dasm_put(Dst, 3578); 6582 dasm_put(Dst, 3618);
6482 break; 6583 break;
6483 } 6584 }
6484 dasm_put(Dst, 3581); 6585 dasm_put(Dst, 3621);
6485 switch (vk) { 6586 switch (vk) {
6486 case 0: 6587 case 0:
6487 if (vk == 1) { 6588 if (vk == 1) {
6488 dasm_put(Dst, 3590, -LJ_TISNUM, -LJ_TISNUM); 6589 dasm_put(Dst, 3630, -LJ_TISNUM, -LJ_TISNUM);
6489 } else { 6590 } else {
6490 dasm_put(Dst, 3595, -LJ_TISNUM, -LJ_TISNUM); 6591 dasm_put(Dst, 3635, -LJ_TISNUM, -LJ_TISNUM);
6491 } 6592 }
6492 dasm_put(Dst, 3600); 6593 dasm_put(Dst, 3640);
6493 break; 6594 break;
6494 case 1: 6595 case 1:
6495 if (vk == 1) { 6596 if (vk == 1) {
6496 dasm_put(Dst, 3603, -LJ_TISNUM, -LJ_TISNUM); 6597 dasm_put(Dst, 3643, -LJ_TISNUM, -LJ_TISNUM);
6497 } else { 6598 } else {
6498 dasm_put(Dst, 3608, -LJ_TISNUM, -LJ_TISNUM); 6599 dasm_put(Dst, 3648, -LJ_TISNUM, -LJ_TISNUM);
6499 } 6600 }
6500 dasm_put(Dst, 3613); 6601 dasm_put(Dst, 3653);
6501 break; 6602 break;
6502 default: 6603 default:
6503 if (vk == 1) { 6604 if (vk == 1) {
6504 dasm_put(Dst, 3616, -LJ_TISNUM, -LJ_TISNUM); 6605 dasm_put(Dst, 3656, -LJ_TISNUM, -LJ_TISNUM);
6505 } else { 6606 } else {
6506 dasm_put(Dst, 3621, -LJ_TISNUM, -LJ_TISNUM); 6607 dasm_put(Dst, 3661, -LJ_TISNUM, -LJ_TISNUM);
6507 } 6608 }
6508 dasm_put(Dst, 3626); 6609 dasm_put(Dst, 3666);
6509 break; 6610 break;
6510 } 6611 }
6511 dasm_put(Dst, 3629); 6612 dasm_put(Dst, 3669);
6512 break; 6613 break;
6513 case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: 6614 case BC_DIVVN: case BC_DIVNV: case BC_DIVVV:
6514 dasm_put(Dst, 3635); 6615 dasm_put(Dst, 3675);
6515 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 6616 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
6516 switch (vk) { 6617 switch (vk) {
6517 case 0: 6618 case 0:
6518 dasm_put(Dst, 3638); 6619 dasm_put(Dst, 3678);
6519 break; 6620 break;
6520 case 1: 6621 case 1:
6521 dasm_put(Dst, 3641); 6622 dasm_put(Dst, 3681);
6522 break; 6623 break;
6523 default: 6624 default:
6524 dasm_put(Dst, 3644); 6625 dasm_put(Dst, 3684);
6525 break; 6626 break;
6526 } 6627 }
6527 switch (vk) { 6628 switch (vk) {
6528 case 0: 6629 case 0:
6529 if (vk == 1) { 6630 if (vk == 1) {
6530 dasm_put(Dst, 3647, -LJ_TISNUM, -LJ_TISNUM); 6631 dasm_put(Dst, 3687, -LJ_TISNUM, -LJ_TISNUM);
6531 } else { 6632 } else {
6532 dasm_put(Dst, 3652, -LJ_TISNUM, -LJ_TISNUM); 6633 dasm_put(Dst, 3692, -LJ_TISNUM, -LJ_TISNUM);
6533 } 6634 }
6534 dasm_put(Dst, 3657); 6635 dasm_put(Dst, 3697);
6535 break; 6636 break;
6536 case 1: 6637 case 1:
6537 if (vk == 1) { 6638 if (vk == 1) {
6538 dasm_put(Dst, 3660, -LJ_TISNUM, -LJ_TISNUM); 6639 dasm_put(Dst, 3700, -LJ_TISNUM, -LJ_TISNUM);
6539 } else { 6640 } else {
6540 dasm_put(Dst, 3665, -LJ_TISNUM, -LJ_TISNUM); 6641 dasm_put(Dst, 3705, -LJ_TISNUM, -LJ_TISNUM);
6541 } 6642 }
6542 dasm_put(Dst, 3670); 6643 dasm_put(Dst, 3710);
6543 break; 6644 break;
6544 default: 6645 default:
6545 if (vk == 1) { 6646 if (vk == 1) {
6546 dasm_put(Dst, 3673, -LJ_TISNUM, -LJ_TISNUM); 6647 dasm_put(Dst, 3713, -LJ_TISNUM, -LJ_TISNUM);
6547 } else { 6648 } else {
6548 dasm_put(Dst, 3678, -LJ_TISNUM, -LJ_TISNUM); 6649 dasm_put(Dst, 3718, -LJ_TISNUM, -LJ_TISNUM);
6549 } 6650 }
6550 dasm_put(Dst, 3683); 6651 dasm_put(Dst, 3723);
6551 break; 6652 break;
6552 } 6653 }
6553 dasm_put(Dst, 3686); 6654 dasm_put(Dst, 3726);
6554 break; 6655 break;
6555 case BC_MODVN: case BC_MODNV: case BC_MODVV: 6656 case BC_MODVN: case BC_MODNV: case BC_MODVV:
6556 dasm_put(Dst, 3696); 6657 dasm_put(Dst, 3736);
6557 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 6658 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
6558 switch (vk) { 6659 switch (vk) {
6559 case 0: 6660 case 0:
6560 dasm_put(Dst, 3699); 6661 dasm_put(Dst, 3739);
6561 break; 6662 break;
6562 case 1: 6663 case 1:
6563 dasm_put(Dst, 3702); 6664 dasm_put(Dst, 3742);
6564 break; 6665 break;
6565 default: 6666 default:
6566 dasm_put(Dst, 3705); 6667 dasm_put(Dst, 3745);
6567 break; 6668 break;
6568 } 6669 }
6569 if (vk == 1) { 6670 if (vk == 1) {
6570 dasm_put(Dst, 3708, -LJ_TISNUM, -LJ_TISNUM); 6671 dasm_put(Dst, 3748, -LJ_TISNUM, -LJ_TISNUM);
6571 } else { 6672 } else {
6572 dasm_put(Dst, 3713, -LJ_TISNUM, -LJ_TISNUM); 6673 dasm_put(Dst, 3753, -LJ_TISNUM, -LJ_TISNUM);
6573 } 6674 }
6574 dasm_put(Dst, 3718); 6675 dasm_put(Dst, 3758);
6575 switch (vk) { 6676 switch (vk) {
6576 case 0: 6677 case 0:
6577 dasm_put(Dst, 3722); 6678 dasm_put(Dst, 3762);
6578 break; 6679 break;
6579 case 1: 6680 case 1:
6580 dasm_put(Dst, 3725); 6681 dasm_put(Dst, 3765);
6581 break; 6682 break;
6582 default: 6683 default:
6583 dasm_put(Dst, 3728); 6684 dasm_put(Dst, 3768);
6584 break; 6685 break;
6585 } 6686 }
6586 dasm_put(Dst, 3731, ~LJ_TISNUM); 6687 dasm_put(Dst, 3771, ~LJ_TISNUM);
6587 switch (vk) { 6688 switch (vk) {
6588 case 0: 6689 case 0:
6589 if (vk == 1) { 6690 if (vk == 1) {
6590 dasm_put(Dst, 3745, -LJ_TISNUM, -LJ_TISNUM); 6691 dasm_put(Dst, 3785, -LJ_TISNUM, -LJ_TISNUM);
6591 } else { 6692 } else {
6592 dasm_put(Dst, 3750, -LJ_TISNUM, -LJ_TISNUM); 6693 dasm_put(Dst, 3790, -LJ_TISNUM, -LJ_TISNUM);
6593 } 6694 }
6594 dasm_put(Dst, 3755); 6695 dasm_put(Dst, 3795);
6595 break; 6696 break;
6596 case 1: 6697 case 1:
6597 if (vk == 1) { 6698 if (vk == 1) {
6598 dasm_put(Dst, 3758, -LJ_TISNUM, -LJ_TISNUM); 6699 dasm_put(Dst, 3798, -LJ_TISNUM, -LJ_TISNUM);
6599 } else { 6700 } else {
6600 dasm_put(Dst, 3763, -LJ_TISNUM, -LJ_TISNUM); 6701 dasm_put(Dst, 3803, -LJ_TISNUM, -LJ_TISNUM);
6601 } 6702 }
6602 dasm_put(Dst, 3768); 6703 dasm_put(Dst, 3808);
6603 break; 6704 break;
6604 default: 6705 default:
6605 if (vk == 1) { 6706 if (vk == 1) {
6606 dasm_put(Dst, 3771, -LJ_TISNUM, -LJ_TISNUM); 6707 dasm_put(Dst, 3811, -LJ_TISNUM, -LJ_TISNUM);
6607 } else { 6708 } else {
6608 dasm_put(Dst, 3776, -LJ_TISNUM, -LJ_TISNUM); 6709 dasm_put(Dst, 3816, -LJ_TISNUM, -LJ_TISNUM);
6609 } 6710 }
6610 dasm_put(Dst, 3781); 6711 dasm_put(Dst, 3821);
6611 break; 6712 break;
6612 } 6713 }
6613 if (LJ_TARGET_OSX) { 6714 if (LJ_TARGET_OSX) {
6614 dasm_put(Dst, 3784); 6715 dasm_put(Dst, 3824);
6615 } 6716 }
6616 dasm_put(Dst, 3786); 6717 dasm_put(Dst, 3826);
6617 if (LJ_TARGET_OSX) { 6718 if (LJ_TARGET_OSX) {
6618 dasm_put(Dst, 3789); 6719 dasm_put(Dst, 3829);
6619 } 6720 }
6620 dasm_put(Dst, 3791); 6721 dasm_put(Dst, 3831);
6621 break; 6722 break;
6622 case BC_POW: 6723 case BC_POW:
6623 dasm_put(Dst, 3794); 6724 dasm_put(Dst, 3834);
6624 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 6725 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
6625 switch (vk) { 6726 switch (vk) {
6626 case 0: 6727 case 0:
6627 dasm_put(Dst, 3797); 6728 dasm_put(Dst, 3837);
6628 break; 6729 break;
6629 case 1: 6730 case 1:
6630 dasm_put(Dst, 3800); 6731 dasm_put(Dst, 3840);
6631 break; 6732 break;
6632 default: 6733 default:
6633 dasm_put(Dst, 3803); 6734 dasm_put(Dst, 3843);
6634 break; 6735 break;
6635 } 6736 }
6636 switch (vk) { 6737 switch (vk) {
6637 case 0: 6738 case 0:
6638 if (vk == 1) { 6739 if (vk == 1) {
6639 dasm_put(Dst, 3806, -LJ_TISNUM, -LJ_TISNUM); 6740 dasm_put(Dst, 3846, -LJ_TISNUM, -LJ_TISNUM);
6640 } else { 6741 } else {
6641 dasm_put(Dst, 3811, -LJ_TISNUM, -LJ_TISNUM); 6742 dasm_put(Dst, 3851, -LJ_TISNUM, -LJ_TISNUM);
6642 } 6743 }
6643 dasm_put(Dst, 3816); 6744 dasm_put(Dst, 3856);
6644 break; 6745 break;
6645 case 1: 6746 case 1:
6646 if (vk == 1) { 6747 if (vk == 1) {
6647 dasm_put(Dst, 3819, -LJ_TISNUM, -LJ_TISNUM); 6748 dasm_put(Dst, 3859, -LJ_TISNUM, -LJ_TISNUM);
6648 } else { 6749 } else {
6649 dasm_put(Dst, 3824, -LJ_TISNUM, -LJ_TISNUM); 6750 dasm_put(Dst, 3864, -LJ_TISNUM, -LJ_TISNUM);
6650 } 6751 }
6651 dasm_put(Dst, 3829); 6752 dasm_put(Dst, 3869);
6652 break; 6753 break;
6653 default: 6754 default:
6654 if (vk == 1) { 6755 if (vk == 1) {
6655 dasm_put(Dst, 3832, -LJ_TISNUM, -LJ_TISNUM); 6756 dasm_put(Dst, 3872, -LJ_TISNUM, -LJ_TISNUM);
6656 } else { 6757 } else {
6657 dasm_put(Dst, 3837, -LJ_TISNUM, -LJ_TISNUM); 6758 dasm_put(Dst, 3877, -LJ_TISNUM, -LJ_TISNUM);
6658 } 6759 }
6659 dasm_put(Dst, 3842); 6760 dasm_put(Dst, 3882);
6660 break; 6761 break;
6661 } 6762 }
6662 if (LJ_TARGET_OSX) { 6763 if (LJ_TARGET_OSX) {
6663 dasm_put(Dst, 3845); 6764 dasm_put(Dst, 3885);
6664 } 6765 }
6665 dasm_put(Dst, 3847); 6766 dasm_put(Dst, 3887);
6666 if (LJ_TARGET_OSX) { 6767 if (LJ_TARGET_OSX) {
6667 dasm_put(Dst, 3850); 6768 dasm_put(Dst, 3890);
6668 } 6769 }
6669 dasm_put(Dst, 3852); 6770 dasm_put(Dst, 3892);
6670 break; 6771 break;
6671 6772
6672 case BC_CAT: 6773 case BC_CAT:
6673 dasm_put(Dst, 3860, Dt1(->base), Dt1(->base)); 6774 dasm_put(Dst, 3900, Dt1(->base), Dt1(->base));
6674 break; 6775 break;
6675 6776
6676 /* -- Constant ops ------------------------------------------------------ */ 6777 /* -- Constant ops ------------------------------------------------------ */
6677 6778
6678 case BC_KSTR: 6779 case BC_KSTR:
6679 dasm_put(Dst, 3886, ~LJ_TSTR); 6780 dasm_put(Dst, 3926, ~LJ_TSTR);
6680 break; 6781 break;
6681 case BC_KCDATA: 6782 case BC_KCDATA:
6682#if LJ_HASFFI 6783#if LJ_HASFFI
6683 dasm_put(Dst, 3898, ~LJ_TCDATA); 6784 dasm_put(Dst, 3938, ~LJ_TCDATA);
6684#endif 6785#endif
6685 break; 6786 break;
6686 case BC_KSHORT: 6787 case BC_KSHORT:
6687 dasm_put(Dst, 3910, ~LJ_TISNUM); 6788 dasm_put(Dst, 3950, ~LJ_TISNUM);
6688 break; 6789 break;
6689 case BC_KNUM: 6790 case BC_KNUM:
6690 dasm_put(Dst, 3921); 6791 dasm_put(Dst, 3961);
6691 break; 6792 break;
6692 case BC_KPRI: 6793 case BC_KPRI:
6693 dasm_put(Dst, 3931); 6794 dasm_put(Dst, 3971);
6694 break; 6795 break;
6695 case BC_KNIL: 6796 case BC_KNIL:
6696 dasm_put(Dst, 3941, ~LJ_TNIL); 6797 dasm_put(Dst, 3981, ~LJ_TNIL);
6697 break; 6798 break;
6698 6799
6699 /* -- Upvalue and function ops ------------------------------------------ */ 6800 /* -- Upvalue and function ops ------------------------------------------ */
6700 6801
6701 case BC_UGET: 6802 case BC_UGET:
6702 dasm_put(Dst, 3960, offsetof(GCfuncL, uvptr), DtA(->v)); 6803 dasm_put(Dst, 4000, offsetof(GCfuncL, uvptr), DtA(->v));
6703 break; 6804 break;
6704 case BC_USETV: 6805 case BC_USETV:
6705 dasm_put(Dst, 3976, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->closed), DtA(->v), LJ_GC_BLACK, -LJ_TISGCV, -(LJ_TISNUM - LJ_TISGCV), Dt4(->gch.marked), -GG_DISP2G, LJ_GC_WHITES); 6806 dasm_put(Dst, 4016, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->closed), DtA(->v), LJ_GC_BLACK, -LJ_TISGCV, -(LJ_TISNUM - LJ_TISGCV), Dt4(->gch.marked), -GG_DISP2G, LJ_GC_WHITES);
6706 if (LJ_TARGET_OSX) { 6807 if (LJ_TARGET_OSX) {
6707 dasm_put(Dst, 4016); 6808 dasm_put(Dst, 4056);
6708 } else { 6809 } else {
6709 dasm_put(Dst, 4023); 6810 dasm_put(Dst, 4063);
6710 } 6811 }
6711 dasm_put(Dst, 4026); 6812 dasm_put(Dst, 4066);
6712 break; 6813 break;
6713 case BC_USETS: 6814 case BC_USETS:
6714 dasm_put(Dst, 4029, offsetof(GCfuncL, uvptr), ~LJ_TSTR, DtA(->marked), DtA(->v), DtA(->closed), LJ_GC_BLACK, Dt5(->marked), LJ_GC_WHITES, -GG_DISP2G); 6815 dasm_put(Dst, 4069, offsetof(GCfuncL, uvptr), ~LJ_TSTR, DtA(->marked), DtA(->v), DtA(->closed), LJ_GC_BLACK, Dt5(->marked), LJ_GC_WHITES, -GG_DISP2G);
6715 if (LJ_TARGET_OSX) { 6816 if (LJ_TARGET_OSX) {
6716 dasm_put(Dst, 4065); 6817 dasm_put(Dst, 4105);
6717 } else { 6818 } else {
6718 dasm_put(Dst, 4072); 6819 dasm_put(Dst, 4112);
6719 } 6820 }
6720 dasm_put(Dst, 4075); 6821 dasm_put(Dst, 4115);
6721 break; 6822 break;
6722 case BC_USETN: 6823 case BC_USETN:
6723 dasm_put(Dst, 4078, offsetof(GCfuncL, uvptr), DtA(->v)); 6824 dasm_put(Dst, 4118, offsetof(GCfuncL, uvptr), DtA(->v));
6724 break; 6825 break;
6725 case BC_USETP: 6826 case BC_USETP:
6726 dasm_put(Dst, 4095, offsetof(GCfuncL, uvptr), DtA(->v)); 6827 dasm_put(Dst, 4135, offsetof(GCfuncL, uvptr), DtA(->v));
6727 break; 6828 break;
6728 6829
6729 case BC_UCLO: 6830 case BC_UCLO:
6730 dasm_put(Dst, 4111, Dt1(->openupval), Dt1(->base), Dt1(->base)); 6831 dasm_put(Dst, 4151, Dt1(->openupval), Dt1(->base), Dt1(->base));
6731 break; 6832 break;
6732 6833
6733 case BC_FNEW: 6834 case BC_FNEW:
6734 dasm_put(Dst, 4134, Dt1(->base), Dt1(->base), ~LJ_TFUNC); 6835 dasm_put(Dst, 4174, Dt1(->base), Dt1(->base), ~LJ_TFUNC);
6735 break; 6836 break;
6736 6837
6737 /* -- Table ops --------------------------------------------------------- */ 6838 /* -- Table ops --------------------------------------------------------- */
@@ -6739,115 +6840,115 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
6739 case BC_TNEW: 6840 case BC_TNEW:
6740 case BC_TDUP: 6841 case BC_TDUP:
6741 if (op == BC_TDUP) { 6842 if (op == BC_TDUP) {
6742 dasm_put(Dst, 4155); 6843 dasm_put(Dst, 4195);
6743 } 6844 }
6744 dasm_put(Dst, 4157, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base)); 6845 dasm_put(Dst, 4197, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base));
6745 if (op == BC_TNEW) { 6846 if (op == BC_TNEW) {
6746 dasm_put(Dst, 4170); 6847 dasm_put(Dst, 4210);
6747 } else { 6848 } else {
6748 dasm_put(Dst, 4179); 6849 dasm_put(Dst, 4219);
6749 } 6850 }
6750 dasm_put(Dst, 4183, Dt1(->base), ~LJ_TTAB); 6851 dasm_put(Dst, 4223, Dt1(->base), ~LJ_TTAB);
6751 break; 6852 break;
6752 6853
6753 case BC_GGET: 6854 case BC_GGET:
6754 case BC_GSET: 6855 case BC_GSET:
6755 dasm_put(Dst, 4201, Dt7(->env)); 6856 dasm_put(Dst, 4241, Dt7(->env));
6756 if (op == BC_GGET) { 6857 if (op == BC_GGET) {
6757 dasm_put(Dst, 4207); 6858 dasm_put(Dst, 4247);
6758 } else { 6859 } else {
6759 dasm_put(Dst, 4210); 6860 dasm_put(Dst, 4250);
6760 } 6861 }
6761 break; 6862 break;
6762 6863
6763 case BC_TGETV: 6864 case BC_TGETV:
6764 dasm_put(Dst, 4213, -LJ_TTAB, -LJ_TISNUM, Dt6(->array), Dt6(->asize), -LJ_TNIL, Dt6(->metatable), Dt6(->nomm), 1<<MM_index, -LJ_TSTR); 6865 dasm_put(Dst, 4253, -LJ_TTAB, -LJ_TISNUM, Dt6(->array), Dt6(->asize), -LJ_TNIL, Dt6(->metatable), Dt6(->nomm), 1<<MM_index, -LJ_TSTR);
6765 break; 6866 break;
6766 case BC_TGETS: 6867 case BC_TGETS:
6767 dasm_put(Dst, 4270, -LJ_TTAB, Dt6(->hmask), Dt5(->hash), Dt6(->node), DtB(->key), DtB(->val), DtB(->next), -LJ_TSTR, -LJ_TNIL, Dt6(->metatable), ~LJ_TNIL, Dt6(->nomm)); 6868 dasm_put(Dst, 4310, -LJ_TTAB, Dt6(->hmask), Dt5(->hash), Dt6(->node), DtB(->key), DtB(->val), DtB(->next), -LJ_TSTR, -LJ_TNIL, Dt6(->metatable), ~LJ_TNIL, Dt6(->nomm));
6768 dasm_put(Dst, 4330, 1<<MM_index); 6869 dasm_put(Dst, 4370, 1<<MM_index);
6769 break; 6870 break;
6770 case BC_TGETB: 6871 case BC_TGETB:
6771 dasm_put(Dst, 4337, -LJ_TTAB, Dt6(->asize), Dt6(->array), -LJ_TNIL, Dt6(->metatable), Dt6(->nomm), 1<<MM_index); 6872 dasm_put(Dst, 4377, -LJ_TTAB, Dt6(->asize), Dt6(->array), -LJ_TNIL, Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
6772 break; 6873 break;
6773 6874
6774 case BC_TSETV: 6875 case BC_TSETV:
6775 dasm_put(Dst, 4380, -LJ_TTAB, -LJ_TISNUM, Dt6(->array), Dt6(->asize), -LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex); 6876 dasm_put(Dst, 4420, -LJ_TTAB, -LJ_TISNUM, Dt6(->array), Dt6(->asize), -LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex);
6776 dasm_put(Dst, 4440, DISPATCH_GL(gc.grayagain), LJ_GC_BLACK, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist), -LJ_TSTR); 6877 dasm_put(Dst, 4480, DISPATCH_GL(gc.grayagain), LJ_GC_BLACK, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist), -LJ_TSTR);
6777 break; 6878 break;
6778 case BC_TSETS: 6879 case BC_TSETS:
6779 dasm_put(Dst, 4461, -LJ_TTAB, Dt6(->hmask), Dt5(->hash), Dt6(->node), Dt6(->nomm), DtB(->key), DtB(->val.it), DtB(->next), -LJ_TSTR, Dt6(->marked), -LJ_TNIL, LJ_GC_BLACK, DtB(->val)); 6880 dasm_put(Dst, 4501, -LJ_TTAB, Dt6(->hmask), Dt5(->hash), Dt6(->node), Dt6(->nomm), DtB(->key), DtB(->val.it), DtB(->next), -LJ_TSTR, Dt6(->marked), -LJ_TNIL, LJ_GC_BLACK, DtB(->val));
6780 dasm_put(Dst, 4519, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, Dt6(->metatable), Dt1(->base), Dt6(->nomm), 1<<MM_newindex, ~LJ_TSTR, Dt1(->base), DISPATCH_GL(gc.grayagain), LJ_GC_BLACK); 6881 dasm_put(Dst, 4559, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, Dt6(->metatable), Dt1(->base), Dt6(->nomm), 1<<MM_newindex, ~LJ_TSTR, Dt1(->base), DISPATCH_GL(gc.grayagain), LJ_GC_BLACK);
6781 dasm_put(Dst, 4572, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); 6882 dasm_put(Dst, 4612, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist));
6782 break; 6883 break;
6783 case BC_TSETB: 6884 case BC_TSETB:
6784 dasm_put(Dst, 4581, -LJ_TTAB, Dt6(->asize), Dt6(->array), -LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DISPATCH_GL(gc.grayagain), LJ_GC_BLACK); 6885 dasm_put(Dst, 4621, -LJ_TTAB, Dt6(->asize), Dt6(->array), -LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DISPATCH_GL(gc.grayagain), LJ_GC_BLACK);
6785 dasm_put(Dst, 4638, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); 6886 dasm_put(Dst, 4678, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist));
6786 break; 6887 break;
6787 6888
6788 case BC_TSETM: 6889 case BC_TSETM:
6789 dasm_put(Dst, 4647, Dt6(->asize), Dt6(->array), Dt6(->marked), LJ_GC_BLACK, Dt1(->base)); 6890 dasm_put(Dst, 4687, Dt6(->asize), Dt6(->array), Dt6(->marked), LJ_GC_BLACK, Dt1(->base));
6790 if (LJ_TARGET_OSX) { 6891 if (LJ_TARGET_OSX) {
6791 dasm_put(Dst, 4692, Dt1(->base)); 6892 dasm_put(Dst, 4732, Dt1(->base));
6792 } 6893 }
6793 dasm_put(Dst, 4695, DISPATCH_GL(gc.grayagain), LJ_GC_BLACK, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); 6894 dasm_put(Dst, 4735, DISPATCH_GL(gc.grayagain), LJ_GC_BLACK, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist));
6794 break; 6895 break;
6795 6896
6796 /* -- Calls and vararg handling ----------------------------------------- */ 6897 /* -- Calls and vararg handling ----------------------------------------- */
6797 6898
6798 case BC_CALLM: 6899 case BC_CALLM:
6799 dasm_put(Dst, 4711); 6900 dasm_put(Dst, 4751);
6800 break; 6901 break;
6801 case BC_CALL: 6902 case BC_CALL:
6802 dasm_put(Dst, 4717, -LJ_TFUNC, Dt7(->field_pc)); 6903 dasm_put(Dst, 4757, -LJ_TFUNC, Dt7(->field_pc));
6803 break; 6904 break;
6804 6905
6805 case BC_CALLMT: 6906 case BC_CALLMT:
6806 dasm_put(Dst, 4737); 6907 dasm_put(Dst, 4777);
6807 break; 6908 break;
6808 case BC_CALLT: 6909 case BC_CALLT:
6809 dasm_put(Dst, 4742, -LJ_TFUNC, Dt7(->ffid), FRAME_TYPE, Dt7(->field_pc), Dt7(->field_pc), PC2PROTO(k), FRAME_VARG, FRAME_TYPEP); 6910 dasm_put(Dst, 4782, -LJ_TFUNC, Dt7(->ffid), FRAME_TYPE, Dt7(->field_pc), Dt7(->field_pc), PC2PROTO(k), FRAME_VARG, FRAME_TYPEP);
6810 dasm_put(Dst, 4803, FRAME_TYPE); 6911 dasm_put(Dst, 4843, FRAME_TYPE);
6811 break; 6912 break;
6812 6913
6813 case BC_ITERC: 6914 case BC_ITERC:
6814 dasm_put(Dst, 4814, -LJ_TFUNC, Dt7(->field_pc)); 6915 dasm_put(Dst, 4854, -LJ_TFUNC, Dt7(->field_pc));
6815 break; 6916 break;
6816 6917
6817 case BC_ITERN: 6918 case BC_ITERN:
6818#if LJ_HASJIT 6919#if LJ_HASJIT
6819#endif 6920#endif
6820 dasm_put(Dst, 4838, Dt6(->asize), Dt6(->array), -LJ_TNIL, ~LJ_TISNUM, Dt6(->hmask), Dt6(->node), DtB(->val), -LJ_TNIL, DtB(->key)); 6921 dasm_put(Dst, 4878, Dt6(->asize), Dt6(->array), -LJ_TNIL, ~LJ_TISNUM, Dt6(->hmask), Dt6(->node), DtB(->val), -LJ_TNIL, DtB(->key));
6821 break; 6922 break;
6822 6923
6823 case BC_ISNEXT: 6924 case BC_ISNEXT:
6824 dasm_put(Dst, 4903, -LJ_TFUNC, Dt8(->ffid), -LJ_TTAB, -LJ_TNIL, FF_next_N, BC_JMP, BC_ITERC); 6925 dasm_put(Dst, 4943, -LJ_TFUNC, Dt8(->ffid), -LJ_TTAB, -LJ_TNIL, FF_next_N, BC_JMP, BC_ITERC);
6825 break; 6926 break;
6826 6927
6827 case BC_VARG: 6928 case BC_VARG:
6828 dasm_put(Dst, 4942, FRAME_VARG, ~LJ_TNIL, Dt1(->maxstack), Dt1(->top), Dt1(->base), Dt1(->base)); 6929 dasm_put(Dst, 4982, FRAME_VARG, ~LJ_TNIL, Dt1(->maxstack), Dt1(->top), Dt1(->base), Dt1(->base));
6829 break; 6930 break;
6830 6931
6831 /* -- Returns ----------------------------------------------------------- */ 6932 /* -- Returns ----------------------------------------------------------- */
6832 6933
6833 case BC_RETM: 6934 case BC_RETM:
6834 dasm_put(Dst, 5014); 6935 dasm_put(Dst, 5054);
6835 break; 6936 break;
6836 6937
6837 case BC_RET: 6938 case BC_RET:
6838 dasm_put(Dst, 5021, FRAME_TYPE, FRAME_VARG, Dt7(->field_pc), PC2PROTO(k), ~LJ_TNIL, FRAME_TYPEP); 6939 dasm_put(Dst, 5061, FRAME_TYPE, FRAME_VARG, Dt7(->field_pc), PC2PROTO(k), ~LJ_TNIL, FRAME_TYPEP);
6839 break; 6940 break;
6840 6941
6841 case BC_RET0: case BC_RET1: 6942 case BC_RET0: case BC_RET1:
6842 dasm_put(Dst, 5086, FRAME_TYPE, FRAME_VARG); 6943 dasm_put(Dst, 5126, FRAME_TYPE, FRAME_VARG);
6843 if (op == BC_RET1) { 6944 if (op == BC_RET1) {
6844 dasm_put(Dst, 5097); 6945 dasm_put(Dst, 5137);
6845 } 6946 }
6846 dasm_put(Dst, 5099); 6947 dasm_put(Dst, 5139);
6847 if (op == BC_RET1) { 6948 if (op == BC_RET1) {
6848 dasm_put(Dst, 5102); 6949 dasm_put(Dst, 5142);
6849 } 6950 }
6850 dasm_put(Dst, 5104, Dt7(->field_pc), PC2PROTO(k), ~LJ_TNIL); 6951 dasm_put(Dst, 5144, Dt7(->field_pc), PC2PROTO(k), ~LJ_TNIL);
6851 break; 6952 break;
6852 6953
6853 /* -- Loops and branches ------------------------------------------------ */ 6954 /* -- Loops and branches ------------------------------------------------ */
@@ -6855,7 +6956,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
6855 6956
6856 case BC_FORL: 6957 case BC_FORL:
6857#if LJ_HASJIT 6958#if LJ_HASJIT
6858 dasm_put(Dst, 5130); 6959 dasm_put(Dst, 5170, -GG_DISP2HOT);
6859#endif 6960#endif
6860 break; 6961 break;
6861 6962
@@ -6867,63 +6968,66 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
6867 case BC_FORI: 6968 case BC_FORI:
6868 case BC_IFORL: 6969 case BC_IFORL:
6869 vk = (op == BC_IFORL || op == BC_JFORL); 6970 vk = (op == BC_IFORL || op == BC_JFORL);
6870 dasm_put(Dst, 5132); 6971 dasm_put(Dst, 5180);
6972 if (op != BC_JFORL) {
6973 dasm_put(Dst, 5182);
6974 }
6871 if (!vk) { 6975 if (!vk) {
6872 dasm_put(Dst, 5135, -LJ_TISNUM, -LJ_TISNUM, -LJ_TISNUM); 6976 dasm_put(Dst, 5184, -LJ_TISNUM, -LJ_TISNUM, -LJ_TISNUM);
6873 } else { 6977 } else {
6874 dasm_put(Dst, 5153, -LJ_TISNUM); 6978 dasm_put(Dst, 5202, -LJ_TISNUM);
6875 if (op == BC_IFORL) { 6979 if (op == BC_IFORL) {
6876 dasm_put(Dst, 5161); 6980 dasm_put(Dst, 5210);
6877 } else { 6981 } else {
6878 dasm_put(Dst, 5163); 6982 dasm_put(Dst, 5212);
6879 } 6983 }
6880 dasm_put(Dst, 5165); 6984 dasm_put(Dst, 5215);
6881 } 6985 }
6882 dasm_put(Dst, 5170); 6986 dasm_put(Dst, 5220);
6883 if (op == BC_FORI) { 6987 if (op == BC_FORI) {
6884 dasm_put(Dst, 5172); 6988 dasm_put(Dst, 5222);
6885 } else if (op == BC_JFORI) { 6989 } else if (op == BC_JFORI) {
6886 dasm_put(Dst, 5174); 6990 dasm_put(Dst, 5224, BC_JLOOP);
6887 } else if (op == BC_IFORL) { 6991 } else if (op == BC_IFORL) {
6888 dasm_put(Dst, 5176); 6992 dasm_put(Dst, 5229);
6889 } else { 6993 } else {
6890 dasm_put(Dst, 5178); 6994 dasm_put(Dst, 5231, BC_JLOOP);
6891 } 6995 }
6892 if (vk) { 6996 if (vk) {
6893 dasm_put(Dst, 5180); 6997 dasm_put(Dst, 5234);
6894 } 6998 }
6895 dasm_put(Dst, 5182); 6999 dasm_put(Dst, 5236);
6896 if (!vk) { 7000 if (!vk) {
6897 dasm_put(Dst, 5192); 7001 dasm_put(Dst, 5247);
6898 } else { 7002 } else {
6899 dasm_put(Dst, 5194); 7003 dasm_put(Dst, 5249);
6900 } 7004 }
6901 dasm_put(Dst, 5196); 7005 dasm_put(Dst, 5251);
6902 if (!vk) { 7006 if (!vk) {
6903 dasm_put(Dst, 5200, -LJ_TISNUM, -LJ_TISNUM); 7007 dasm_put(Dst, 5255, -LJ_TISNUM, -LJ_TISNUM);
6904 } else { 7008 } else {
6905 dasm_put(Dst, 5212); 7009 dasm_put(Dst, 5267);
6906 } 7010 }
6907 dasm_put(Dst, 5221); 7011 dasm_put(Dst, 5276);
6908 if (op == BC_FORI) { 7012 if (op == BC_FORI) {
6909 dasm_put(Dst, 5225); 7013 dasm_put(Dst, 5280);
6910 } else if (op == BC_JFORI) { 7014 } else if (op == BC_JFORI) {
6911 dasm_put(Dst, 5227); 7015 dasm_put(Dst, 5282, BC_JLOOP);
6912 } else if (op == BC_IFORL) { 7016 } else if (op == BC_IFORL) {
6913 dasm_put(Dst, 5229); 7017 dasm_put(Dst, 5287);
6914 } else { 7018 } else {
6915 dasm_put(Dst, 5231); 7019 dasm_put(Dst, 5289, BC_JLOOP);
6916 } 7020 }
6917 dasm_put(Dst, 5233); 7021 dasm_put(Dst, 5292);
6918 if (vk) { 7022 if (vk) {
6919 dasm_put(Dst, 5239); 7023 dasm_put(Dst, 5298);
6920 } 7024 }
6921 dasm_put(Dst, 5244); 7025 dasm_put(Dst, 5303);
6922 break; 7026 break;
6923 7027
6924 case BC_ITERL: 7028 case BC_ITERL:
6925#if LJ_HASJIT 7029#if LJ_HASJIT
6926 dasm_put(Dst, 5250); 7030 dasm_put(Dst, 5309, -GG_DISP2HOT);
6927#endif 7031#endif
6928 break; 7032 break;
6929 7033
@@ -6932,40 +7036,40 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
6932 break; 7036 break;
6933#endif 7037#endif
6934 case BC_IITERL: 7038 case BC_IITERL:
6935 dasm_put(Dst, 5252); 7039 dasm_put(Dst, 5319);
6936 if (op == BC_JITERL) { 7040 if (op == BC_JITERL) {
6937 dasm_put(Dst, 5254); 7041 dasm_put(Dst, 5321, -LJ_TNIL, BC_JLOOP);
6938 } else { 7042 } else {
6939 dasm_put(Dst, 5256, -LJ_TNIL); 7043 dasm_put(Dst, 5327, -LJ_TNIL);
6940 } 7044 }
6941 dasm_put(Dst, 5262); 7045 dasm_put(Dst, 5333);
6942 break; 7046 break;
6943 7047
6944 case BC_LOOP: 7048 case BC_LOOP:
6945#if LJ_HASJIT 7049#if LJ_HASJIT
6946 dasm_put(Dst, 5269); 7050 dasm_put(Dst, 5340, -GG_DISP2HOT);
6947#endif 7051#endif
6948 break; 7052 break;
6949 7053
6950 case BC_ILOOP: 7054 case BC_ILOOP:
6951 dasm_put(Dst, 5271); 7055 dasm_put(Dst, 5350);
6952 break; 7056 break;
6953 7057
6954 case BC_JLOOP: 7058 case BC_JLOOP:
6955#if LJ_HASJIT 7059#if LJ_HASJIT
6956 dasm_put(Dst, 5278); 7060 dasm_put(Dst, 5357, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L));
6957#endif 7061#endif
6958 break; 7062 break;
6959 7063
6960 case BC_JMP: 7064 case BC_JMP:
6961 dasm_put(Dst, 5280); 7065 dasm_put(Dst, 5368);
6962 break; 7066 break;
6963 7067
6964 /* -- Function headers -------------------------------------------------- */ 7068 /* -- Function headers -------------------------------------------------- */
6965 7069
6966 case BC_FUNCF: 7070 case BC_FUNCF:
6967#if LJ_HASJIT 7071#if LJ_HASJIT
6968 dasm_put(Dst, 5289); 7072 dasm_put(Dst, 5377, -GG_DISP2HOT);
6969#endif 7073#endif
6970 case BC_FUNCV: /* NYI: compiled vararg functions. */ 7074 case BC_FUNCV: /* NYI: compiled vararg functions. */
6971 break; 7075 break;
@@ -6975,38 +7079,38 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
6975 break; 7079 break;
6976#endif 7080#endif
6977 case BC_IFUNCF: 7081 case BC_IFUNCF:
6978 dasm_put(Dst, 5291, Dt1(->maxstack), -4+PC2PROTO(numparams), -4+PC2PROTO(k), ~LJ_TNIL); 7082 dasm_put(Dst, 5387, Dt1(->maxstack), -4+PC2PROTO(numparams), -4+PC2PROTO(k), ~LJ_TNIL);
6979 if (op == BC_JFUNCF) { 7083 if (op == BC_JFUNCF) {
6980 dasm_put(Dst, 5309); 7084 dasm_put(Dst, 5405, BC_JLOOP);
6981 } else { 7085 } else {
6982 dasm_put(Dst, 5311); 7086 dasm_put(Dst, 5409);
6983 } 7087 }
6984 dasm_put(Dst, 5316); 7088 dasm_put(Dst, 5414);
6985 break; 7089 break;
6986 7090
6987 case BC_JFUNCV: 7091 case BC_JFUNCV:
6988#if !LJ_HASJIT 7092#if !LJ_HASJIT
6989 break; 7093 break;
6990#endif 7094#endif
6991 dasm_put(Dst, 5322); 7095 dasm_put(Dst, 5420);
6992 break; /* NYI: compiled vararg functions. */ 7096 break; /* NYI: compiled vararg functions. */
6993 7097
6994 case BC_IFUNCV: 7098 case BC_IFUNCV:
6995 dasm_put(Dst, 5324, Dt1(->maxstack), 8+FRAME_VARG, -4+PC2PROTO(k), -4+PC2PROTO(numparams), ~LJ_TNIL); 7099 dasm_put(Dst, 5422, Dt1(->maxstack), 8+FRAME_VARG, -4+PC2PROTO(k), -4+PC2PROTO(numparams), ~LJ_TNIL);
6996 break; 7100 break;
6997 7101
6998 case BC_FUNCC: 7102 case BC_FUNCC:
6999 case BC_FUNCCW: 7103 case BC_FUNCCW:
7000 if (op == BC_FUNCC) { 7104 if (op == BC_FUNCC) {
7001 dasm_put(Dst, 5365, Dt8(->f)); 7105 dasm_put(Dst, 5463, Dt8(->f));
7002 } else { 7106 } else {
7003 dasm_put(Dst, 5368, DISPATCH_GL(wrapf)); 7107 dasm_put(Dst, 5466, DISPATCH_GL(wrapf));
7004 } 7108 }
7005 dasm_put(Dst, 5371, Dt1(->maxstack), Dt1(->base), Dt1(->top)); 7109 dasm_put(Dst, 5469, Dt1(->maxstack), Dt1(->base), Dt1(->top));
7006 if (op == BC_FUNCCW) { 7110 if (op == BC_FUNCCW) {
7007 dasm_put(Dst, 5381, Dt8(->f)); 7111 dasm_put(Dst, 5479, Dt8(->f));
7008 } 7112 }
7009 dasm_put(Dst, 5384, LJ_VMST_C, DISPATCH_GL(vmstate), Dt1(->base), LJ_VMST_INTERP, Dt1(->top), DISPATCH_GL(vmstate)); 7113 dasm_put(Dst, 5482, LJ_VMST_C, DISPATCH_GL(vmstate), Dt1(->base), LJ_VMST_INTERP, Dt1(->top), DISPATCH_GL(vmstate));
7010 break; 7114 break;
7011 7115
7012 /* ---------------------------------------------------------------------- */ 7116 /* ---------------------------------------------------------------------- */
@@ -7026,7 +7130,7 @@ static int build_backend(BuildCtx *ctx)
7026 7130
7027 build_subroutines(ctx); 7131 build_subroutines(ctx);
7028 7132
7029 dasm_put(Dst, 5406); 7133 dasm_put(Dst, 5504);
7030 for (op = 0; op < BC__MAX; op++) 7134 for (op = 0; op < BC__MAX; op++)
7031 build_ins(ctx, (BCOp)op, op); 7135 build_ins(ctx, (BCOp)op, op);
7032 7136