Bug 1099440 - Make JS_TraceIncomingCCWs use MarkObjectUnbarriered instead of calling the tracer itself. r=terrence

This commit is contained in:
Nick Fitzgerald 2014-11-14 16:08:00 +01:00
parent c7fdbe75a6
commit 7acd9e57c6

View File

@ -139,13 +139,14 @@ JS_TraceIncomingCCWs(JSTracer *trc, const JS::ZoneSet &zones)
// zones multiple times, and don't hold a strong reference.
if (key.kind == CrossCompartmentKey::StringWrapper)
continue;
JSObject *obj = static_cast<JSObject *>(key.wrapped);
// Ignore CCWs whose wrapped value doesn't live in our given set
// of zones.
if (!zones.has(static_cast<JSObject *>(key.wrapped)->zone()))
if (!zones.has(obj->zone()))
continue;
void *thing = key.wrapped;
trc->callback(trc, &thing, GetGCThingTraceKind(key.wrapped));
MarkObjectUnbarriered(trc, &obj, "cross-compartment wrapper");
MOZ_ASSERT(obj == key.wrapped);
}
}
}