Add a global slot list to the trace monitor.

This commit is contained in:
Andreas Gal 2008-08-18 13:12:19 -07:00
parent a75e5194c0
commit bcb5cd6a9b
2 changed files with 8 additions and 0 deletions

View File

@ -99,6 +99,8 @@ namespace nanojit {
class Fragmento;
}
class TraceRecorder;
extern "C++" template<typename T> class Queue;
typedef Queue<uint16> SlotList;
# define CLS(T) T*
#else
@ -125,6 +127,7 @@ typedef struct JSFragmentCacheEntry {
typedef struct JSTraceMonitor {
CLS(nanojit::Fragmento) fragmento;
CLS(TraceRecorder) recorder;
CLS(SlotList) slotList;
JSFragmentCacheEntry fcache[JS_FRAGMENT_CACHE_SIZE];
} JSTraceMonitor;

View File

@ -2049,11 +2049,13 @@ extern void
js_InitJIT(JSTraceMonitor *tm)
{
if (!tm->fragmento) {
JS_ASSERT(!tm->slotList);
Fragmento* fragmento = new (&gc) Fragmento(core, 24);
verbose_only(fragmento->labels = new (&gc) LabelMap(core, NULL);)
fragmento->assm()->setCallTable(builtins);
fragmento->pageFree(fragmento->pageAlloc()); // FIXME: prime page cache
tm->fragmento = fragmento;
tm->slotList = new SlotList();
}
#if !defined XP_WIN
debug_only(memset(&stat, 0, sizeof(stat)));
@ -2075,9 +2077,12 @@ js_FinishJIT(JSTraceMonitor *tm)
stat.typeMapMismatchAtEntry, stat.globalShapeMismatchAtEntry);
#endif
if (tm->fragmento != NULL) {
JS_ASSERT(tm->slotList);
verbose_only(delete tm->fragmento->labels;)
delete tm->fragmento;
tm->fragmento = NULL;
delete tm->slotList;
tm->slotList = NULL;
}
}