void MarkInternal(JSTracer *trc, T **thingp) { JS_ASSERT(thingp); T *thing = *thingp; CheckMarkedThing(trc, thing); JSRuntime *rt = trc->runtime; JS_ASSERT_IF(rt->gcCheckCompartment, thing->compartment() == rt->gcCheckCompartment || thing->compartment() == rt->atomsCompartment); /* * Don't mark things outside a compartment if we are in a per-compartment * GC. */ if (!rt->gcCurrentCompartment || thing->compartment() == rt->gcCurrentCompartment) { if (!trc->callback) { PushMarkStack(static_cast<GCMarker *>(trc), thing); } else { trc->callback(trc, (void **)thingp, GetGCThingTraceKind(thing)); } } #ifdef DEBUG trc->debugPrinter = NULL; trc->debugPrintArg = NULL; #endif }
void MarkInternal(JSTracer *trc, T **thingp) { JS_ASSERT(thingp); T *thing = *thingp; CheckMarkedThing(trc, thing); /* * Don't mark things outside a compartment if we are in a per-compartment * GC. */ if (!trc->callback) { if (thing->compartment()->isCollecting()) PushMarkStack(static_cast<GCMarker *>(trc), thing); } else { trc->callback(trc, (void **)thingp, GetGCThingTraceKind(thing)); JS_SET_TRACING_LOCATION(trc, NULL); } #ifdef DEBUG trc->debugPrinter = NULL; trc->debugPrintArg = NULL; #endif }