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

@@ -798,12 +798,12 @@ static const unsigned char build_actionlist[17111] = {
204,15,182,232,131,198,4,193,232,16,252,255,36,171,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,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,244,251,3,41,15,128,244,247,137,41,
255,59,105,8,199,65,28,237,137,105,24,255,15,142,244,253,248,1,248,6,141,
137,252,245,209,252,237,129,229,239,102,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,244,251,3,41,15,128,244,247,137,
41,255,59,105,8,199,65,28,237,137,105,24,255,15,142,244,253,248,1,248,6,141,
180,253,134,233,255,141,180,253,134,233,15,183,70,252,254,15,142,245,248,
1,248,6,255,15,143,244,253,248,6,141,180,253,134,233,248,1,255,248,7,139,
6,15,182,204,15,182,232,131,198,4,193,232,16,252,255,36,171,248,5,255,3,41,
@@ -823,11 +823,11 @@ static const unsigned char build_actionlist[17111] = {
134,233,139,1,137,105,252,252,137,65,252,248,255,139,139,233,139,4,129,139,
128,233,139,108,36,48,137,147,233,137,171,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,171,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,48,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,
137,252,245,209,252,237,129,229,239,102,129,172,253,43,233,238,15,130,244,
150,255,139,190,233,139,108,36,48,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,48,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,
@@ -2933,7 +2933,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
case BC_FORL:
#if LJ_HASJIT
dasm_put(Dst, 16297, HOTCOUNT_PCMASK, GG_DISP2HOT);
dasm_put(Dst, 16297, HOTCOUNT_PCMASK, GG_DISP2HOT, HOTCOUNT_LOOP);
#endif
break;
@@ -3049,7 +3049,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
case BC_ITERL:
#if LJ_HASJIT
dasm_put(Dst, 16297, HOTCOUNT_PCMASK, GG_DISP2HOT);
dasm_put(Dst, 16297, HOTCOUNT_PCMASK, GG_DISP2HOT, HOTCOUNT_LOOP);
#endif
break;
@@ -3069,7 +3069,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
case BC_LOOP:
#if LJ_HASJIT
dasm_put(Dst, 16297, HOTCOUNT_PCMASK, GG_DISP2HOT);
dasm_put(Dst, 16297, HOTCOUNT_PCMASK, GG_DISP2HOT, HOTCOUNT_LOOP);
#endif
break;
@@ -3098,7 +3098,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
case BC_FUNCF:
#if LJ_HASJIT
dasm_put(Dst, 16808, HOTCOUNT_PCMASK, GG_DISP2HOT);
dasm_put(Dst, 16808, HOTCOUNT_PCMASK, GG_DISP2HOT, HOTCOUNT_CALL);
#endif
case BC_FUNCV: /* NYI: compiled vararg functions. */
break;