Bug 1149294 - Part 1: Don't trace permanent atoms and well known symbols that are owned by a parent JSRuntime inside SimpeEdgeVectorTracer; r=terrence

This commit is contained in:
Nick Fitzgerald 2015-06-17 11:12:23 -07:00
parent 9ff1f56993
commit d71c3a3e42

View File

@ -115,6 +115,13 @@ class SimpleEdgeVectorTracer : public JS::CallbackTracer {
if (!okay)
return;
// Don't trace permanent atoms and well-known symbols that are owned by
// a parent JSRuntime.
if (kind == JS::TraceKind::String && static_cast<JSString*>(*thingp)->isPermanentAtom())
return;
if (kind == JS::TraceKind::Symbol && static_cast<JS::Symbol*>(*thingp)->isWellKnownSymbol())
return;
char16_t* name16 = nullptr;
if (wantNames) {
// Ask the tracer to compute an edge name for us.
@ -186,7 +193,7 @@ template<typename Referent>
JS::Zone*
TracerConcrete<Referent>::zone() const
{
return get().zone();
return get().zoneFromAnyThread();
}
template<typename Referent>