Cleanup recorder activation, use a single hot loop threshold (10).

This commit is contained in:
Andreas Gal 2008-07-17 13:42:58 -07:00
parent d12de2bcc6
commit 3df09fb85c

View File

@ -70,7 +70,7 @@
#ifdef DEBUG
static struct {
uint64 recorderStarted, recorderAborted, traceCompleted, sideExitIntoInterpreter,
blacklisted, typeMapMismatchAtEntry, returnToDifferentLoopHeader, traceTriggered,
typeMapMismatchAtEntry, returnToDifferentLoopHeader, traceTriggered,
globalShapeMismatchAtEntry, typeMapTrashed, slotDemoted, slotPromoted, unstableLoopVariable;
} stat = { 0LL, };
#define AUDIT(x) (stat.x++)
@ -1048,9 +1048,7 @@ js_DeleteRecorder(JSContext* cx)
tm->recorder = NULL;
}
#define HOTLOOP1 10
#define HOTLOOP2 13
#define HOTLOOP3 37
#define HOTLOOP 10
bool
js_LoopEdge(JSContext* cx)
@ -1082,9 +1080,7 @@ js_LoopEdge(JSContext* cx)
Fragment* f = tm->fragmento->getLoop(cx->fp->regs->pc);
if (!f->code()) {
int hits = ++f->hits();
if (!f->isBlacklisted() && hits >= HOTLOOP1) {
if (hits == HOTLOOP1 || hits == HOTLOOP2 || hits == HOTLOOP3) {
if (++f->hits() >= HOTLOOP) {
AUDIT(recorderStarted);
f->calldepth = 0;
/* allocate space to store the LIR for this tree */
@ -1137,9 +1133,6 @@ js_LoopEdge(JSContext* cx)
/* start recording if no exception during construction */
return !cx->throwing;
}
if (hits > HOTLOOP3)
f->blacklist();
}
return false;
}
@ -1235,9 +1228,9 @@ js_DestroyJIT(JSContext* cx)
"unstable loop variable(%llu)\n", stat.recorderStarted, stat.recorderAborted,
stat.traceCompleted, stat.returnToDifferentLoopHeader, stat.typeMapTrashed,
stat.slotDemoted, stat.slotPromoted, stat.unstableLoopVariable);
printf("monitor: triggered(%llu), exits (%llu), blacklisted(%llu), type mismatch(%llu), "
printf("monitor: triggered(%llu), exits (%llu), type mismatch(%llu), "
"global mismatch(%llu)\n", stat.traceTriggered, stat.sideExitIntoInterpreter,
stat.blacklisted, stat.typeMapMismatchAtEntry, stat.globalShapeMismatchAtEntry);
stat.typeMapMismatchAtEntry, stat.globalShapeMismatchAtEntry);
#endif
}