Fix Windows/x86 build and update pregenerated files.

This commit is contained in:
Mike Pall 2011-01-06 23:37:04 +01:00
parent fb0a18ca0b
commit aca1e5b3e6
5 changed files with 1619 additions and 1573 deletions

View File

@ -12,7 +12,7 @@
#define DASM_SECTION_CODE_OP 0 #define DASM_SECTION_CODE_OP 0
#define DASM_SECTION_CODE_SUB 1 #define DASM_SECTION_CODE_SUB 1
#define DASM_MAXSECTION 2 #define DASM_MAXSECTION 2
static const unsigned int build_actionlist[4947] = { static const unsigned int build_actionlist[4950] = {
0x00010001, 0x00010001,
0x00060014, 0x00060014,
0x72000000, 0x72000000,
@ -2804,6 +2804,9 @@ static const unsigned int build_actionlist[4947] = {
0x4e800020, 0x4e800020,
0x0006000c, 0x0006000c,
0x7c810808, 0x7c810808,
0x00060098,
0x00000000,
0x7c810808,
0x00000000, 0x00000000,
0x00080000, 0x00080000,
0x00000000, 0x00000000,
@ -3263,7 +3266,7 @@ static const unsigned int build_actionlist[4947] = {
0x40830000, 0x40830000,
0x0005083c, 0x0005083c,
0x00000000, 0x00000000,
0x00060098, 0x00060099,
0x108caae9, 0x108caae9,
0x48000001, 0x48000001,
0x00050091, 0x00050091,
@ -3301,7 +3304,7 @@ static const unsigned int build_actionlist[4947] = {
0x0005083c, 0x0005083c,
0x00000000, 0x00000000,
0x48000000, 0x48000000,
0x00050098, 0x00050099,
0x00000000, 0x00000000,
0x108e5300, 0x108e5300,
0x10ce5b00, 0x10ce5b00,
@ -3736,10 +3739,10 @@ static const unsigned int build_actionlist[4947] = {
0x7d6f402e, 0x7d6f402e,
0x00000000, 0x00000000,
0x48000000, 0x48000000,
0x00050099, 0x0005009a,
0x00000000, 0x00000000,
0x48000000, 0x48000000,
0x0005009a, 0x0005009b,
0x00000000, 0x00000000,
0x114e5300, 0x114e5300,
0x116e5b00, 0x116e5b00,
@ -3795,7 +3798,7 @@ static const unsigned int build_actionlist[4947] = {
0x0006000f, 0x0006000f,
0x100bba34, 0x100bba34,
0x41800000, 0x41800000,
0x00050899, 0x0005089a,
0x48000000, 0x48000000,
0x0005002e, 0x0005002e,
0x00000000, 0x00000000,
@ -3807,7 +3810,7 @@ static const unsigned int build_actionlist[4947] = {
0x7d6f402e, 0x7d6f402e,
0x40800000, 0x40800000,
0x0005082b, 0x0005082b,
0x00060099, 0x0006009a,
0x800a0000, 0x800a0000,
0x00098200, 0x00098200,
0x810b0000, 0x810b0000,
@ -3974,7 +3977,7 @@ static const unsigned int build_actionlist[4947] = {
0x0006000f, 0x0006000f,
0x100bba34, 0x100bba34,
0x41800000, 0x41800000,
0x0005089a, 0x0005089b,
0x48000000, 0x48000000,
0x00050032, 0x00050032,
0x00060011, 0x00060011,
@ -3999,7 +4002,7 @@ static const unsigned int build_actionlist[4947] = {
0x7d6f402e, 0x7d6f402e,
0x40800000, 0x40800000,
0x0005082f, 0x0005082f,
0x0006009a, 0x0006009b,
0x800a0000, 0x800a0000,
0x00098200, 0x00098200,
0x810b0000, 0x810b0000,
@ -4600,7 +4603,7 @@ static const unsigned int build_actionlist[4947] = {
0x6a080000, 0x6a080000,
0x00090200, 0x00090200,
0x40820000, 0x40820000,
0x0005089b, 0x0005089c,
0x00060017, 0x00060017,
0x80f0fffc, 0x80f0fffc,
0x2c0c0008, 0x2c0c0008,
@ -4651,7 +4654,7 @@ static const unsigned int build_actionlist[4947] = {
0x13494320, 0x13494320,
0x48000000, 0x48000000,
0x0005000f, 0x0005000f,
0x0006009b, 0x0006009c,
0x71090000, 0x71090000,
0x00090200, 0x00090200,
0x40820000, 0x40820000,
@ -4669,7 +4672,7 @@ static const unsigned int build_actionlist[4947] = {
0x6a080000, 0x6a080000,
0x00090200, 0x00090200,
0x40820000, 0x40820000,
0x0005089b, 0x0005089c,
0x80f0fffc, 0x80f0fffc,
0x392efff8, 0x392efff8,
0x54ea5d78, 0x54ea5d78,
@ -5095,6 +5098,7 @@ enum {
GLOB_vm_powi, GLOB_vm_powi,
GLOB_vm_foldfpm, GLOB_vm_foldfpm,
GLOB_vm_foldarith, GLOB_vm_foldarith,
GLOB_vm_ffi_call,
GLOB_BC_MODVN_Z, GLOB_BC_MODVN_Z,
GLOB_BC_TGETS_Z, GLOB_BC_TGETS_Z,
GLOB_BC_TSETS_Z, GLOB_BC_TSETS_Z,
@ -5234,6 +5238,7 @@ static const char *const globnames[] = {
"vm_powi", "vm_powi",
"vm_foldfpm", "vm_foldfpm",
"vm_foldarith", "vm_foldarith",
"vm_ffi_call",
"BC_MODVN_Z", "BC_MODVN_Z",
"BC_TGETS_Z", "BC_TGETS_Z",
"BC_TSETS_Z", "BC_TSETS_Z",
@ -5409,13 +5414,16 @@ static void build_subroutines(BuildCtx *ctx)
dasm_put(Dst, 2728); dasm_put(Dst, 2728);
#endif #endif
dasm_put(Dst, 2730); dasm_put(Dst, 2730);
#if LJ_HASFFI
dasm_put(Dst, 2793);
#endif
} }
/* Generate the code for a single instruction. */ /* Generate the code for a single instruction. */
static void build_ins(BuildCtx *ctx, BCOp op, int defop) static void build_ins(BuildCtx *ctx, BCOp op, int defop)
{ {
int vk = 0; int vk = 0;
dasm_put(Dst, 2792, defop); dasm_put(Dst, 2795, defop);
switch (op) { switch (op) {
@ -5424,112 +5432,112 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
/* Remember: all ops branch for a true comparison, fall through otherwise. */ /* Remember: all ops branch for a true comparison, fall through otherwise. */
case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:
dasm_put(Dst, 2794, -(BCBIAS_J*4 >> 16)); dasm_put(Dst, 2797, -(BCBIAS_J*4 >> 16));
if (op == BC_ISLE || op == BC_ISGT) { if (op == BC_ISLE || op == BC_ISGT) {
dasm_put(Dst, 2808); dasm_put(Dst, 2811);
} }
if (op == BC_ISLT || op == BC_ISLE) { if (op == BC_ISLT || op == BC_ISLE) {
dasm_put(Dst, 2811); dasm_put(Dst, 2814);
} else { } else {
dasm_put(Dst, 2813); dasm_put(Dst, 2816);
} }
dasm_put(Dst, 2815); dasm_put(Dst, 2818);
break; break;
case BC_ISEQV: case BC_ISNEV: case BC_ISEQV: case BC_ISNEV:
vk = op == BC_ISEQV; vk = op == BC_ISEQV;
dasm_put(Dst, 2826, -(BCBIAS_J*4 >> 16)); dasm_put(Dst, 2829, -(BCBIAS_J*4 >> 16));
if (vk) { if (vk) {
dasm_put(Dst, 2840); dasm_put(Dst, 2843);
} else { } else {
dasm_put(Dst, 2842); dasm_put(Dst, 2845);
} }
dasm_put(Dst, 2844, ~LJ_TISPRI, ~LJ_TISTABUD); dasm_put(Dst, 2847, ~LJ_TISPRI, ~LJ_TISTABUD);
if (vk) { if (vk) {
dasm_put(Dst, 2866); dasm_put(Dst, 2869);
} else { } else {
dasm_put(Dst, 2868); dasm_put(Dst, 2871);
} }
dasm_put(Dst, 2870); dasm_put(Dst, 2873);
if (vk) { if (vk) {
dasm_put(Dst, 2872); dasm_put(Dst, 2875);
} else { } else {
dasm_put(Dst, 2874); dasm_put(Dst, 2877);
} }
dasm_put(Dst, 2876, Dt6(->metatable), 1-vk, Dt6(->nomm), 1<<MM_eq); dasm_put(Dst, 2879, Dt6(->metatable), 1-vk, Dt6(->nomm), 1<<MM_eq);
break; break;
case BC_ISEQS: case BC_ISNES: case BC_ISEQS: case BC_ISNES:
vk = op == BC_ISEQS; vk = op == BC_ISEQS;
dasm_put(Dst, 2897, 32-1, -(BCBIAS_J*4 >> 16)); dasm_put(Dst, 2900, 32-1, -(BCBIAS_J*4 >> 16));
if (vk) { if (vk) {
dasm_put(Dst, 2911); dasm_put(Dst, 2914);
} else { } else {
dasm_put(Dst, 2913); dasm_put(Dst, 2916);
} }
dasm_put(Dst, 2915); dasm_put(Dst, 2918);
break; break;
case BC_ISEQN: case BC_ISNEN: case BC_ISEQN: case BC_ISNEN:
vk = op == BC_ISEQN; vk = op == BC_ISEQN;
dasm_put(Dst, 2926, -(BCBIAS_J*4 >> 16)); dasm_put(Dst, 2929, -(BCBIAS_J*4 >> 16));
if (vk) { if (vk) {
dasm_put(Dst, 2940);
} else {
dasm_put(Dst, 2943); dasm_put(Dst, 2943);
} else {
dasm_put(Dst, 2946);
} }
dasm_put(Dst, 2945); dasm_put(Dst, 2948);
if (!vk) { if (!vk) {
dasm_put(Dst, 2957); dasm_put(Dst, 2960);
} }
break; break;
case BC_ISEQP: case BC_ISNEP: case BC_ISEQP: case BC_ISNEP:
vk = op == BC_ISEQP; vk = op == BC_ISEQP;
dasm_put(Dst, 2963, 32-3, -(BCBIAS_J*4 >> 16)); dasm_put(Dst, 2966, 32-3, -(BCBIAS_J*4 >> 16));
if (vk) { if (vk) {
dasm_put(Dst, 2975); dasm_put(Dst, 2978);
} else { } else {
dasm_put(Dst, 2977); dasm_put(Dst, 2980);
} }
dasm_put(Dst, 2979); dasm_put(Dst, 2982);
break; break;
/* -- Unary test and copy ops ------------------------------------------- */ /* -- Unary test and copy ops ------------------------------------------- */
case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF:
dasm_put(Dst, 2990); dasm_put(Dst, 2993);
if (op == BC_IST || op == BC_ISF) { if (op == BC_IST || op == BC_ISF) {
dasm_put(Dst, 2996, -(BCBIAS_J*4 >> 16)); dasm_put(Dst, 2999, -(BCBIAS_J*4 >> 16));
if (op == BC_IST) { if (op == BC_IST) {
dasm_put(Dst, 3001); dasm_put(Dst, 3004);
} else { } else {
dasm_put(Dst, 3003); dasm_put(Dst, 3006);
} }
} else { } else {
if (op == BC_ISTC) { if (op == BC_ISTC) {
dasm_put(Dst, 3005);
} else {
dasm_put(Dst, 3008); dasm_put(Dst, 3008);
} else {
dasm_put(Dst, 3011);
} }
dasm_put(Dst, 3011, -(BCBIAS_J*4 >> 16)); dasm_put(Dst, 3014, -(BCBIAS_J*4 >> 16));
} }
dasm_put(Dst, 3018); dasm_put(Dst, 3021);
break; break;
/* -- Unary ops --------------------------------------------------------- */ /* -- Unary ops --------------------------------------------------------- */
case BC_MOV: case BC_MOV:
dasm_put(Dst, 3029); dasm_put(Dst, 3032);
break; break;
case BC_NOT: case BC_NOT:
dasm_put(Dst, 3042, LJ_TTRUE); dasm_put(Dst, 3045, LJ_TTRUE);
break; break;
case BC_UNM: case BC_UNM:
dasm_put(Dst, 3058); dasm_put(Dst, 3061);
break; break;
case BC_LEN: case BC_LEN:
dasm_put(Dst, 3075, Dt5(->len)); dasm_put(Dst, 3078, Dt5(->len));
break; break;
/* -- Binary ops -------------------------------------------------------- */ /* -- Binary ops -------------------------------------------------------- */
@ -5539,262 +5547,262 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
switch (vk) { switch (vk) {
case 0: case 0:
dasm_put(Dst, 3103); dasm_put(Dst, 3106);
break; break;
case 1: case 1:
dasm_put(Dst, 3109); dasm_put(Dst, 3112);
break; break;
default: default:
dasm_put(Dst, 3115); dasm_put(Dst, 3118);
break; break;
} }
dasm_put(Dst, 3122); dasm_put(Dst, 3125);
break; break;
case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: case BC_SUBVN: case BC_SUBNV: case BC_SUBVV:
vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
switch (vk) { switch (vk) {
case 0: case 0:
dasm_put(Dst, 3135); dasm_put(Dst, 3138);
break; break;
case 1: case 1:
dasm_put(Dst, 3141); dasm_put(Dst, 3144);
break; break;
default: default:
dasm_put(Dst, 3147); dasm_put(Dst, 3150);
break; break;
} }
dasm_put(Dst, 3154); dasm_put(Dst, 3157);
break; break;
case BC_MULVN: case BC_MULNV: case BC_MULVV: case BC_MULVN: case BC_MULNV: case BC_MULVV:
vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
switch (vk) { switch (vk) {
case 0: case 0:
dasm_put(Dst, 3167); dasm_put(Dst, 3170);
break; break;
case 1: case 1:
dasm_put(Dst, 3173); dasm_put(Dst, 3176);
break; break;
default: default:
dasm_put(Dst, 3179); dasm_put(Dst, 3182);
break; break;
} }
dasm_put(Dst, 3186); dasm_put(Dst, 3189);
break; break;
case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: case BC_DIVVN: case BC_DIVNV: case BC_DIVVV:
vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
switch (vk) { switch (vk) {
case 0: case 0:
dasm_put(Dst, 3199); dasm_put(Dst, 3202);
break; break;
case 1: case 1:
dasm_put(Dst, 3205); dasm_put(Dst, 3208);
break; break;
default: default:
dasm_put(Dst, 3211); dasm_put(Dst, 3214);
break; break;
} }
dasm_put(Dst, 3218); dasm_put(Dst, 3221);
break; break;
case BC_MODVN: case BC_MODVN:
vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
switch (vk) { switch (vk) {
case 0: case 0:
dasm_put(Dst, 3231); dasm_put(Dst, 3234);
break; break;
case 1: case 1:
dasm_put(Dst, 3237); dasm_put(Dst, 3240);
break; break;
default: default:
dasm_put(Dst, 3243); dasm_put(Dst, 3246);
break; break;
} }
dasm_put(Dst, 3250); dasm_put(Dst, 3253);
break; break;
case BC_MODNV: case BC_MODVV: case BC_MODNV: case BC_MODVV:
vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
switch (vk) { switch (vk) {
case 0: case 0:
dasm_put(Dst, 3268); dasm_put(Dst, 3271);
break; break;
case 1: case 1:
dasm_put(Dst, 3274); dasm_put(Dst, 3277);
break; break;
default: default:
dasm_put(Dst, 3280); dasm_put(Dst, 3283);
break; break;
} }
dasm_put(Dst, 3287); dasm_put(Dst, 3290);
break; break;
case BC_POW: case BC_POW:
dasm_put(Dst, 3290); dasm_put(Dst, 3293);
break; break;
case BC_CAT: case BC_CAT:
dasm_put(Dst, 3312, Dt1(->base), 32-3, Dt1(->base)); dasm_put(Dst, 3315, Dt1(->base), 32-3, Dt1(->base));
break; break;
/* -- Constant ops ------------------------------------------------------ */ /* -- Constant ops ------------------------------------------------------ */
case BC_KSTR: case BC_KSTR:
dasm_put(Dst, 3342, 32-1); dasm_put(Dst, 3345, 32-1);
break; break;
case BC_KCDATA: case BC_KCDATA:
#if LJ_HASFFI #if LJ_HASFFI
dasm_put(Dst, 3359, 32-1, LJ_TCDATA); dasm_put(Dst, 3362, 32-1, LJ_TCDATA);
#endif #endif
break; break;
case BC_KSHORT: case BC_KSHORT:
dasm_put(Dst, 3378, 32-3); dasm_put(Dst, 3381, 32-3);
break; break;
case BC_KNUM: case BC_KNUM:
dasm_put(Dst, 3394); dasm_put(Dst, 3397);
break; break;
case BC_KPRI: case BC_KPRI:
dasm_put(Dst, 3407, 32-3); dasm_put(Dst, 3410, 32-3);
break; break;
case BC_KNIL: case BC_KNIL:
dasm_put(Dst, 3422); dasm_put(Dst, 3425);
break; break;
/* -- Upvalue and function ops ------------------------------------------ */ /* -- Upvalue and function ops ------------------------------------------ */
case BC_UGET: case BC_UGET:
dasm_put(Dst, 3441, 32-1, offsetof(GCfuncL, uvptr), DtA(->v)); dasm_put(Dst, 3444, 32-1, offsetof(GCfuncL, uvptr), DtA(->v));
break; break;
case BC_USETV: case BC_USETV:
dasm_put(Dst, 3462, 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); dasm_put(Dst, 3465, 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);
break; break;
case BC_USETS: case BC_USETS:
dasm_put(Dst, 3514, 32-1, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, Dt5(->marked), DtA(->closed), LJ_GC_WHITES, GG_DISP2G); dasm_put(Dst, 3517, 32-1, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, Dt5(->marked), DtA(->closed), LJ_GC_WHITES, GG_DISP2G);
break; break;
case BC_USETN: case BC_USETN:
dasm_put(Dst, 3563, 32-1, offsetof(GCfuncL, uvptr), DtA(->v)); dasm_put(Dst, 3566, 32-1, offsetof(GCfuncL, uvptr), DtA(->v));
break; break;
case BC_USETP: case BC_USETP:
dasm_put(Dst, 3584, 32-1, offsetof(GCfuncL, uvptr), 32-3, DtA(->v)); dasm_put(Dst, 3587, 32-1, offsetof(GCfuncL, uvptr), 32-3, DtA(->v));
break; break;
case BC_UCLO: case BC_UCLO:
dasm_put(Dst, 3607, Dt1(->openupval), 32-1, -(BCBIAS_J*4 >> 16), Dt1(->base), Dt1(->base)); dasm_put(Dst, 3610, Dt1(->openupval), 32-1, -(BCBIAS_J*4 >> 16), Dt1(->base), Dt1(->base));
break; break;
case BC_FNEW: case BC_FNEW:
dasm_put(Dst, 3637, 32-1, Dt1(->base), Dt1(->base)); dasm_put(Dst, 3640, 32-1, Dt1(->base), Dt1(->base));
break; break;
/* -- Table ops --------------------------------------------------------- */ /* -- Table ops --------------------------------------------------------- */
case BC_TNEW: case BC_TNEW:
case BC_TDUP: case BC_TDUP:
dasm_put(Dst, 3663, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base)); dasm_put(Dst, 3666, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base));
if (op == BC_TNEW) { if (op == BC_TNEW) {
dasm_put(Dst, 3676); dasm_put(Dst, 3679);
} else { } else {
dasm_put(Dst, 3684, 32-1); dasm_put(Dst, 3687, 32-1);
} }
dasm_put(Dst, 3691, Dt1(->base)); dasm_put(Dst, 3694, Dt1(->base));
break; break;
case BC_GGET: case BC_GGET:
case BC_GSET: case BC_GSET:
dasm_put(Dst, 3714, 32-1, Dt7(->env)); dasm_put(Dst, 3717, 32-1, Dt7(->env));
if (op == BC_GGET) { if (op == BC_GGET) {
dasm_put(Dst, 3722);
} else {
dasm_put(Dst, 3725); dasm_put(Dst, 3725);
} else {
dasm_put(Dst, 3728);
} }
break; break;
case BC_TGETV: case BC_TGETV:
dasm_put(Dst, 3728, Dt6(->asize), Dt6(->array), 31-3, Dt6(->metatable), Dt6(->nomm), 1<<MM_index); dasm_put(Dst, 3731, Dt6(->asize), Dt6(->array), 31-3, Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
break; break;
case BC_TGETS: case BC_TGETS:
dasm_put(Dst, 3786, 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); dasm_put(Dst, 3789, 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);
dasm_put(Dst, 3850); dasm_put(Dst, 3853);
break; break;
case BC_TGETB: case BC_TGETB:
dasm_put(Dst, 3855, 32-3, Dt6(->asize), Dt6(->array), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); dasm_put(Dst, 3858, 32-3, Dt6(->asize), Dt6(->array), Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
break; break;
case BC_TSETV: case BC_TSETV:
dasm_put(Dst, 3899, Dt6(->asize), Dt6(->array), 31-3, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex); dasm_put(Dst, 3902, Dt6(->asize), Dt6(->array), 31-3, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex);
dasm_put(Dst, 3966, DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); dasm_put(Dst, 3969, DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist));
break; break;
case BC_TSETS: case BC_TSETS:
dasm_put(Dst, 3978, 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)); dasm_put(Dst, 3981, 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));
dasm_put(Dst, 4039, 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)); dasm_put(Dst, 4042, 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));
dasm_put(Dst, 4090, Dt6(->marked), Dt6(->gclist)); dasm_put(Dst, 4093, Dt6(->marked), Dt6(->gclist));
break; break;
case BC_TSETB: case BC_TSETB:
dasm_put(Dst, 4097, 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)); dasm_put(Dst, 4100, 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));
dasm_put(Dst, 4157, Dt6(->gclist)); dasm_put(Dst, 4160, Dt6(->gclist));
break; break;
case BC_TSETM: case BC_TSETM:
dasm_put(Dst, 4162, 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)); dasm_put(Dst, 4165, 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));
dasm_put(Dst, 4231); dasm_put(Dst, 4234);
break; break;
/* -- Calls and vararg handling ----------------------------------------- */ /* -- Calls and vararg handling ----------------------------------------- */
case BC_CALLM: case BC_CALLM:
dasm_put(Dst, 4234); dasm_put(Dst, 4237);
break; break;
case BC_CALL: case BC_CALL:
dasm_put(Dst, 4236, Dt7(->pc)); dasm_put(Dst, 4239, Dt7(->pc));
break; break;
case BC_CALLMT: case BC_CALLMT:
dasm_put(Dst, 4256); dasm_put(Dst, 4259);
break; break;
case BC_CALLT: case BC_CALLT:
dasm_put(Dst, 4258, FRAME_TYPE, Dt7(->ffid), FRAME_VARG, Dt7(->pc), -4-8, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP); dasm_put(Dst, 4261, FRAME_TYPE, Dt7(->ffid), FRAME_VARG, Dt7(->pc), -4-8, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP);
dasm_put(Dst, 4323, FRAME_TYPE); dasm_put(Dst, 4326, FRAME_TYPE);
break; break;
case BC_ITERC: case BC_ITERC:
dasm_put(Dst, 4330, Dt7(->pc)); dasm_put(Dst, 4333, Dt7(->pc));
break; break;
case BC_ITERN: case BC_ITERN:
#if LJ_HASJIT #if LJ_HASJIT
#endif #endif
dasm_put(Dst, 4356, Dt6(->asize), Dt6(->array), 31-3, -(BCBIAS_J*4 >> 16), Dt6(->hmask), Dt6(->node), 31-5, 31-3, DtB(->key), -(BCBIAS_J*4 >> 16)); dasm_put(Dst, 4359, Dt6(->asize), Dt6(->array), 31-3, -(BCBIAS_J*4 >> 16), Dt6(->hmask), Dt6(->node), 31-5, 31-3, DtB(->key), -(BCBIAS_J*4 >> 16));
dasm_put(Dst, 4435); dasm_put(Dst, 4438);
break; break;
case BC_ISNEXT: case BC_ISNEXT:
dasm_put(Dst, 4439, 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)); dasm_put(Dst, 4442, 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));
break; break;
case BC_VARG: case BC_VARG:
dasm_put(Dst, 4490, FRAME_VARG, Dt1(->maxstack), Dt1(->top), Dt1(->base), 32-3, Dt1(->base)); dasm_put(Dst, 4493, FRAME_VARG, Dt1(->maxstack), Dt1(->top), Dt1(->base), 32-3, Dt1(->base));
dasm_put(Dst, 4570); dasm_put(Dst, 4573);
break; break;
/* -- Returns ----------------------------------------------------------- */ /* -- Returns ----------------------------------------------------------- */
case BC_RETM: case BC_RETM:
dasm_put(Dst, 4576); dasm_put(Dst, 4579);
break; break;
case BC_RET: case BC_RET:
dasm_put(Dst, 4578, FRAME_TYPE, FRAME_VARG, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP); dasm_put(Dst, 4581, FRAME_TYPE, FRAME_VARG, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP);
break; break;
case BC_RET0: case BC_RET1: case BC_RET0: case BC_RET1:
dasm_put(Dst, 4648, FRAME_TYPE, FRAME_VARG); dasm_put(Dst, 4651, FRAME_TYPE, FRAME_VARG);
if (op == BC_RET1) { if (op == BC_RET1) {
dasm_put(Dst, 4661); dasm_put(Dst, 4664);
} }
dasm_put(Dst, 4664, Dt7(->pc), PC2PROTO(k)); dasm_put(Dst, 4667, Dt7(->pc), PC2PROTO(k));
break; break;
/* -- Loops and branches ------------------------------------------------ */ /* -- Loops and branches ------------------------------------------------ */
case BC_FORL: case BC_FORL:
#if LJ_HASJIT #if LJ_HASJIT
dasm_put(Dst, 4692); dasm_put(Dst, 4695);
#endif #endif
break; break;
@ -5806,35 +5814,35 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
case BC_FORI: case BC_FORI:
case BC_IFORL: case BC_IFORL:
vk = (op == BC_IFORL || op == BC_JFORL); vk = (op == BC_IFORL || op == BC_JFORL);
dasm_put(Dst, 4694, FORL_IDX*8, FORL_STEP*8, FORL_STOP*8); dasm_put(Dst, 4697, FORL_IDX*8, FORL_STEP*8, FORL_STOP*8);
if (!vk) { if (!vk) {
dasm_put(Dst, 4702); dasm_put(Dst, 4705);
} }
if (vk) { if (vk) {
dasm_put(Dst, 4710, FORL_IDX*8); dasm_put(Dst, 4713, FORL_IDX*8);
} }
dasm_put(Dst, 4714, FORL_EXT*8); dasm_put(Dst, 4717, FORL_EXT*8);
if (op != BC_JFORL) { if (op != BC_JFORL) {
dasm_put(Dst, 4722, 32-1); dasm_put(Dst, 4725, 32-1);
if (op == BC_JFORI) { if (op == BC_JFORI) {
dasm_put(Dst, 4726, -(BCBIAS_J*4 >> 16));
} else {
dasm_put(Dst, 4729, -(BCBIAS_J*4 >> 16)); dasm_put(Dst, 4729, -(BCBIAS_J*4 >> 16));
} else {
dasm_put(Dst, 4732, -(BCBIAS_J*4 >> 16));
} }
} }
if (op == BC_FORI) { if (op == BC_FORI) {
dasm_put(Dst, 4732); dasm_put(Dst, 4735);
} else if (op == BC_IFORL) { } else if (op == BC_IFORL) {
dasm_put(Dst, 4734); dasm_put(Dst, 4737);
} else { } else {
dasm_put(Dst, 4736, BC_JLOOP); dasm_put(Dst, 4739, BC_JLOOP);
} }
dasm_put(Dst, 4739); dasm_put(Dst, 4742);
break; break;
case BC_ITERL: case BC_ITERL:
#if LJ_HASJIT #if LJ_HASJIT
dasm_put(Dst, 4754); dasm_put(Dst, 4757);
#endif #endif
break; break;
@ -5843,40 +5851,40 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
break; break;
#endif #endif
case BC_IITERL: case BC_IITERL:
dasm_put(Dst, 4756); dasm_put(Dst, 4759);
if (op == BC_JITERL) { if (op == BC_JITERL) {
dasm_put(Dst, 4762); dasm_put(Dst, 4765);
} else { } else {
dasm_put(Dst, 4764, 32-1, -(BCBIAS_J*4 >> 16)); dasm_put(Dst, 4767, 32-1, -(BCBIAS_J*4 >> 16));
} }
dasm_put(Dst, 4771); dasm_put(Dst, 4774);
break; break;
case BC_LOOP: case BC_LOOP:
#if LJ_HASJIT #if LJ_HASJIT
dasm_put(Dst, 4783); dasm_put(Dst, 4786);
#endif #endif
break; break;
case BC_ILOOP: case BC_ILOOP:
dasm_put(Dst, 4785); dasm_put(Dst, 4788);
break; break;
case BC_JLOOP: case BC_JLOOP:
#if LJ_HASJIT #if LJ_HASJIT
dasm_put(Dst, 4796); dasm_put(Dst, 4799);
#endif #endif
break; break;
case BC_JMP: case BC_JMP:
dasm_put(Dst, 4798, 32-1, -(BCBIAS_J*4 >> 16)); dasm_put(Dst, 4801, 32-1, -(BCBIAS_J*4 >> 16));
break; break;
/* -- Function headers -------------------------------------------------- */ /* -- Function headers -------------------------------------------------- */
case BC_FUNCF: case BC_FUNCF:
#if LJ_HASJIT #if LJ_HASJIT
dasm_put(Dst, 4814); dasm_put(Dst, 4817);
#endif #endif
case BC_FUNCV: /* NYI: compiled vararg functions. */ case BC_FUNCV: /* NYI: compiled vararg functions. */
break; break;
@ -5886,38 +5894,38 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
break; break;
#endif #endif
case BC_IFUNCF: case BC_IFUNCF:
dasm_put(Dst, 4816, Dt1(->maxstack), -4+PC2PROTO(numparams), -4+PC2PROTO(k), 31-3); dasm_put(Dst, 4819, Dt1(->maxstack), -4+PC2PROTO(numparams), -4+PC2PROTO(k), 31-3);
if (op == BC_JFUNCF) { if (op == BC_JFUNCF) {
dasm_put(Dst, 4834); dasm_put(Dst, 4837);
} else { } else {
dasm_put(Dst, 4836); dasm_put(Dst, 4839);
} }
dasm_put(Dst, 4845); dasm_put(Dst, 4848);
break; break;
case BC_JFUNCV: case BC_JFUNCV:
#if !LJ_HASJIT #if !LJ_HASJIT
break; break;
#endif #endif
dasm_put(Dst, 4851); dasm_put(Dst, 4854);
break; /* NYI: compiled vararg functions. */ break; /* NYI: compiled vararg functions. */
case BC_IFUNCV: case BC_IFUNCV:
dasm_put(Dst, 4853, Dt1(->maxstack), 8+FRAME_VARG, -4+PC2PROTO(k), -4+PC2PROTO(numparams)); dasm_put(Dst, 4856, Dt1(->maxstack), 8+FRAME_VARG, -4+PC2PROTO(k), -4+PC2PROTO(numparams));
break; break;
case BC_FUNCC: case BC_FUNCC:
case BC_FUNCCW: case BC_FUNCCW:
if (op == BC_FUNCC) { if (op == BC_FUNCC) {
dasm_put(Dst, 4903, Dt8(->f)); dasm_put(Dst, 4906, Dt8(->f));
} else { } else {
dasm_put(Dst, 4906, DISPATCH_GL(wrapf)); dasm_put(Dst, 4909, DISPATCH_GL(wrapf));
} }
dasm_put(Dst, 4909, Dt1(->maxstack), Dt1(->base), Dt1(->top), ~LJ_VMST_C); dasm_put(Dst, 4912, Dt1(->maxstack), Dt1(->base), Dt1(->top), ~LJ_VMST_C);
if (op == BC_FUNCCW) { if (op == BC_FUNCCW) {
dasm_put(Dst, 4922, Dt8(->f)); dasm_put(Dst, 4925, Dt8(->f));
} }
dasm_put(Dst, 4925, DISPATCH_GL(vmstate), Dt1(->top), 31-3, Dt1(->base), ~LJ_VMST_INTERP, DISPATCH_GL(vmstate)); dasm_put(Dst, 4928, DISPATCH_GL(vmstate), Dt1(->top), 31-3, Dt1(->base), ~LJ_VMST_INTERP, DISPATCH_GL(vmstate));
break; break;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -5937,7 +5945,7 @@ static int build_backend(BuildCtx *ctx)
build_subroutines(ctx); build_subroutines(ctx);
dasm_put(Dst, 4946); dasm_put(Dst, 4949);
for (op = 0; op < BC__MAX; op++) for (op = 0; op < BC__MAX; op++)
build_ins(ctx, (BCOp)op, op); build_ins(ctx, (BCOp)op, op);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -3412,7 +3412,7 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
|//-- FFI helper functions ----------------------------------------------- |//-- FFI helper functions -----------------------------------------------
|//----------------------------------------------------------------------- |//-----------------------------------------------------------------------
| |
|->vm_ffi_call: |->vm_ffi_call@4:
#if LJ_HASFFI #if LJ_HASFFI
|.if X64 |.if X64
| .type CCSTATE, CCallState, rbx | .type CCSTATE, CCallState, rbx

File diff suppressed because it is too large Load Diff