Turn some lua_State fields into 32 bit pointers.
lua_State now fits into one cache line on x64.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
#define DASM_SECTION_CODE_OP 0
|
||||
#define DASM_SECTION_CODE_SUB 1
|
||||
#define DASM_MAXSECTION 2
|
||||
static const unsigned char build_actionlist[14100] = {
|
||||
static const unsigned char build_actionlist[14095] = {
|
||||
254,1,248,10,252,247,195,237,15,132,244,11,131,227,252,248,41,218,72,141,
|
||||
76,25,252,248,139,90,252,252,199,68,10,4,237,248,12,131,192,1,137,68,36,4,
|
||||
252,247,195,237,15,132,244,13,248,14,129,252,243,239,252,247,195,237,15,133,
|
||||
@@ -616,84 +616,84 @@ static const unsigned char build_actionlist[14100] = {
|
||||
15,182,232,131,195,4,193,232,16,65,252,255,36,252,238,248,3,131,189,233,0,
|
||||
15,132,244,1,255,139,141,233,252,246,129,233,235,15,132,244,38,15,182,75,
|
||||
252,253,252,233,244,1,248,7,128,165,233,235,65,139,142,233,65,137,174,233,
|
||||
137,141,233,15,182,75,252,253,252,233,244,2,255,68,137,60,36,255,252,242,
|
||||
69,15,45,60,199,255,248,1,141,12,202,139,105,252,248,252,246,133,233,235,
|
||||
15,133,244,253,248,2,139,68,36,4,131,232,1,15,132,244,250,68,1,252,248,59,
|
||||
133,233,15,131,244,251,68,41,252,248,65,193,231,3,68,3,189,233,248,3,139,
|
||||
41,65,137,47,139,105,4,131,193,8,65,137,111,4,65,131,199,8,131,232,1,15,133,
|
||||
244,3,248,4,68,139,60,36,139,3,15,182,204,15,182,232,131,195,4,193,232,16,
|
||||
65,252,255,36,252,238,248,5,139,124,36,24,137,151,233,137,252,238,137,194,
|
||||
137,252,253,137,92,36,28,232,251,1,33,139,149,233,15,182,75,252,253,252,233,
|
||||
244,1,248,7,255,128,165,233,235,65,139,134,233,65,137,174,233,137,133,233,
|
||||
252,233,244,2,255,3,68,36,4,255,129,124,253,202,4,239,139,44,202,15,133,244,
|
||||
51,141,84,202,8,137,90,252,252,139,157,233,139,11,15,182,252,233,15,182,205,
|
||||
131,195,4,65,252,255,36,252,238,255,141,76,202,8,65,137,215,139,105,252,248,
|
||||
129,121,253,252,252,239,15,133,244,28,248,52,139,90,252,252,252,247,195,237,
|
||||
15,133,244,253,248,1,137,106,252,248,137,68,36,4,131,232,1,15,132,244,249,
|
||||
248,2,139,41,65,137,47,139,105,4,65,137,111,4,65,131,199,8,131,193,8,131,
|
||||
232,1,15,133,244,2,139,106,252,248,248,3,139,68,36,4,128,189,233,1,15,135,
|
||||
244,251,248,4,139,157,233,139,11,15,182,252,233,15,182,205,131,195,4,65,252,
|
||||
255,36,252,238,248,5,255,252,247,195,237,15,133,244,4,15,182,75,252,253,72,
|
||||
252,247,209,141,12,202,68,139,121,252,248,69,139,191,233,69,139,191,233,252,
|
||||
233,244,4,248,7,129,252,235,239,252,247,195,237,15,133,244,254,41,218,65,
|
||||
137,215,139,90,252,252,252,233,244,1,248,8,129,195,239,252,233,244,1,255,
|
||||
141,76,202,8,139,105,232,139,65,252,236,137,41,137,65,4,139,105,252,240,139,
|
||||
65,252,244,137,105,8,137,65,12,139,105,224,139,65,228,137,105,252,248,137,
|
||||
65,252,252,129,252,248,239,184,237,15,133,244,28,137,202,137,90,252,252,139,
|
||||
137,141,233,15,182,75,252,253,252,233,244,2,255,68,137,60,36,69,139,60,199,
|
||||
248,1,141,12,202,139,105,252,248,252,246,133,233,235,15,133,244,253,248,2,
|
||||
139,68,36,4,131,232,1,15,132,244,250,68,1,252,248,59,133,233,15,131,244,251,
|
||||
68,41,252,248,65,193,231,3,68,3,189,233,248,3,139,41,65,137,47,139,105,4,
|
||||
131,193,8,65,137,111,4,65,131,199,8,131,232,1,15,133,244,3,248,4,68,139,60,
|
||||
36,139,3,15,182,204,15,182,232,131,195,4,193,232,16,65,252,255,36,252,238,
|
||||
248,5,139,124,36,24,137,151,233,137,252,238,137,194,137,252,253,137,92,36,
|
||||
28,232,251,1,33,139,149,233,15,182,75,252,253,252,233,244,1,248,7,255,128,
|
||||
165,233,235,65,139,134,233,65,137,174,233,137,133,233,252,233,244,2,255,3,
|
||||
68,36,4,255,129,124,253,202,4,239,139,44,202,15,133,244,51,141,84,202,8,137,
|
||||
90,252,252,139,157,233,139,11,15,182,252,233,15,182,205,131,195,4,65,252,
|
||||
255,36,252,238,255,141,76,202,8,65,137,215,139,105,252,248,129,121,253,252,
|
||||
252,239,15,133,244,28,248,52,139,90,252,252,252,247,195,237,15,133,244,253,
|
||||
248,1,137,106,252,248,137,68,36,4,131,232,1,15,132,244,249,248,2,139,41,65,
|
||||
137,47,139,105,4,65,137,111,4,65,131,199,8,131,193,8,131,232,1,15,133,244,
|
||||
2,139,106,252,248,248,3,139,68,36,4,128,189,233,1,15,135,244,251,248,4,139,
|
||||
157,233,139,11,15,182,252,233,15,182,205,131,195,4,65,252,255,36,252,238,
|
||||
255,15,182,252,236,139,66,252,248,141,12,202,139,128,233,15,182,128,233,68,
|
||||
137,60,36,68,141,188,253,194,233,68,43,122,252,252,133,252,237,15,132,244,
|
||||
251,141,108,252,233,252,248,65,57,215,15,131,244,248,248,1,65,139,71,252,
|
||||
248,137,1,65,139,71,252,252,65,131,199,8,137,65,4,131,193,8,57,252,233,15,
|
||||
131,244,249,65,57,215,15,130,244,1,248,2,199,65,4,237,131,193,8,57,252,233,
|
||||
15,130,244,2,248,3,68,139,60,36,139,3,15,182,204,15,182,232,131,195,4,193,
|
||||
232,16,65,252,255,36,252,238,248,5,199,68,36,4,1,0,0,0,137,208,68,41,252,
|
||||
248,15,134,244,3,255,137,197,193,252,237,3,131,197,1,137,108,36,4,139,108,
|
||||
36,24,1,200,59,133,233,15,135,244,253,248,6,65,139,71,252,248,137,1,65,139,
|
||||
71,252,252,65,131,199,8,137,65,4,131,193,8,65,57,215,15,130,244,6,252,233,
|
||||
244,3,248,7,137,149,233,137,141,233,137,92,36,28,65,41,215,139,116,36,4,131,
|
||||
252,238,1,137,252,239,232,251,1,0,139,149,233,139,141,233,65,1,215,252,233,
|
||||
244,6,255,193,225,3,255,248,1,139,90,252,252,137,68,36,4,252,247,195,237,
|
||||
15,133,244,253,255,248,13,65,137,215,131,232,1,15,132,244,249,248,2,65,139,
|
||||
44,15,65,137,111,252,248,65,139,108,15,4,65,137,111,252,252,65,131,199,8,
|
||||
131,232,1,15,133,244,2,248,3,139,68,36,4,15,182,107,252,255,248,5,57,197,
|
||||
15,135,244,252,255,139,108,10,4,137,106,252,252,139,44,10,137,106,252,248,
|
||||
255,248,5,56,67,252,255,15,135,244,252,255,15,182,75,252,253,72,252,247,209,
|
||||
141,20,202,68,139,122,252,248,69,139,191,233,69,139,191,233,139,3,15,182,
|
||||
204,15,182,232,131,195,4,193,232,16,65,252,255,36,252,238,248,6,255,65,199,
|
||||
71,252,252,237,65,131,199,8,255,199,68,194,252,244,237,255,131,192,1,252,
|
||||
233,244,5,248,7,141,171,233,252,247,197,237,15,133,244,14,41,252,234,255,
|
||||
1,252,233,255,137,221,209,252,237,129,229,239,102,65,131,172,253,46,233,1,
|
||||
15,132,244,140,255,141,12,202,255,129,121,253,4,239,15,135,244,53,129,121,
|
||||
253,12,239,15,135,244,53,255,139,105,20,255,129,252,253,239,15,135,244,53,
|
||||
255,252,242,15,16,1,252,242,15,16,73,8,255,252,242,15,88,65,16,252,242,15,
|
||||
17,1,133,252,237,15,136,244,249,255,15,140,244,249,255,102,15,46,200,248,
|
||||
1,252,242,15,17,65,24,255,221,65,8,221,1,255,220,65,16,221,17,221,81,24,133,
|
||||
252,237,15,136,244,247,255,221,81,24,15,140,244,247,255,217,201,248,1,255,
|
||||
15,183,67,252,254,255,15,131,244,248,141,156,253,131,233,255,141,156,253,
|
||||
131,233,15,183,67,252,254,15,131,245,255,15,130,244,248,141,156,253,131,233,
|
||||
255,248,3,102,15,46,193,252,233,244,1,255,141,12,202,139,105,4,129,252,253,
|
||||
239,15,132,244,247,255,137,105,252,252,139,41,137,105,252,248,252,233,245,
|
||||
255,141,156,253,131,233,139,1,137,105,252,252,137,65,252,248,255,65,139,142,
|
||||
233,139,4,129,72,139,128,233,139,108,36,24,65,137,150,233,65,137,174,233,
|
||||
76,137,36,36,76,137,108,36,8,72,131,252,236,16,252,255,224,255,141,156,253,
|
||||
131,233,139,3,15,182,204,15,182,232,131,195,4,193,232,16,65,252,255,36,252,
|
||||
238,255,137,221,209,252,237,129,229,239,102,65,131,172,253,46,233,1,15,132,
|
||||
244,142,255,68,139,187,233,139,108,36,24,141,12,202,59,141,233,15,135,244,
|
||||
23,15,182,139,233,57,200,15,134,244,249,248,2,255,15,183,67,252,254,252,233,
|
||||
245,255,248,3,199,68,194,252,252,237,131,192,1,57,200,15,134,244,3,252,233,
|
||||
244,2,255,141,44,197,237,141,4,194,68,139,122,252,248,137,104,252,252,68,
|
||||
137,120,252,248,139,108,36,24,141,12,200,59,141,233,15,135,244,22,137,209,
|
||||
137,194,15,182,171,233,133,252,237,15,132,244,248,248,1,131,193,8,57,209,
|
||||
15,131,244,249,68,139,121,252,248,68,137,56,68,139,121,252,252,68,137,120,
|
||||
4,131,192,8,199,65,252,252,237,131,252,237,1,15,133,244,1,248,2,255,68,139,
|
||||
187,233,139,3,15,182,204,15,182,232,131,195,4,193,232,16,65,252,255,36,252,
|
||||
238,255,248,3,199,64,4,237,131,192,8,131,252,237,1,15,133,244,3,252,233,244,
|
||||
2,255,139,106,252,248,76,139,189,233,139,108,36,24,141,68,194,252,248,137,
|
||||
149,233,141,136,233,59,141,233,137,133,233,255,137,252,239,255,76,137,252,
|
||||
254,137,252,239,255,15,135,244,21,65,199,134,233,237,255,65,252,255,215,255,
|
||||
65,252,255,150,233,255,65,199,134,233,237,139,149,233,141,12,194,252,247,
|
||||
217,3,141,233,139,90,252,252,252,233,244,12,255,254,0
|
||||
248,5,255,252,247,195,237,15,133,244,4,15,182,75,252,253,72,252,247,209,141,
|
||||
12,202,68,139,121,252,248,69,139,191,233,69,139,191,233,252,233,244,4,248,
|
||||
7,129,252,235,239,252,247,195,237,15,133,244,254,41,218,65,137,215,139,90,
|
||||
252,252,252,233,244,1,248,8,129,195,239,252,233,244,1,255,141,76,202,8,139,
|
||||
105,232,139,65,252,236,137,41,137,65,4,139,105,252,240,139,65,252,244,137,
|
||||
105,8,137,65,12,139,105,224,139,65,228,137,105,252,248,137,65,252,252,129,
|
||||
252,248,239,184,237,15,133,244,28,137,202,137,90,252,252,139,157,233,139,
|
||||
11,15,182,252,233,15,182,205,131,195,4,65,252,255,36,252,238,255,15,182,252,
|
||||
236,139,66,252,248,141,12,202,139,128,233,15,182,128,233,68,137,60,36,68,
|
||||
141,188,253,194,233,68,43,122,252,252,133,252,237,15,132,244,251,141,108,
|
||||
252,233,252,248,65,57,215,15,131,244,248,248,1,65,139,71,252,248,137,1,65,
|
||||
139,71,252,252,65,131,199,8,137,65,4,131,193,8,57,252,233,15,131,244,249,
|
||||
65,57,215,15,130,244,1,248,2,199,65,4,237,131,193,8,57,252,233,15,130,244,
|
||||
2,248,3,68,139,60,36,139,3,15,182,204,15,182,232,131,195,4,193,232,16,65,
|
||||
252,255,36,252,238,248,5,199,68,36,4,1,0,0,0,137,208,68,41,252,248,15,134,
|
||||
244,3,255,137,197,193,252,237,3,131,197,1,137,108,36,4,139,108,36,24,1,200,
|
||||
59,133,233,15,135,244,253,248,6,65,139,71,252,248,137,1,65,139,71,252,252,
|
||||
65,131,199,8,137,65,4,131,193,8,65,57,215,15,130,244,6,252,233,244,3,248,
|
||||
7,137,149,233,137,141,233,137,92,36,28,65,41,215,139,116,36,4,131,252,238,
|
||||
1,137,252,239,232,251,1,0,139,149,233,139,141,233,65,1,215,252,233,244,6,
|
||||
255,193,225,3,255,248,1,139,90,252,252,137,68,36,4,252,247,195,237,15,133,
|
||||
244,253,255,248,13,65,137,215,131,232,1,15,132,244,249,248,2,65,139,44,15,
|
||||
65,137,111,252,248,65,139,108,15,4,65,137,111,252,252,65,131,199,8,131,232,
|
||||
1,15,133,244,2,248,3,139,68,36,4,15,182,107,252,255,248,5,57,197,15,135,244,
|
||||
252,255,139,108,10,4,137,106,252,252,139,44,10,137,106,252,248,255,248,5,
|
||||
56,67,252,255,15,135,244,252,255,15,182,75,252,253,72,252,247,209,141,20,
|
||||
202,68,139,122,252,248,69,139,191,233,69,139,191,233,139,3,15,182,204,15,
|
||||
182,232,131,195,4,193,232,16,65,252,255,36,252,238,248,6,255,65,199,71,252,
|
||||
252,237,65,131,199,8,255,199,68,194,252,244,237,255,131,192,1,252,233,244,
|
||||
5,248,7,141,171,233,252,247,197,237,15,133,244,14,41,252,234,255,1,252,233,
|
||||
255,137,221,209,252,237,129,229,239,102,65,131,172,253,46,233,1,15,132,244,
|
||||
140,255,141,12,202,255,129,121,253,4,239,15,135,244,53,129,121,253,12,239,
|
||||
15,135,244,53,255,139,105,20,255,129,252,253,239,15,135,244,53,255,252,242,
|
||||
15,16,1,252,242,15,16,73,8,255,252,242,15,88,65,16,252,242,15,17,1,133,252,
|
||||
237,15,136,244,249,255,15,140,244,249,255,102,15,46,200,248,1,252,242,15,
|
||||
17,65,24,255,221,65,8,221,1,255,220,65,16,221,17,221,81,24,133,252,237,15,
|
||||
136,244,247,255,221,81,24,15,140,244,247,255,217,201,248,1,255,15,183,67,
|
||||
252,254,255,15,131,244,248,141,156,253,131,233,255,141,156,253,131,233,15,
|
||||
183,67,252,254,15,131,245,255,15,130,244,248,141,156,253,131,233,255,248,
|
||||
3,102,15,46,193,252,233,244,1,255,141,12,202,139,105,4,129,252,253,239,15,
|
||||
132,244,247,255,137,105,252,252,139,41,137,105,252,248,252,233,245,255,141,
|
||||
156,253,131,233,139,1,137,105,252,252,137,65,252,248,255,65,139,142,233,139,
|
||||
4,129,72,139,128,233,139,108,36,24,65,137,150,233,65,137,174,233,76,137,36,
|
||||
36,76,137,108,36,8,72,131,252,236,16,252,255,224,255,141,156,253,131,233,
|
||||
139,3,15,182,204,15,182,232,131,195,4,193,232,16,65,252,255,36,252,238,255,
|
||||
137,221,209,252,237,129,229,239,102,65,131,172,253,46,233,1,15,132,244,142,
|
||||
255,68,139,187,233,139,108,36,24,141,12,202,59,141,233,15,135,244,23,15,182,
|
||||
139,233,57,200,15,134,244,249,248,2,255,15,183,67,252,254,252,233,245,255,
|
||||
248,3,199,68,194,252,252,237,131,192,1,57,200,15,134,244,3,252,233,244,2,
|
||||
255,141,44,197,237,141,4,194,68,139,122,252,248,137,104,252,252,68,137,120,
|
||||
252,248,139,108,36,24,141,12,200,59,141,233,15,135,244,22,137,209,137,194,
|
||||
15,182,171,233,133,252,237,15,132,244,248,248,1,131,193,8,57,209,15,131,244,
|
||||
249,68,139,121,252,248,68,137,56,68,139,121,252,252,68,137,120,4,131,192,
|
||||
8,199,65,252,252,237,131,252,237,1,15,133,244,1,248,2,255,68,139,187,233,
|
||||
139,3,15,182,204,15,182,232,131,195,4,193,232,16,65,252,255,36,252,238,255,
|
||||
248,3,199,64,4,237,131,192,8,131,252,237,1,15,133,244,3,252,233,244,2,255,
|
||||
139,106,252,248,76,139,189,233,139,108,36,24,141,68,194,252,248,137,149,233,
|
||||
141,136,233,59,141,233,137,133,233,255,137,252,239,255,76,137,252,254,137,
|
||||
252,239,255,15,135,244,21,65,199,134,233,237,255,65,252,255,215,255,65,252,
|
||||
255,150,233,255,65,199,134,233,237,139,149,233,141,12,194,252,247,217,3,141,
|
||||
233,139,90,252,252,252,233,244,12,255,254,0
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -1962,13 +1962,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
|
||||
break;
|
||||
|
||||
case BC_TSETM:
|
||||
dasm_put(Dst, 12502);
|
||||
if (sse) {
|
||||
dasm_put(Dst, 12507);
|
||||
} else {
|
||||
}
|
||||
dasm_put(Dst, 12515, Dt6(->marked), LJ_GC_BLACK, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base));
|
||||
dasm_put(Dst, 12663, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist));
|
||||
dasm_put(Dst, 12502, Dt6(->marked), LJ_GC_BLACK, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base));
|
||||
dasm_put(Dst, 12658, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist));
|
||||
break;
|
||||
|
||||
/* -- Calls and vararg handling ----------------------------------------- */
|
||||
@@ -1976,60 +1971,60 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
|
||||
case BC_CALL: case BC_CALLM:
|
||||
dasm_put(Dst, 10113);
|
||||
if (op == BC_CALLM) {
|
||||
dasm_put(Dst, 12683);
|
||||
dasm_put(Dst, 12678);
|
||||
}
|
||||
dasm_put(Dst, 12688, LJ_TFUNC, Dt7(->pc));
|
||||
dasm_put(Dst, 12683, LJ_TFUNC, Dt7(->pc));
|
||||
break;
|
||||
|
||||
case BC_CALLMT:
|
||||
dasm_put(Dst, 12683);
|
||||
dasm_put(Dst, 12678);
|
||||
break;
|
||||
case BC_CALLT:
|
||||
dasm_put(Dst, 12731, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc));
|
||||
dasm_put(Dst, 12855, FRAME_TYPE, Dt7(->pc), PC2PROTO(k), FRAME_VARG, FRAME_TYPEP, FRAME_VARG);
|
||||
dasm_put(Dst, 12726, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc));
|
||||
dasm_put(Dst, 12850, FRAME_TYPE, Dt7(->pc), PC2PROTO(k), FRAME_VARG, FRAME_TYPEP, FRAME_VARG);
|
||||
break;
|
||||
|
||||
case BC_ITERC:
|
||||
dasm_put(Dst, 12929, LJ_TFUNC, 2+1, Dt7(->pc));
|
||||
dasm_put(Dst, 12924, LJ_TFUNC, 2+1, Dt7(->pc));
|
||||
break;
|
||||
|
||||
case BC_VARG:
|
||||
dasm_put(Dst, 13011, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL);
|
||||
dasm_put(Dst, 13165, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top));
|
||||
dasm_put(Dst, 13006, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL);
|
||||
dasm_put(Dst, 13160, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top));
|
||||
break;
|
||||
|
||||
/* -- Returns ----------------------------------------------------------- */
|
||||
|
||||
case BC_RETM:
|
||||
dasm_put(Dst, 12683);
|
||||
dasm_put(Dst, 12678);
|
||||
break;
|
||||
|
||||
case BC_RET: case BC_RET0: case BC_RET1:
|
||||
if (op != BC_RET0) {
|
||||
dasm_put(Dst, 13270);
|
||||
dasm_put(Dst, 13265);
|
||||
}
|
||||
dasm_put(Dst, 13274, FRAME_TYPE);
|
||||
dasm_put(Dst, 13269, FRAME_TYPE);
|
||||
switch (op) {
|
||||
case BC_RET:
|
||||
dasm_put(Dst, 13293);
|
||||
dasm_put(Dst, 13288);
|
||||
break;
|
||||
case BC_RET1:
|
||||
dasm_put(Dst, 13357);
|
||||
dasm_put(Dst, 13352);
|
||||
/* fallthrough */
|
||||
case BC_RET0:
|
||||
dasm_put(Dst, 13373);
|
||||
dasm_put(Dst, 13368);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
dasm_put(Dst, 13384, Dt7(->pc), PC2PROTO(k));
|
||||
dasm_put(Dst, 13379, Dt7(->pc), PC2PROTO(k));
|
||||
if (op == BC_RET) {
|
||||
dasm_put(Dst, 13432, LJ_TNIL);
|
||||
dasm_put(Dst, 13427, LJ_TNIL);
|
||||
} else {
|
||||
dasm_put(Dst, 13443, LJ_TNIL);
|
||||
dasm_put(Dst, 13438, LJ_TNIL);
|
||||
}
|
||||
dasm_put(Dst, 13450, -FRAME_VARG, FRAME_TYPEP);
|
||||
dasm_put(Dst, 13445, -FRAME_VARG, FRAME_TYPEP);
|
||||
if (op != BC_RET0) {
|
||||
dasm_put(Dst, 13474);
|
||||
dasm_put(Dst, 13469);
|
||||
}
|
||||
dasm_put(Dst, 4599);
|
||||
break;
|
||||
@@ -2039,7 +2034,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
|
||||
|
||||
case BC_FORL:
|
||||
#if LJ_HASJIT
|
||||
dasm_put(Dst, 13478, HOTCOUNT_PCMASK, GG_DISP2HOT);
|
||||
dasm_put(Dst, 13473, HOTCOUNT_PCMASK, GG_DISP2HOT);
|
||||
#endif
|
||||
break;
|
||||
|
||||
@@ -2051,57 +2046,57 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
|
||||
case BC_FORI:
|
||||
case BC_IFORL:
|
||||
vk = (op == BC_IFORL || op == BC_JFORL);
|
||||
dasm_put(Dst, 13499);
|
||||
dasm_put(Dst, 13494);
|
||||
if (!vk) {
|
||||
dasm_put(Dst, 13503, LJ_TISNUM, LJ_TISNUM);
|
||||
dasm_put(Dst, 13498, LJ_TISNUM, LJ_TISNUM);
|
||||
}
|
||||
dasm_put(Dst, 13522);
|
||||
dasm_put(Dst, 13517);
|
||||
if (!vk) {
|
||||
dasm_put(Dst, 13526, LJ_TISNUM);
|
||||
dasm_put(Dst, 13521, LJ_TISNUM);
|
||||
}
|
||||
if (sse) {
|
||||
dasm_put(Dst, 13535);
|
||||
dasm_put(Dst, 13530);
|
||||
if (vk) {
|
||||
dasm_put(Dst, 13547);
|
||||
dasm_put(Dst, 13542);
|
||||
} else {
|
||||
dasm_put(Dst, 13566);
|
||||
dasm_put(Dst, 13561);
|
||||
}
|
||||
dasm_put(Dst, 13571);
|
||||
dasm_put(Dst, 13566);
|
||||
} else {
|
||||
dasm_put(Dst, 13584);
|
||||
dasm_put(Dst, 13579);
|
||||
if (vk) {
|
||||
dasm_put(Dst, 13590);
|
||||
dasm_put(Dst, 13585);
|
||||
} else {
|
||||
dasm_put(Dst, 13606);
|
||||
dasm_put(Dst, 13601);
|
||||
}
|
||||
dasm_put(Dst, 13614);
|
||||
dasm_put(Dst, 13609);
|
||||
if (cmov) {
|
||||
dasm_put(Dst, 9528);
|
||||
} else {
|
||||
dasm_put(Dst, 9534);
|
||||
}
|
||||
if (!cmov) {
|
||||
dasm_put(Dst, 13619);
|
||||
dasm_put(Dst, 13614);
|
||||
}
|
||||
}
|
||||
if (op == BC_FORI) {
|
||||
dasm_put(Dst, 13625, -BCBIAS_J*4);
|
||||
dasm_put(Dst, 13620, -BCBIAS_J*4);
|
||||
} else if (op == BC_JFORI) {
|
||||
dasm_put(Dst, 13635, -BCBIAS_J*4, BC_JLOOP);
|
||||
dasm_put(Dst, 13630, -BCBIAS_J*4, BC_JLOOP);
|
||||
} else if (op == BC_IFORL) {
|
||||
dasm_put(Dst, 13649, -BCBIAS_J*4);
|
||||
dasm_put(Dst, 13644, -BCBIAS_J*4);
|
||||
} else {
|
||||
dasm_put(Dst, 13645, BC_JLOOP);
|
||||
dasm_put(Dst, 13640, BC_JLOOP);
|
||||
}
|
||||
dasm_put(Dst, 9563);
|
||||
if (sse) {
|
||||
dasm_put(Dst, 13659);
|
||||
dasm_put(Dst, 13654);
|
||||
}
|
||||
break;
|
||||
|
||||
case BC_ITERL:
|
||||
#if LJ_HASJIT
|
||||
dasm_put(Dst, 13478, HOTCOUNT_PCMASK, GG_DISP2HOT);
|
||||
dasm_put(Dst, 13473, HOTCOUNT_PCMASK, GG_DISP2HOT);
|
||||
#endif
|
||||
break;
|
||||
|
||||
@@ -2110,18 +2105,18 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
|
||||
break;
|
||||
#endif
|
||||
case BC_IITERL:
|
||||
dasm_put(Dst, 13670, LJ_TNIL);
|
||||
dasm_put(Dst, 13665, LJ_TNIL);
|
||||
if (op == BC_JITERL) {
|
||||
dasm_put(Dst, 13685, BC_JLOOP);
|
||||
dasm_put(Dst, 13680, BC_JLOOP);
|
||||
} else {
|
||||
dasm_put(Dst, 13699, -BCBIAS_J*4);
|
||||
dasm_put(Dst, 13694, -BCBIAS_J*4);
|
||||
}
|
||||
dasm_put(Dst, 9867);
|
||||
break;
|
||||
|
||||
case BC_LOOP:
|
||||
#if LJ_HASJIT
|
||||
dasm_put(Dst, 13478, HOTCOUNT_PCMASK, GG_DISP2HOT);
|
||||
dasm_put(Dst, 13473, HOTCOUNT_PCMASK, GG_DISP2HOT);
|
||||
#endif
|
||||
break;
|
||||
|
||||
@@ -2131,12 +2126,12 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
|
||||
|
||||
case BC_JLOOP:
|
||||
#if LJ_HASJIT
|
||||
dasm_put(Dst, 13715, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L));
|
||||
dasm_put(Dst, 13710, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L));
|
||||
#endif
|
||||
break;
|
||||
|
||||
case BC_JMP:
|
||||
dasm_put(Dst, 13756, -BCBIAS_J*4);
|
||||
dasm_put(Dst, 13751, -BCBIAS_J*4);
|
||||
break;
|
||||
|
||||
/* -- Function headers -------------------------------------------------- */
|
||||
@@ -2150,7 +2145,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
|
||||
|
||||
case BC_FUNCF:
|
||||
#if LJ_HASJIT
|
||||
dasm_put(Dst, 13782, HOTCOUNT_PCMASK, GG_DISP2HOT);
|
||||
dasm_put(Dst, 13777, HOTCOUNT_PCMASK, GG_DISP2HOT);
|
||||
#endif
|
||||
case BC_FUNCV: /* NYI: compiled vararg functions. */
|
||||
break;
|
||||
@@ -2160,13 +2155,13 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
|
||||
break;
|
||||
#endif
|
||||
case BC_IFUNCF:
|
||||
dasm_put(Dst, 13803, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams));
|
||||
dasm_put(Dst, 13798, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams));
|
||||
if (op == BC_JFUNCF) {
|
||||
dasm_put(Dst, 13834, BC_JLOOP);
|
||||
dasm_put(Dst, 13829, BC_JLOOP);
|
||||
} else {
|
||||
dasm_put(Dst, 9565);
|
||||
}
|
||||
dasm_put(Dst, 13843, LJ_TNIL);
|
||||
dasm_put(Dst, 13838, LJ_TNIL);
|
||||
break;
|
||||
|
||||
case BC_JFUNCV:
|
||||
@@ -2177,30 +2172,30 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
|
||||
break; /* NYI: compiled vararg functions. */
|
||||
|
||||
case BC_IFUNCV:
|
||||
dasm_put(Dst, 13865, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL);
|
||||
dasm_put(Dst, 13860, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL);
|
||||
if (op == BC_JFUNCV) {
|
||||
dasm_put(Dst, 13834, BC_JLOOP);
|
||||
dasm_put(Dst, 13829, BC_JLOOP);
|
||||
} else {
|
||||
dasm_put(Dst, 13962, -4+PC2PROTO(k));
|
||||
dasm_put(Dst, 13957, -4+PC2PROTO(k));
|
||||
}
|
||||
dasm_put(Dst, 13987, LJ_TNIL);
|
||||
dasm_put(Dst, 13982, LJ_TNIL);
|
||||
break;
|
||||
|
||||
case BC_FUNCC:
|
||||
case BC_FUNCCW:
|
||||
dasm_put(Dst, 14009, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top));
|
||||
dasm_put(Dst, 14004, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top));
|
||||
if (op == BC_FUNCC) {
|
||||
dasm_put(Dst, 14039);
|
||||
dasm_put(Dst, 14034);
|
||||
} else {
|
||||
dasm_put(Dst, 14043);
|
||||
dasm_put(Dst, 14038);
|
||||
}
|
||||
dasm_put(Dst, 14051, DISPATCH_GL(vmstate), ~LJ_VMST_C);
|
||||
dasm_put(Dst, 14046, DISPATCH_GL(vmstate), ~LJ_VMST_C);
|
||||
if (op == BC_FUNCC) {
|
||||
dasm_put(Dst, 14061);
|
||||
dasm_put(Dst, 14056);
|
||||
} else {
|
||||
dasm_put(Dst, 14066, DISPATCH_GL(wrapf));
|
||||
dasm_put(Dst, 14061, DISPATCH_GL(wrapf));
|
||||
}
|
||||
dasm_put(Dst, 14072, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top));
|
||||
dasm_put(Dst, 14067, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top));
|
||||
break;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@@ -2228,7 +2223,7 @@ static int build_backend(BuildCtx *ctx)
|
||||
|
||||
build_subroutines(ctx, cmov, sse);
|
||||
|
||||
dasm_put(Dst, 14098);
|
||||
dasm_put(Dst, 14093);
|
||||
for (op = 0; op < BC__MAX; op++)
|
||||
build_ins(ctx, (BCOp)op, op, cmov, sse);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user