diff options
author | Mike Pall <mike> | 2011-06-29 01:51:39 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2011-06-29 01:52:23 +0200 |
commit | 82eca898db87bde10fbbb14a0f35ef75b6c3dcc6 (patch) | |
tree | 9b5aa8a81267664430a94fc40a131fe33c1832d7 /src/lj_trace.c | |
parent | deeb8196c4d4085f3cc5a3389b568de7da739190 (diff) | |
download | luajit2-82eca898db87bde10fbbb14a0f35ef75b6c3dcc6.tar.gz |
Prefer recording loops over calls.
Hotcounts are decremented by 2 for loops and by 1 for calls.
Diffstat (limited to 'src/lj_trace.c')
-rw-r--r-- | src/lj_trace.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lj_trace.c b/src/lj_trace.c index c65ca9cd..33cc98f7 100644 --- a/src/lj_trace.c +++ b/src/lj_trace.c @@ -643,9 +643,10 @@ void lj_trace_ins(jit_State *J, const BCIns *pc) /* A hotcount triggered. Start recording a root trace. */ void LJ_FASTCALL lj_trace_hot(jit_State *J, const BCIns *pc) { - ERRNO_SAVE /* Note: pc is the interpreter bytecode PC here. It's offset by 1. */ - hotcount_set(J2GG(J), pc, J->param[JIT_P_hotloop]+1); /* Reset hotcount. */ + ERRNO_SAVE + /* Reset hotcount. */ + hotcount_set(J2GG(J), pc, J->param[JIT_P_hotloop]*HOTCOUNT_LOOP); /* Only start a new trace if not recording or inside __gc call or vmevent. */ if (J->state == LJ_TRACE_IDLE && !(J2G(J)->hookmask & (HOOK_GC|HOOK_VMEVENT))) { |