Prefer recording loops over calls.

Hotcounts are decremented by 2 for loops and by 1 for calls.
This commit is contained in:
Mike Pall
2011-06-29 01:51:39 +02:00
parent deeb8196c4
commit 82eca898db
10 changed files with 151 additions and 141 deletions

View File

@@ -746,7 +746,7 @@ static const unsigned char build_actionlist[16011] = {
36,252,235,248,6,255,199,71,252,252,237,131,199,8,255,199,68,194,252,244,
237,255,131,192,1,252,233,244,5,248,7,141,174,233,252,247,197,237,15,133,
244,14,41,252,234,255,1,252,233,255,137,252,245,209,252,237,129,229,239,102,
131,172,253,43,233,1,15,132,244,148,255,141,12,202,255,129,121,253,4,239,
129,172,253,43,233,238,15,130,244,148,255,141,12,202,255,129,121,253,4,239,
15,133,244,255,255,129,121,253,12,239,15,133,244,60,129,121,253,20,239,15,
133,244,60,139,41,131,121,16,0,15,140,244,251,255,129,121,253,12,239,15,133,
244,165,129,121,253,20,239,15,133,244,165,255,139,105,16,133,252,237,15,136,
@@ -775,21 +775,21 @@ static const unsigned char build_actionlist[16011] = {
15,127,153,233,102,68,15,127,161,233,102,68,15,127,169,233,102,68,15,127,
177,233,102,68,15,127,185,233,252,255,224,255,141,180,253,134,233,139,6,15,
182,204,15,182,232,131,198,4,193,232,16,252,255,36,252,235,255,137,252,245,
209,252,237,129,229,239,102,131,172,253,43,233,1,15,132,244,150,255,139,190,
233,139,108,36,96,141,12,202,59,141,233,15,135,244,24,15,182,142,233,57,200,
15,134,244,249,248,2,255,15,183,70,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,139,122,252,248,137,104,252,252,137,120,252,248,139,108,36,96,141,
12,200,59,141,233,15,135,244,23,137,209,137,194,15,182,174,233,133,252,237,
15,132,244,248,248,1,131,193,8,57,209,15,131,244,249,139,121,252,248,137,
56,139,121,252,252,137,120,4,131,192,8,199,65,252,252,237,131,252,237,1,15,
133,244,1,248,2,255,139,190,233,139,6,15,182,204,15,182,232,131,198,4,193,
232,16,252,255,36,252,235,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,72,139,189,233,139,108,36,
96,141,68,194,252,248,137,149,233,141,136,233,59,141,233,137,133,233,255,
72,137,252,250,137,252,233,255,15,135,244,22,199,131,233,237,255,252,255,
215,255,252,255,147,233,255,199,131,233,237,139,149,233,141,12,194,252,247,
217,3,141,233,139,114,252,252,252,233,244,12,255,254,0
209,252,237,129,229,239,102,129,172,253,43,233,238,15,130,244,150,255,139,
190,233,139,108,36,96,141,12,202,59,141,233,15,135,244,24,15,182,142,233,
57,200,15,134,244,249,248,2,255,15,183,70,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,139,122,252,248,137,104,252,252,137,120,252,248,139,108,
36,96,141,12,200,59,141,233,15,135,244,23,137,209,137,194,15,182,174,233,
133,252,237,15,132,244,248,248,1,131,193,8,57,209,15,131,244,249,139,121,
252,248,137,56,139,121,252,252,137,120,4,131,192,8,199,65,252,252,237,131,
252,237,1,15,133,244,1,248,2,255,139,190,233,139,6,15,182,204,15,182,232,
131,198,4,193,232,16,252,255,36,252,235,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,72,139,189,233,
139,108,36,96,141,68,194,252,248,137,149,233,141,136,233,59,141,233,137,133,
233,255,72,137,252,250,137,252,233,255,15,135,244,22,199,131,233,237,255,
252,255,215,255,252,255,147,233,255,199,131,233,237,139,149,233,141,12,194,
252,247,217,3,141,233,139,114,252,252,252,233,244,12,255,254,0
};
enum {
@@ -2775,7 +2775,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
case BC_FORL:
#if LJ_HASJIT
dasm_put(Dst, 15111, HOTCOUNT_PCMASK, GG_DISP2HOT);
dasm_put(Dst, 15111, HOTCOUNT_PCMASK, GG_DISP2HOT, HOTCOUNT_LOOP);
#endif
break;
@@ -2891,7 +2891,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
case BC_ITERL:
#if LJ_HASJIT
dasm_put(Dst, 15111, HOTCOUNT_PCMASK, GG_DISP2HOT);
dasm_put(Dst, 15111, HOTCOUNT_PCMASK, GG_DISP2HOT, HOTCOUNT_LOOP);
#endif
break;
@@ -2911,7 +2911,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
case BC_LOOP:
#if LJ_HASJIT
dasm_put(Dst, 15111, HOTCOUNT_PCMASK, GG_DISP2HOT);
dasm_put(Dst, 15111, HOTCOUNT_PCMASK, GG_DISP2HOT, HOTCOUNT_LOOP);
#endif
break;
@@ -2940,7 +2940,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
case BC_FUNCF:
#if LJ_HASJIT
dasm_put(Dst, 15710, HOTCOUNT_PCMASK, GG_DISP2HOT);
dasm_put(Dst, 15710, HOTCOUNT_PCMASK, GG_DISP2HOT, HOTCOUNT_CALL);
#endif
case BC_FUNCV: /* NYI: compiled vararg functions. */
break;