aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2010-02-08 20:17:34 +0100
committerMike Pall <mike>2010-02-08 20:17:34 +0100
commitd5a46621f9d1299a7e5c06c59dfc02d61dc04a79 (patch)
tree633176c0dcd40cf0f67acd27f67c1338cb435e8f /src
parent2ddea3838d476975453973a8164f99699dd78ee0 (diff)
downloadluajit-d5a46621f9d1299a7e5c06c59dfc02d61dc04a79.tar.gz
luajit-d5a46621f9d1299a7e5c06c59dfc02d61dc04a79.tar.bz2
luajit-d5a46621f9d1299a7e5c06c59dfc02d61dc04a79.zip
Drop bc field in GCproto since the bytecode is colocated.
Diffstat (limited to 'src')
-rw-r--r--src/buildvm_x64.h12
-rw-r--r--src/buildvm_x64win.h12
-rw-r--r--src/buildvm_x86.dasc6
-rw-r--r--src/buildvm_x86.h12
-rw-r--r--src/lib_jit.c2
-rw-r--r--src/lj_obj.h7
-rw-r--r--src/lj_parse.c1
7 files changed, 23 insertions, 29 deletions
diff --git a/src/buildvm_x64.h b/src/buildvm_x64.h
index 615b9b82..9ce79dd7 100644
--- a/src/buildvm_x64.h
+++ b/src/buildvm_x64.h
@@ -13,7 +13,7 @@
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 char build_actionlist[13633] = { 15static const unsigned char build_actionlist[13633] = {
16 254,1,248,10,137,202,139,173,233,137,90,252,252,15,182,141,233,139,157,233, 16 254,1,248,10,137,202,139,173,233,137,90,252,252,15,182,141,233,141,157,233,
17 68,139,189,233,139,108,36,16,141,12,202,141,68,194,252,252,59,141,233,15, 17 68,139,189,233,139,108,36,16,141,12,202,141,68,194,252,252,59,141,233,15,
18 135,244,11,248,9,189,237,248,1,137,40,137,104,8,131,192,16,57,200,15,130, 18 135,244,11,248,9,189,237,248,1,137,40,137,104,8,131,192,16,57,200,15,130,
19 244,1,255,139,3,15,182,204,15,182,232,131,195,4,193,232,16,65,252,255,36, 19 244,1,255,139,3,15,182,204,15,182,232,131,195,4,193,232,16,65,252,255,36,
@@ -22,7 +22,7 @@ static const unsigned char build_actionlist[13633] = {
22 141,66,4,68,59,187,233,15,135,244,13,15,182,157,233,133,219,15,132,244,248, 22 141,66,4,68,59,187,233,15,135,244,13,15,182,157,233,133,219,15,132,244,248,
23 248,1,131,193,8,57,209,15,131,244,248,68,139,121,252,248,68,137,120,252,252, 23 248,1,131,193,8,57,209,15,131,244,248,68,139,121,252,248,68,137,120,252,252,
24 68,139,121,252,252,68,137,56,131,192,8,199,65,252,252,237,131,252,235,1,15, 24 68,139,121,252,252,68,137,56,131,192,8,199,65,252,252,237,131,252,235,1,15,
25 133,244,1,248,2,15,182,141,233,139,157,233,255,68,139,189,233,141,12,202, 25 133,244,1,248,2,15,182,141,233,141,157,233,255,68,139,189,233,141,12,202,
26 252,233,244,9,248,14,137,89,252,252,76,139,189,233,139,108,36,16,141,68,193, 26 252,233,244,9,248,14,137,89,252,252,76,139,189,233,139,108,36,16,141,68,193,
27 252,248,137,141,233,141,136,233,137,133,233,59,141,233,76,137,252,254,137, 27 252,248,137,141,233,141,136,233,137,133,233,59,141,233,76,137,252,254,137,
28 252,239,15,135,244,15,65,199,134,233,237,65,252,255,150,233,65,199,134,233, 28 252,239,15,135,244,15,65,199,134,233,237,65,252,255,150,233,65,199,134,233,
@@ -47,7 +47,7 @@ static const unsigned char build_actionlist[13633] = {
47 198,239,139,90,252,252,199,66,252,252,237,65,199,134,233,237,255,252,233, 47 198,239,139,90,252,252,199,66,252,252,237,65,199,134,233,237,255,252,233,
48 244,16,248,20,252,247,195,237,15,132,244,27,131,227,252,248,41,218,72,141, 48 244,16,248,20,252,247,195,237,15,132,244,27,131,227,252,248,41,218,72,141,
49 76,25,252,248,139,90,252,252,199,68,10,4,237,252,233,244,16,248,15,190,237, 49 76,25,252,248,139,90,252,252,199,68,10,4,237,252,233,244,16,248,15,190,237,
50 252,233,244,247,248,13,131,232,8,137,202,68,137,252,249,139,157,233,139,108, 50 252,233,244,247,248,13,131,232,8,137,202,68,137,252,249,141,157,233,139,108,
51 36,16,248,11,131,232,4,41,209,193,252,233,3,131,195,4,137,149,233,137,133, 51 36,16,248,11,131,232,4,41,209,193,252,233,3,131,195,4,137,149,233,137,133,
52 233,137,92,36,20,137,206,248,1,137,252,239,232,251,1,0,139,141,233,255,139, 52 233,137,92,36,20,137,206,248,1,137,252,239,232,251,1,0,139,141,233,255,139,
53 133,233,139,105,252,248,139,89,252,252,41,200,193,232,3,131,192,1,252,255, 53 133,233,139,105,252,248,139,89,252,252,41,200,193,232,3,131,192,1,252,255,
@@ -1032,16 +1032,16 @@ static const char *const extnames[] = {
1032static void build_subroutines(BuildCtx *ctx, int cmov, int sse) 1032static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
1033{ 1033{
1034 dasm_put(Dst, 0); 1034 dasm_put(Dst, 0);
1035 dasm_put(Dst, 2, Dt7(->pt), Dt9(->framesize), Dt9(->bc), Dt9(->k), Dt1(->maxstack), LJ_TNIL); 1035 dasm_put(Dst, 2, Dt7(->pt), Dt9(->framesize), sizeof(GCproto), Dt9(->k), Dt1(->maxstack), LJ_TNIL);
1036#if LJ_HASJIT 1036#if LJ_HASJIT
1037#endif 1037#endif
1038 dasm_put(Dst, 64, FRAME_VARG, -FRAME_VARG, Dt7(->pt), Dt9(->framesize), Dt1(->maxstack), Dt9(->numparams), LJ_TNIL, Dt9(->framesize), Dt9(->bc)); 1038 dasm_put(Dst, 64, FRAME_VARG, -FRAME_VARG, Dt7(->pt), Dt9(->framesize), Dt1(->maxstack), Dt9(->numparams), LJ_TNIL, Dt9(->framesize), sizeof(GCproto));
1039 dasm_put(Dst, 198, Dt9(->k), Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), DISPATCH_GL(vmstate), ~LJ_VMST_C, DISPATCH_GL(wrapf), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), FRAME_TYPE); 1039 dasm_put(Dst, 198, Dt9(->k), Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), DISPATCH_GL(vmstate), ~LJ_VMST_C, DISPATCH_GL(wrapf), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), FRAME_TYPE);
1040 dasm_put(Dst, 292, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), DISPATCH_GL(vmstate), ~LJ_VMST_C, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), FRAME_TYPE); 1040 dasm_put(Dst, 292, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), DISPATCH_GL(vmstate), ~LJ_VMST_C, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), FRAME_TYPE);
1041 dasm_put(Dst, 378, FRAME_C, DISPATCH_GL(vmstate), ~LJ_VMST_C, Dt1(->base)); 1041 dasm_put(Dst, 378, FRAME_C, DISPATCH_GL(vmstate), ~LJ_VMST_C, Dt1(->base));
1042 dasm_put(Dst, 470, Dt1(->top), Dt1(->cframe), Dt1(->maxstack), LJ_TNIL, Dt1(->top)); 1042 dasm_put(Dst, 470, Dt1(->top), Dt1(->cframe), Dt1(->maxstack), LJ_TNIL, Dt1(->top));
1043 dasm_put(Dst, 554, Dt1(->top), Dt1(->glref), Dt2(->vmstate), ~LJ_VMST_C, CFRAME_RAWMASK, 1+1, Dt1(->base), Dt1(->glref), GG_G2DISP, LJ_TFALSE, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP); 1043 dasm_put(Dst, 554, Dt1(->top), Dt1(->glref), Dt2(->vmstate), ~LJ_VMST_C, CFRAME_RAWMASK, 1+1, Dt1(->base), Dt1(->glref), GG_G2DISP, LJ_TFALSE, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP);
1044 dasm_put(Dst, 655, FRAME_P, LJ_TTRUE, LUA_MINSTACK, Dt9(->bc), Dt1(->base), Dt1(->top), Dt1(->base)); 1044 dasm_put(Dst, 655, FRAME_P, LJ_TTRUE, LUA_MINSTACK, sizeof(GCproto), Dt1(->base), Dt1(->top), Dt1(->base));
1045 dasm_put(Dst, 759, Dt1(->top), Dt7(->gate), FRAME_CP, CFRAME_RESUME, Dt1(->glref), GG_G2DISP, Dt1(->cframe), Dt1(->status), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->status), Dt1(->base), Dt1(->top), FRAME_TYPE); 1045 dasm_put(Dst, 759, Dt1(->top), Dt7(->gate), FRAME_CP, CFRAME_RESUME, Dt1(->glref), GG_G2DISP, Dt1(->cframe), Dt1(->status), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->status), Dt1(->base), Dt1(->top), FRAME_TYPE);
1046 dasm_put(Dst, 898, FRAME_CP, FRAME_C, Dt1(->cframe), Dt1(->cframe), Dt1(->glref), GG_G2DISP, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), LJ_TFUNC, Dt7(->gate)); 1046 dasm_put(Dst, 898, FRAME_CP, FRAME_C, Dt1(->cframe), Dt1(->cframe), Dt1(->glref), GG_G2DISP, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), LJ_TFUNC, Dt7(->gate));
1047 dasm_put(Dst, 1023, Dt1(->stack), Dt1(->top), Dt1(->cframe), Dt1(->cframe), FRAME_CP, LJ_TNIL, 0, Dt7(->pt), Dt9(->k), Dt1(->base)); 1047 dasm_put(Dst, 1023, Dt1(->stack), Dt1(->top), Dt1(->cframe), Dt1(->cframe), FRAME_CP, LJ_TNIL, 0, Dt7(->pt), Dt9(->k), Dt1(->base));
diff --git a/src/buildvm_x64win.h b/src/buildvm_x64win.h
index 2ea21bb8..797acba3 100644
--- a/src/buildvm_x64win.h
+++ b/src/buildvm_x64win.h
@@ -13,7 +13,7 @@
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 char build_actionlist[13481] = { 15static const unsigned char build_actionlist[13481] = {
16 254,1,248,10,137,202,139,173,233,137,114,252,252,15,182,141,233,139,181,233, 16 254,1,248,10,137,202,139,173,233,137,114,252,252,15,182,141,233,141,181,233,
17 139,189,233,139,108,36,96,141,12,202,141,68,194,252,252,59,141,233,15,135, 17 139,189,233,139,108,36,96,141,12,202,141,68,194,252,252,59,141,233,15,135,
18 244,11,248,9,189,237,248,1,137,40,137,104,8,131,192,16,57,200,15,130,244, 18 244,11,248,9,189,237,248,1,137,40,137,104,8,131,192,16,57,200,15,130,244,
19 1,255,139,6,15,182,204,15,182,232,131,198,4,193,232,16,252,255,36,252,235, 19 1,255,139,6,15,182,204,15,182,232,131,198,4,193,232,16,252,255,36,252,235,
@@ -22,7 +22,7 @@ static const unsigned char build_actionlist[13481] = {
22 66,4,59,190,233,15,135,244,13,15,182,181,233,133,252,246,15,132,244,248,248, 22 66,4,59,190,233,15,135,244,13,15,182,181,233,133,252,246,15,132,244,248,248,
23 1,131,193,8,57,209,15,131,244,248,139,121,252,248,137,120,252,252,139,121, 23 1,131,193,8,57,209,15,131,244,248,139,121,252,248,137,120,252,252,139,121,
24 252,252,137,56,131,192,8,199,65,252,252,237,131,252,238,1,15,133,244,1,248, 24 252,252,137,56,131,192,8,199,65,252,252,237,131,252,238,1,15,133,244,1,248,
25 2,15,182,141,233,139,181,233,255,139,189,233,141,12,202,252,233,244,9,248, 25 2,15,182,141,233,141,181,233,255,139,189,233,141,12,202,252,233,244,9,248,
26 14,137,113,252,252,72,139,189,233,139,108,36,96,141,68,193,252,248,137,141, 26 14,137,113,252,252,72,139,189,233,139,108,36,96,141,68,193,252,248,137,141,
27 233,141,136,233,137,133,233,59,141,233,72,137,252,250,137,252,233,15,135, 27 233,141,136,233,137,133,233,59,141,233,72,137,252,250,137,252,233,15,135,
28 244,15,199,131,233,237,252,255,147,233,199,131,233,237,139,149,233,141,12, 28 244,15,199,131,233,237,252,255,147,233,199,131,233,237,139,149,233,141,12,
@@ -47,7 +47,7 @@ static const unsigned char build_actionlist[13481] = {
47 131,233,237,255,252,233,244,16,248,20,252,247,198,237,15,132,244,27,131,230, 47 131,233,237,255,252,233,244,16,248,20,252,247,198,237,15,132,244,27,131,230,
48 252,248,41,252,242,72,141,76,49,252,248,139,114,252,252,199,68,10,4,237,252, 48 252,248,41,252,242,72,141,76,49,252,248,139,114,252,252,199,68,10,4,237,252,
49 233,244,16,248,15,186,237,252,233,244,247,248,13,131,232,8,137,202,137,252, 49 233,244,16,248,15,186,237,252,233,244,247,248,13,131,232,8,137,202,137,252,
50 249,139,181,233,139,108,36,96,248,11,131,232,4,41,209,193,252,233,3,131,198, 50 249,141,181,233,139,108,36,96,248,11,131,232,4,41,209,193,252,233,3,131,198,
51 4,137,149,233,137,133,233,137,116,36,100,137,202,248,1,137,252,233,232,251, 51 4,137,149,233,137,133,233,137,116,36,100,137,202,248,1,137,252,233,232,251,
52 1,0,139,141,233,255,139,133,233,139,105,252,248,139,113,252,252,41,200,193, 52 1,0,139,141,233,255,139,133,233,139,105,252,248,139,113,252,252,41,200,193,
53 232,3,131,192,1,252,255,165,233,248,28,85,87,86,83,72,131,252,236,40,137, 53 232,3,131,192,1,252,255,165,233,248,28,85,87,86,83,72,131,252,236,40,137,
@@ -1028,16 +1028,16 @@ static const char *const extnames[] = {
1028static void build_subroutines(BuildCtx *ctx, int cmov, int sse) 1028static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
1029{ 1029{
1030 dasm_put(Dst, 0); 1030 dasm_put(Dst, 0);
1031 dasm_put(Dst, 2, Dt7(->pt), Dt9(->framesize), Dt9(->bc), Dt9(->k), Dt1(->maxstack), LJ_TNIL); 1031 dasm_put(Dst, 2, Dt7(->pt), Dt9(->framesize), sizeof(GCproto), Dt9(->k), Dt1(->maxstack), LJ_TNIL);
1032#if LJ_HASJIT 1032#if LJ_HASJIT
1033#endif 1033#endif
1034 dasm_put(Dst, 63, FRAME_VARG, -FRAME_VARG, Dt7(->pt), Dt9(->framesize), Dt1(->maxstack), Dt9(->numparams), LJ_TNIL, Dt9(->framesize), Dt9(->bc)); 1034 dasm_put(Dst, 63, FRAME_VARG, -FRAME_VARG, Dt7(->pt), Dt9(->framesize), Dt1(->maxstack), Dt9(->numparams), LJ_TNIL, Dt9(->framesize), sizeof(GCproto));
1035 dasm_put(Dst, 192, Dt9(->k), Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), DISPATCH_GL(vmstate), ~LJ_VMST_C, DISPATCH_GL(wrapf), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), FRAME_TYPE); 1035 dasm_put(Dst, 192, Dt9(->k), Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), DISPATCH_GL(vmstate), ~LJ_VMST_C, DISPATCH_GL(wrapf), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), FRAME_TYPE);
1036 dasm_put(Dst, 282, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), DISPATCH_GL(vmstate), ~LJ_VMST_C, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), FRAME_TYPE); 1036 dasm_put(Dst, 282, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), DISPATCH_GL(vmstate), ~LJ_VMST_C, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), FRAME_TYPE);
1037 dasm_put(Dst, 365, FRAME_C, DISPATCH_GL(vmstate), ~LJ_VMST_C, Dt1(->base)); 1037 dasm_put(Dst, 365, FRAME_C, DISPATCH_GL(vmstate), ~LJ_VMST_C, Dt1(->base));
1038 dasm_put(Dst, 456, Dt1(->top), Dt1(->cframe), Dt1(->maxstack), LJ_TNIL, Dt1(->top)); 1038 dasm_put(Dst, 456, Dt1(->top), Dt1(->cframe), Dt1(->maxstack), LJ_TNIL, Dt1(->top));
1039 dasm_put(Dst, 538, Dt1(->top), Dt1(->glref), Dt2(->vmstate), ~LJ_VMST_C, CFRAME_RAWMASK, 1+1, Dt1(->base), Dt1(->glref), GG_G2DISP, LJ_TFALSE, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP); 1039 dasm_put(Dst, 538, Dt1(->top), Dt1(->glref), Dt2(->vmstate), ~LJ_VMST_C, CFRAME_RAWMASK, 1+1, Dt1(->base), Dt1(->glref), GG_G2DISP, LJ_TFALSE, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP);
1040 dasm_put(Dst, 633, FRAME_P, LJ_TTRUE, LUA_MINSTACK, Dt9(->bc), Dt1(->base), Dt1(->top), Dt1(->base)); 1040 dasm_put(Dst, 633, FRAME_P, LJ_TTRUE, LUA_MINSTACK, sizeof(GCproto), Dt1(->base), Dt1(->top), Dt1(->base));
1041 dasm_put(Dst, 737, Dt1(->top), Dt7(->gate), FRAME_CP, CFRAME_RESUME, Dt1(->glref), GG_G2DISP, Dt1(->cframe), Dt1(->status), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->status), Dt1(->base), Dt1(->top), FRAME_TYPE); 1041 dasm_put(Dst, 737, Dt1(->top), Dt7(->gate), FRAME_CP, CFRAME_RESUME, Dt1(->glref), GG_G2DISP, Dt1(->cframe), Dt1(->status), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->status), Dt1(->base), Dt1(->top), FRAME_TYPE);
1042 dasm_put(Dst, 869, FRAME_CP, FRAME_C, Dt1(->cframe), Dt1(->cframe), Dt1(->glref), GG_G2DISP, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), LJ_TFUNC, Dt7(->gate)); 1042 dasm_put(Dst, 869, FRAME_CP, FRAME_C, Dt1(->cframe), Dt1(->cframe), Dt1(->glref), GG_G2DISP, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), LJ_TFUNC, Dt7(->gate));
1043 dasm_put(Dst, 987, Dt1(->stack), Dt1(->top), Dt1(->cframe), Dt1(->cframe), FRAME_CP, LJ_TNIL, 0, Dt7(->pt), Dt9(->k), Dt1(->base)); 1043 dasm_put(Dst, 987, Dt1(->stack), Dt1(->top), Dt1(->cframe), Dt1(->cframe), FRAME_CP, LJ_TNIL, 0, Dt7(->pt), Dt9(->k), Dt1(->base));
diff --git a/src/buildvm_x86.dasc b/src/buildvm_x86.dasc
index 4e4ccc49..e09c37e9 100644
--- a/src/buildvm_x86.dasc
+++ b/src/buildvm_x86.dasc
@@ -409,7 +409,7 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
409 | mov PROTO:RB, LFUNC:RB->pt 409 | mov PROTO:RB, LFUNC:RB->pt
410 | mov [BASE-4], PC // Store caller PC. 410 | mov [BASE-4], PC // Store caller PC.
411 | movzx RA, byte PROTO:RB->framesize 411 | movzx RA, byte PROTO:RB->framesize
412 | mov PC, PROTO:RB->bc 412 | lea PC, [PROTO:RB+sizeof(GCproto)]
413 | mov KBASE, PROTO:RB->k 413 | mov KBASE, PROTO:RB->k
414 | mov L:RB, SAVE_L 414 | mov L:RB, SAVE_L
415 | lea RA, [BASE+RA*8] // Top of frame. 415 | lea RA, [BASE+RA*8] // Top of frame.
@@ -462,7 +462,7 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
462 | jnz <1 462 | jnz <1
463 |2: 463 |2:
464 | movzx RA, byte PROTO:RB->framesize 464 | movzx RA, byte PROTO:RB->framesize
465 | mov PC, PROTO:RB->bc 465 | lea PC, [PROTO:RB+sizeof(GCproto)]
466 | mov KBASE, PROTO:RB->k 466 | mov KBASE, PROTO:RB->k
467 | lea RA, [BASE+RA*8] 467 | lea RA, [BASE+RA*8]
468 | jmp <9 468 | jmp <9
@@ -666,7 +666,7 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
666 | sub RC, 8 666 | sub RC, 8
667 | mov BASE, RA 667 | mov BASE, RA
668 | mov RA, KBASE 668 | mov RA, KBASE
669 | mov PC, PROTO:RB->bc 669 | lea PC, [PROTO:RB+sizeof(GCproto)]
670 | mov L:RB, SAVE_L 670 | mov L:RB, SAVE_L
671 | 671 |
672 |->gate_lf_growstack: // Grow stack for fixarg Lua function. 672 |->gate_lf_growstack: // Grow stack for fixarg Lua function.
diff --git a/src/buildvm_x86.h b/src/buildvm_x86.h
index e98d2622..a562361c 100644
--- a/src/buildvm_x86.h
+++ b/src/buildvm_x86.h
@@ -13,7 +13,7 @@
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 char build_actionlist[15185] = { 15static const unsigned char build_actionlist[15185] = {
16 254,1,248,10,137,202,139,173,233,137,114,252,252,15,182,141,233,139,181,233, 16 254,1,248,10,137,202,139,173,233,137,114,252,252,15,182,141,233,141,181,233,
17 139,189,233,139,108,36,48,141,12,202,141,68,194,252,252,59,141,233,15,135, 17 139,189,233,139,108,36,48,141,12,202,141,68,194,252,252,59,141,233,15,135,
18 244,11,248,9,189,237,248,1,137,40,137,104,8,131,192,16,57,200,15,130,244, 18 244,11,248,9,189,237,248,1,137,40,137,104,8,131,192,16,57,200,15,130,244,
19 1,255,139,6,15,182,204,15,182,232,131,198,4,193,232,16,252,255,36,171,248, 19 1,255,139,6,15,182,204,15,182,232,131,198,4,193,232,16,252,255,36,171,248,
@@ -22,7 +22,7 @@ static const unsigned char build_actionlist[15185] = {
22 4,59,190,233,15,135,244,13,15,182,181,233,133,252,246,15,132,244,248,248, 22 4,59,190,233,15,135,244,13,15,182,181,233,133,252,246,15,132,244,248,248,
23 1,131,193,8,57,209,15,131,244,248,139,121,252,248,137,120,252,252,139,121, 23 1,131,193,8,57,209,15,131,244,248,139,121,252,248,137,120,252,252,139,121,
24 252,252,137,56,131,192,8,199,65,252,252,237,131,252,238,1,15,133,244,1,248, 24 252,252,137,56,131,192,8,199,65,252,252,237,131,252,238,1,15,133,244,1,248,
25 2,15,182,141,233,139,181,233,255,139,189,233,141,12,202,252,233,244,9,248, 25 2,15,182,141,233,141,181,233,255,139,189,233,141,12,202,252,233,244,9,248,
26 14,137,113,252,252,139,189,233,139,108,36,48,141,68,193,252,248,137,141,233, 26 14,137,113,252,252,139,189,233,139,108,36,48,141,68,193,252,248,137,141,233,
27 141,136,233,137,133,233,59,141,233,137,124,36,4,137,44,36,15,135,244,15,199, 27 141,136,233,137,133,233,59,141,233,137,124,36,4,137,44,36,15,135,244,15,199,
28 131,233,237,252,255,147,233,199,131,233,237,139,149,233,141,12,194,252,247, 28 131,233,237,252,255,147,233,199,131,233,237,139,149,233,141,12,194,252,247,
@@ -46,7 +46,7 @@ static const unsigned char build_actionlist[15185] = {
46 199,66,252,252,237,199,131,233,237,255,252,233,244,16,248,20,252,247,198, 46 199,66,252,252,237,199,131,233,237,255,252,233,244,16,248,20,252,247,198,
47 237,15,132,244,27,131,230,252,248,41,252,242,141,76,49,252,248,139,114,252, 47 237,15,132,244,27,131,230,252,248,41,252,242,141,76,49,252,248,139,114,252,
48 252,199,68,10,4,237,252,233,244,16,248,15,186,237,252,233,244,247,248,13, 48 252,199,68,10,4,237,252,233,244,16,248,15,186,237,252,233,244,247,248,13,
49 131,232,8,137,202,137,252,249,139,181,233,139,108,36,48,248,11,131,232,4, 49 131,232,8,137,202,137,252,249,141,181,233,139,108,36,48,248,11,131,232,4,
50 41,209,193,252,233,3,131,198,4,137,149,233,137,133,233,137,116,36,24,137, 50 41,209,193,252,233,3,131,198,4,137,149,233,137,133,233,137,116,36,24,137,
51 202,248,1,137,252,233,232,251,1,0,139,141,233,255,139,133,233,139,105,252, 51 202,248,1,137,252,233,232,251,1,0,139,141,233,255,139,133,233,139,105,252,
52 248,139,113,252,252,41,200,193,232,3,131,192,1,252,255,165,233,248,28,85, 52 248,139,113,252,252,41,200,193,232,3,131,192,1,252,255,165,233,248,28,85,
@@ -1107,16 +1107,16 @@ static const char *const extnames[] = {
1107static void build_subroutines(BuildCtx *ctx, int cmov, int sse) 1107static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
1108{ 1108{
1109 dasm_put(Dst, 0); 1109 dasm_put(Dst, 0);
1110 dasm_put(Dst, 2, Dt7(->pt), Dt9(->framesize), Dt9(->bc), Dt9(->k), Dt1(->maxstack), LJ_TNIL); 1110 dasm_put(Dst, 2, Dt7(->pt), Dt9(->framesize), sizeof(GCproto), Dt9(->k), Dt1(->maxstack), LJ_TNIL);
1111#if LJ_HASJIT 1111#if LJ_HASJIT
1112#endif 1112#endif
1113 dasm_put(Dst, 63, FRAME_VARG, -FRAME_VARG, Dt7(->pt), Dt9(->framesize), Dt1(->maxstack), Dt9(->numparams), LJ_TNIL, Dt9(->framesize), Dt9(->bc)); 1113 dasm_put(Dst, 63, FRAME_VARG, -FRAME_VARG, Dt7(->pt), Dt9(->framesize), Dt1(->maxstack), Dt9(->numparams), LJ_TNIL, Dt9(->framesize), sizeof(GCproto));
1114 dasm_put(Dst, 191, Dt9(->k), Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), DISPATCH_GL(vmstate), ~LJ_VMST_C, DISPATCH_GL(wrapf), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), FRAME_TYPE); 1114 dasm_put(Dst, 191, Dt9(->k), Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), DISPATCH_GL(vmstate), ~LJ_VMST_C, DISPATCH_GL(wrapf), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), FRAME_TYPE);
1115 dasm_put(Dst, 280, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), DISPATCH_GL(vmstate), ~LJ_VMST_C, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), FRAME_TYPE); 1115 dasm_put(Dst, 280, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), DISPATCH_GL(vmstate), ~LJ_VMST_C, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), FRAME_TYPE);
1116 dasm_put(Dst, 362, FRAME_C, DISPATCH_GL(vmstate), ~LJ_VMST_C, Dt1(->base)); 1116 dasm_put(Dst, 362, FRAME_C, DISPATCH_GL(vmstate), ~LJ_VMST_C, Dt1(->base));
1117 dasm_put(Dst, 453, Dt1(->top), Dt1(->cframe), Dt1(->maxstack), LJ_TNIL, Dt1(->top)); 1117 dasm_put(Dst, 453, Dt1(->top), Dt1(->cframe), Dt1(->maxstack), LJ_TNIL, Dt1(->top));
1118 dasm_put(Dst, 532, Dt1(->top), Dt1(->glref), Dt2(->vmstate), ~LJ_VMST_C, CFRAME_RAWMASK, 1+1, Dt1(->base), Dt1(->glref), GG_G2DISP, LJ_TFALSE, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP); 1118 dasm_put(Dst, 532, Dt1(->top), Dt1(->glref), Dt2(->vmstate), ~LJ_VMST_C, CFRAME_RAWMASK, 1+1, Dt1(->base), Dt1(->glref), GG_G2DISP, LJ_TFALSE, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP);
1119 dasm_put(Dst, 622, FRAME_P, LJ_TTRUE, LUA_MINSTACK, Dt9(->bc), Dt1(->base), Dt1(->top), Dt1(->base)); 1119 dasm_put(Dst, 622, FRAME_P, LJ_TTRUE, LUA_MINSTACK, sizeof(GCproto), Dt1(->base), Dt1(->top), Dt1(->base));
1120 dasm_put(Dst, 725, Dt1(->top), Dt7(->gate), FRAME_CP, CFRAME_RESUME, Dt1(->glref), GG_G2DISP, Dt1(->cframe), Dt1(->status), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->status), Dt1(->base), Dt1(->top), FRAME_TYPE); 1120 dasm_put(Dst, 725, Dt1(->top), Dt7(->gate), FRAME_CP, CFRAME_RESUME, Dt1(->glref), GG_G2DISP, Dt1(->cframe), Dt1(->status), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->status), Dt1(->base), Dt1(->top), FRAME_TYPE);
1121 dasm_put(Dst, 845, FRAME_CP, FRAME_C, Dt1(->cframe), Dt1(->cframe), Dt1(->glref), GG_G2DISP, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), LJ_TFUNC, Dt7(->gate)); 1121 dasm_put(Dst, 845, FRAME_CP, FRAME_C, Dt1(->cframe), Dt1(->cframe), Dt1(->glref), GG_G2DISP, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top), LJ_TFUNC, Dt7(->gate));
1122 dasm_put(Dst, 948, Dt1(->stack), Dt1(->top), Dt1(->cframe), Dt1(->cframe), FRAME_CP, LJ_TNIL, Dt7(->pt), Dt9(->k), LJ_TSTR); 1122 dasm_put(Dst, 948, Dt1(->stack), Dt1(->top), Dt1(->cframe), Dt1(->cframe), FRAME_CP, LJ_TNIL, Dt7(->pt), Dt9(->k), LJ_TSTR);
diff --git a/src/lib_jit.c b/src/lib_jit.c
index 33571b17..fb551315 100644
--- a/src/lib_jit.c
+++ b/src/lib_jit.c
@@ -210,7 +210,7 @@ LJLIB_CF(jit_util_funcbc)
210 GCproto *pt = check_Lproto(L, 0); 210 GCproto *pt = check_Lproto(L, 0);
211 BCPos pc = (BCPos)lj_lib_checkint(L, 2) - 1; 211 BCPos pc = (BCPos)lj_lib_checkint(L, 2) - 1;
212 if (pc < pt->sizebc) { 212 if (pc < pt->sizebc) {
213 BCIns ins = proto_ins(pt, pc); 213 BCIns ins = proto_bc(pt)[pc];
214 BCOp op = bc_op(ins); 214 BCOp op = bc_op(ins);
215 lua_assert(op < BC__MAX); 215 lua_assert(op < BC__MAX);
216 setintV(L->top, ins); 216 setintV(L->top, ins);
diff --git a/src/lj_obj.h b/src/lj_obj.h
index d8aab90a..f243a75b 100644
--- a/src/lj_obj.h
+++ b/src/lj_obj.h
@@ -351,7 +351,6 @@ typedef struct GCproto {
351 MSize sizebc; /* Number of bytecode instructions. */ 351 MSize sizebc; /* Number of bytecode instructions. */
352 GCRef gclist; 352 GCRef gclist;
353 MRef k; /* Split constant array (points to the middle). */ 353 MRef k; /* Split constant array (points to the middle). */
354 MRef bc; /* Array of bytecode instructions. */
355 MRef uv; /* Upvalue list. local slot|0x8000 or parent uv idx. */ 354 MRef uv; /* Upvalue list. local slot|0x8000 or parent uv idx. */
356 MSize sizekgc; /* Number of collectable constants. */ 355 MSize sizekgc; /* Number of collectable constants. */
357 MSize sizekn; /* Number of lua_Number constants. */ 356 MSize sizekn; /* Number of lua_Number constants. */
@@ -381,11 +380,7 @@ typedef struct GCproto {
381 gcref(mref((pt)->k, GCRef)[(idx)])) 380 gcref(mref((pt)->k, GCRef)[(idx)]))
382#define proto_knum(pt, idx) \ 381#define proto_knum(pt, idx) \
383 check_exp((uintptr_t)(idx) < (pt)->sizekn, mref((pt)->k, lua_Number)[(idx)]) 382 check_exp((uintptr_t)(idx) < (pt)->sizekn, mref((pt)->k, lua_Number)[(idx)])
384#define proto_bc(pt) (mref((pt)->bc, BCIns)) 383#define proto_bc(pt) ((BCIns *)((char *)(pt) + sizeof(GCproto)))
385#define proto_ins(pt, pos) \
386 check_exp((uintptr_t)(pos) < (pt)->sizebc, proto_bc(pt)[(pos)])
387#define proto_insptr(pt, pos) \
388 check_exp((uintptr_t)(pos) < (pt)->sizebc, &proto_bc(pt)[(pos)])
389#define proto_bcpos(pt, pc) ((BCPos)((pc) - proto_bc(pt))) 384#define proto_bcpos(pt, pc) ((BCPos)((pc) - proto_bc(pt)))
390#define proto_uv(pt) (mref((pt)->uv, uint16_t)) 385#define proto_uv(pt) (mref((pt)->uv, uint16_t))
391 386
diff --git a/src/lj_parse.c b/src/lj_parse.c
index 5cb3ac3b..ed695e19 100644
--- a/src/lj_parse.c
+++ b/src/lj_parse.c
@@ -1033,7 +1033,6 @@ static void fs_fixup_bc(FuncState *fs, GCproto *pt, BCIns *bc, BCLine *lineinfo)
1033{ 1033{
1034 MSize i, n = fs->pc; 1034 MSize i, n = fs->pc;
1035 BCInsLine *base = fs->bcbase; 1035 BCInsLine *base = fs->bcbase;
1036 setmref(pt->bc, bc);
1037 setmref(pt->lineinfo, lineinfo); 1036 setmref(pt->lineinfo, lineinfo);
1038 pt->sizebc = n; 1037 pt->sizebc = n;
1039 bc[n] = ~0u; /* Close potentially uninitialized gap between bc and kgc. */ 1038 bc[n] = ~0u; /* Close potentially uninitialized gap between bc and kgc. */