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

@@ -50,7 +50,8 @@ void lj_dispatch_init(GG_State *GG)
/* Initialize hotcount table. */
void lj_dispatch_init_hotcount(global_State *g)
{
HotCount start = (HotCount)G2J(g)->param[JIT_P_hotloop];
int32_t hotloop = G2J(g)->param[JIT_P_hotloop];
HotCount start = (HotCount)(hotloop*HOTCOUNT_LOOP - 1);
HotCount *hotcount = G2GG(g)->hotcount;
uint32_t i;
for (i = 0; i < HOTCOUNT_SIZE; i++)