Store the recorder script in JSTraceMonitor and make sure its traced by the GC. Also clean up the tracing of JSTraceMonitor.

This commit is contained in:
Andreas Gal 2008-06-03 17:35:30 -07:00
parent 02b2fde780
commit be39054e45
2 changed files with 12 additions and 6 deletions

View File

@ -2860,6 +2860,14 @@ js_TraceContext(JSTracer *trc, JSContext *acx)
js_TraceSharpMap(trc, &acx->sharpObjectMap); js_TraceSharpMap(trc, &acx->sharpObjectMap);
} }
void
js_TraceTraceMonitor(JSTracer *trc, JSTraceMonitor *tm)
{
TRACE_JSVALS(trc, tm->loopTableSize, tm->loopTable, "loop table");
if (tm->recorderScriptObject)
JS_CALL_OBJECT_TRACER(trc, tm->recorderScriptObject, "recorder script object");
}
void void
js_TraceRuntime(JSTracer *trc, JSBool allAtoms) js_TraceRuntime(JSTracer *trc, JSBool allAtoms)
{ {
@ -2885,14 +2893,10 @@ js_TraceRuntime(JSTracer *trc, JSBool allAtoms)
while ((acx = js_ContextIterator(rt, JS_FALSE, &iter)) != NULL) { while ((acx = js_ContextIterator(rt, JS_FALSE, &iter)) != NULL) {
if (!acx->thread) if (!acx->thread)
continue; continue;
JSTraceMonitor* tm = &acx->thread->traceMonitor; js_TraceTraceMonitor(trc, &acx->thread->traceMonitor);
TRACE_JSVALS(trc, tm->loopTableSize, tm->loopTable,
"thread->traceMonitor.loopTable");
} }
#else #else
JSTraceMonitor* tm = &rt->traceMonitor; js_TraceTraceMonitor(trc, &rt->traceMonitor);
TRACE_JSVALS(trc, tm->loopTableSize, tm->loopTable,
"rt->traceMonitor.loopTable");
#endif #endif
} }

View File

@ -57,6 +57,8 @@
struct JSTraceMonitor { struct JSTraceMonitor {
jsval *loopTable; jsval *loopTable;
uint32 loopTableSize; uint32 loopTableSize;
JSScript *recorderScript;
JSObject *recorderScriptObject;
}; };
#define TRACE_THRESHOLD 10 #define TRACE_THRESHOLD 10