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 | luajit-82eca898db87bde10fbbb14a0f35ef75b6c3dcc6.tar.gz luajit-82eca898db87bde10fbbb14a0f35ef75b6c3dcc6.tar.bz2 luajit-82eca898db87bde10fbbb14a0f35ef75b6c3dcc6.zip |
Prefer recording loops over calls.
Hotcounts are decremented by 2 for loops and by 1 for calls.
Diffstat (limited to '')
-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) | |||
643 | /* A hotcount triggered. Start recording a root trace. */ | 643 | /* A hotcount triggered. Start recording a root trace. */ |
644 | void LJ_FASTCALL lj_trace_hot(jit_State *J, const BCIns *pc) | 644 | void LJ_FASTCALL lj_trace_hot(jit_State *J, const BCIns *pc) |
645 | { | 645 | { |
646 | ERRNO_SAVE | ||
647 | /* Note: pc is the interpreter bytecode PC here. It's offset by 1. */ | 646 | /* Note: pc is the interpreter bytecode PC here. It's offset by 1. */ |
648 | hotcount_set(J2GG(J), pc, J->param[JIT_P_hotloop]+1); /* Reset hotcount. */ | 647 | ERRNO_SAVE |
648 | /* Reset hotcount. */ | ||
649 | hotcount_set(J2GG(J), pc, J->param[JIT_P_hotloop]*HOTCOUNT_LOOP); | ||
649 | /* Only start a new trace if not recording or inside __gc call or vmevent. */ | 650 | /* Only start a new trace if not recording or inside __gc call or vmevent. */ |
650 | if (J->state == LJ_TRACE_IDLE && | 651 | if (J->state == LJ_TRACE_IDLE && |
651 | !(J2G(J)->hookmask & (HOOK_GC|HOOK_VMEVENT))) { | 652 | !(J2G(J)->hookmask & (HOOK_GC|HOOK_VMEVENT))) { |