Bug 472461 part 2 - jsgc crashes with !JS_TRACER, r=jorendorff for immediate bustage fix, and I'll get ex-post-facto review from Igor

This commit is contained in:
Benjamin Smedberg 2009-01-08 10:44:16 -05:00
parent 9d2a991be0
commit 2e26c94375
2 changed files with 9 additions and 1 deletions

View File

@ -187,8 +187,10 @@ struct JSThread {
/* Property cache for faster call/get/set invocation. */
JSPropertyCache propertyCache;
#ifdef JS_TRACER
/* Trace-tree JIT recorder/interpreter state. */
JSTraceMonitor traceMonitor;
#endif
/* Lock-free list of scripts created by eval to garbage-collect. */
JSScript *scriptsToGC;

View File

@ -1834,7 +1834,11 @@ js_NewGCThing(JSContext *cx, uintN flags, size_t nbytes)
arenaList = &rt->gcArenaList[flindex];
for (;;) {
if (doGC && !JS_ON_TRACE(cx) && !JS_TRACE_MONITOR(cx).useReservedObjects) {
if (doGC
#ifdef JS_TRACER
&& !JS_ON_TRACE(cx) && !JS_TRACE_MONITOR(cx).useReservedObjects
#endif
) {
/*
* Keep rt->gcLock across the call into js_GC so we don't starve
* and lose to racing threads who deplete the heap just after
@ -3100,6 +3104,7 @@ js_TraceRuntime(JSTracer *trc, JSBool allAtoms)
if (rt->gcExtraRootsTraceOp)
rt->gcExtraRootsTraceOp(trc, rt->gcExtraRootsData);
#ifdef JS_TRACER
#ifdef JS_THREADSAFE
/* Trace the loop table(s) which can contain pointers to code objects. */
while ((acx = js_ContextIterator(rt, JS_FALSE, &iter)) != NULL) {
@ -3110,6 +3115,7 @@ js_TraceRuntime(JSTracer *trc, JSBool allAtoms)
#else
js_TraceTraceMonitor(trc, &rt->traceMonitor);
#endif
#endif
}
static void