static inline void MarkValueInternal(JSTracer *trc, Value *v) { if (v->isMarkable()) { JS_ASSERT(v->toGCThing()); void *thing = v->toGCThing(); JS_SET_TRACING_LOCATION(trc, (void *)v); MarkKind(trc, &thing, v->gcKind()); if (v->isString()) v->setString((JSString *)thing); else v->setObjectOrNull((JSObject *)thing); } else { JS_SET_TRACING_LOCATION(trc, NULL); } }
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 }
static inline void MarkIdInternal(JSTracer *trc, jsid *id) { if (JSID_IS_STRING(*id)) { JSString *str = JSID_TO_STRING(*id); JS_SET_TRACING_LOCATION(trc, (void *)id); MarkInternal(trc, &str); *id = NON_INTEGER_ATOM_TO_JSID(reinterpret_cast<JSAtom *>(str)); } else if (JS_UNLIKELY(JSID_IS_OBJECT(*id))) { JSObject *obj = JSID_TO_OBJECT(*id); JS_SET_TRACING_LOCATION(trc, (void *)id); MarkInternal(trc, &obj); *id = OBJECT_TO_JSID(obj); } else { /* Unset realLocation manually if we do not call MarkInternal. */ JS_UNSET_TRACING_LOCATION(trc); } }
static inline void MarkValueInternal(JSTracer *trc, Value *v) { if (v->isMarkable()) { JS_ASSERT(v->toGCThing()); void *thing = v->toGCThing(); JS_SET_TRACING_LOCATION(trc, (void *)v); MarkKind(trc, &thing, v->gcKind()); if (v->isString()) v->setString((JSString *)thing); else v->setObjectOrNull((JSObject *)thing); } else { /* Unset realLocation manually if we do not call MarkInternal. */ JS_UNSET_TRACING_LOCATION(trc); } }