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
Родитель c7fdbe75a6
Коммит 7acd9e57c6
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

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