Loading js/src/gc/Marking.cpp +6 −7 Original line number Diff line number Diff line Loading @@ -157,23 +157,22 @@ IsMovingTracer(JSTracer *trc) } #endif template <typename T> bool ThingIsPermanentAtomOrWellKnownSymbol(T* thing) { return false; } template <> bool ThingIsPermanentAtomOrWellKnownSymbol<JSString>(JSString* str) { bool ThingIsPermanentAtomOrWellKnownSymbol(JSString* str) { return str->isPermanentAtom(); } template <> bool ThingIsPermanentAtomOrWellKnownSymbol<JSFlatString>(JSFlatString* str) { bool ThingIsPermanentAtomOrWellKnownSymbol(JSFlatString* str) { return str->isPermanentAtom(); } template <> bool ThingIsPermanentAtomOrWellKnownSymbol<JSLinearString>(JSLinearString* str) { bool ThingIsPermanentAtomOrWellKnownSymbol(JSLinearString* str) { return str->isPermanentAtom(); } template <> bool ThingIsPermanentAtomOrWellKnownSymbol<JSAtom>(JSAtom* atom) { bool ThingIsPermanentAtomOrWellKnownSymbol(JSAtom* atom) { return atom->isPermanent(); } template <> bool ThingIsPermanentAtomOrWellKnownSymbol<PropertyName>(PropertyName* name) { bool ThingIsPermanentAtomOrWellKnownSymbol(PropertyName* name) { return name->isPermanent(); } template <> bool ThingIsPermanentAtomOrWellKnownSymbol<JS::Symbol>(JS::Symbol* sym) { bool ThingIsPermanentAtomOrWellKnownSymbol(JS::Symbol* sym) { return sym->isWellKnownSymbol(); } Loading js/src/gc/Marking.h +13 −0 Original line number Diff line number Diff line Loading @@ -502,4 +502,17 @@ CheckTracedThing(JSTracer* trc, T thing); } /* namespace js */ namespace JS { class Symbol; } // Exported for Tracer.cpp inline bool ThingIsPermanentAtomOrWellKnownSymbol(js::gc::Cell* thing) { return false; } bool ThingIsPermanentAtomOrWellKnownSymbol(JSString*); bool ThingIsPermanentAtomOrWellKnownSymbol(JSFlatString*); bool ThingIsPermanentAtomOrWellKnownSymbol(JSLinearString*); bool ThingIsPermanentAtomOrWellKnownSymbol(JSAtom*); bool ThingIsPermanentAtomOrWellKnownSymbol(js::PropertyName*); bool ThingIsPermanentAtomOrWellKnownSymbol(JS::Symbol*); #endif /* gc_Marking_h */ js/src/gc/Tracer.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -113,8 +113,13 @@ JS::TraceChildren(JSTracer* trc, GCCellPtr thing) struct TraceChildrenFunctor { template <typename T> void operator()(JSTracer* trc, void* thing) { static_cast<T*>(thing)->traceChildren(trc); void operator()(JSTracer* trc, void* thingArg) { T* thing = static_cast<T*>(thingArg); MOZ_ASSERT_IF(thing->runtimeFromAnyThread() != trc->runtime(), ThingIsPermanentAtomOrWellKnownSymbol(thing) || thing->zoneFromAnyThread()->isSelfHostingZone()); thing->traceChildren(trc); } }; Loading Loading
js/src/gc/Marking.cpp +6 −7 Original line number Diff line number Diff line Loading @@ -157,23 +157,22 @@ IsMovingTracer(JSTracer *trc) } #endif template <typename T> bool ThingIsPermanentAtomOrWellKnownSymbol(T* thing) { return false; } template <> bool ThingIsPermanentAtomOrWellKnownSymbol<JSString>(JSString* str) { bool ThingIsPermanentAtomOrWellKnownSymbol(JSString* str) { return str->isPermanentAtom(); } template <> bool ThingIsPermanentAtomOrWellKnownSymbol<JSFlatString>(JSFlatString* str) { bool ThingIsPermanentAtomOrWellKnownSymbol(JSFlatString* str) { return str->isPermanentAtom(); } template <> bool ThingIsPermanentAtomOrWellKnownSymbol<JSLinearString>(JSLinearString* str) { bool ThingIsPermanentAtomOrWellKnownSymbol(JSLinearString* str) { return str->isPermanentAtom(); } template <> bool ThingIsPermanentAtomOrWellKnownSymbol<JSAtom>(JSAtom* atom) { bool ThingIsPermanentAtomOrWellKnownSymbol(JSAtom* atom) { return atom->isPermanent(); } template <> bool ThingIsPermanentAtomOrWellKnownSymbol<PropertyName>(PropertyName* name) { bool ThingIsPermanentAtomOrWellKnownSymbol(PropertyName* name) { return name->isPermanent(); } template <> bool ThingIsPermanentAtomOrWellKnownSymbol<JS::Symbol>(JS::Symbol* sym) { bool ThingIsPermanentAtomOrWellKnownSymbol(JS::Symbol* sym) { return sym->isWellKnownSymbol(); } Loading
js/src/gc/Marking.h +13 −0 Original line number Diff line number Diff line Loading @@ -502,4 +502,17 @@ CheckTracedThing(JSTracer* trc, T thing); } /* namespace js */ namespace JS { class Symbol; } // Exported for Tracer.cpp inline bool ThingIsPermanentAtomOrWellKnownSymbol(js::gc::Cell* thing) { return false; } bool ThingIsPermanentAtomOrWellKnownSymbol(JSString*); bool ThingIsPermanentAtomOrWellKnownSymbol(JSFlatString*); bool ThingIsPermanentAtomOrWellKnownSymbol(JSLinearString*); bool ThingIsPermanentAtomOrWellKnownSymbol(JSAtom*); bool ThingIsPermanentAtomOrWellKnownSymbol(js::PropertyName*); bool ThingIsPermanentAtomOrWellKnownSymbol(JS::Symbol*); #endif /* gc_Marking_h */
js/src/gc/Tracer.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -113,8 +113,13 @@ JS::TraceChildren(JSTracer* trc, GCCellPtr thing) struct TraceChildrenFunctor { template <typename T> void operator()(JSTracer* trc, void* thing) { static_cast<T*>(thing)->traceChildren(trc); void operator()(JSTracer* trc, void* thingArg) { T* thing = static_cast<T*>(thingArg); MOZ_ASSERT_IF(thing->runtimeFromAnyThread() != trc->runtime(), ThingIsPermanentAtomOrWellKnownSymbol(thing) || thing->zoneFromAnyThread()->isSelfHostingZone()); thing->traceChildren(trc); } }; Loading