mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 650161 - We don't need special fixup for CCWs after compacting GC r=terrence
This commit is contained in:
parent
181db3f30e
commit
c4ef452bd6
@ -512,9 +512,7 @@ JSCompartment::markCrossCompartmentWrappers(JSTracer *trc)
|
|||||||
* We have a cross-compartment wrapper. Its private pointer may
|
* We have a cross-compartment wrapper. Its private pointer may
|
||||||
* point into the compartment being collected, so we should mark it.
|
* point into the compartment being collected, so we should mark it.
|
||||||
*/
|
*/
|
||||||
Value referent = wrapper->private_();
|
MarkSlot(trc, wrapper->slotOfPrivate(), "cross-compartment wrapper");
|
||||||
MarkValueRoot(trc, &referent, "cross-compartment wrapper");
|
|
||||||
MOZ_ASSERT(referent == wrapper->private_());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -654,39 +652,6 @@ JSCompartment::sweepCrossCompartmentWrappers()
|
|||||||
|
|
||||||
#ifdef JSGC_COMPACTING
|
#ifdef JSGC_COMPACTING
|
||||||
|
|
||||||
/*
|
|
||||||
* Fixup wrappers with moved keys or values.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
JSCompartment::fixupCrossCompartmentWrappers(JSTracer *trc)
|
|
||||||
{
|
|
||||||
for (WrapperMap::Enum e(crossCompartmentWrappers); !e.empty(); e.popFront()) {
|
|
||||||
Value val = e.front().value();
|
|
||||||
if (IsForwarded(val)) {
|
|
||||||
val = Forwarded(val);
|
|
||||||
e.front().value().set(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
// CrossCompartmentKey's hash does not depend on the debugger object,
|
|
||||||
// so update it but do not rekey if it changes
|
|
||||||
CrossCompartmentKey key = e.front().key();
|
|
||||||
if (key.debugger)
|
|
||||||
key.debugger = MaybeForwarded(key.debugger);
|
|
||||||
if (key.wrapped && IsForwarded(key.wrapped)) {
|
|
||||||
key.wrapped = Forwarded(key.wrapped);
|
|
||||||
e.rekeyFront(key, key);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!zone()->isCollecting() && val.isObject()) {
|
|
||||||
// Call the trace hook to update any pointers to relocated things.
|
|
||||||
JSObject *obj = &val.toObject();
|
|
||||||
const Class *clasp = obj->getClass();
|
|
||||||
if (clasp->trace)
|
|
||||||
clasp->trace(trc, obj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void JSCompartment::fixupAfterMovingGC()
|
void JSCompartment::fixupAfterMovingGC()
|
||||||
{
|
{
|
||||||
fixupGlobal();
|
fixupGlobal();
|
||||||
|
@ -367,7 +367,6 @@ struct JSCompartment
|
|||||||
#ifdef JSGC_COMPACTING
|
#ifdef JSGC_COMPACTING
|
||||||
void fixupInitialShapeTable();
|
void fixupInitialShapeTable();
|
||||||
void fixupNewTypeObjectTable(js::types::TypeObjectWithNewScriptSet &table);
|
void fixupNewTypeObjectTable(js::types::TypeObjectWithNewScriptSet &table);
|
||||||
void fixupCrossCompartmentWrappers(JSTracer *trc);
|
|
||||||
void fixupAfterMovingGC();
|
void fixupAfterMovingGC();
|
||||||
void fixupGlobal();
|
void fixupGlobal();
|
||||||
#endif
|
#endif
|
||||||
|
@ -2344,32 +2344,27 @@ MovingTracer::Visit(JSTracer *jstrc, void **thingp, JSGCTraceKind kind)
|
|||||||
void
|
void
|
||||||
GCRuntime::sweepZoneAfterCompacting(Zone *zone)
|
GCRuntime::sweepZoneAfterCompacting(Zone *zone)
|
||||||
{
|
{
|
||||||
|
MOZ_ASSERT(zone->isCollecting());
|
||||||
FreeOp *fop = rt->defaultFreeOp();
|
FreeOp *fop = rt->defaultFreeOp();
|
||||||
if (zone->isCollecting()) {
|
zone->discardJitCode(fop);
|
||||||
zone->discardJitCode(fop);
|
zone->sweepAnalysis(fop, rt->gc.releaseObservedTypes && !zone->isPreservingCode());
|
||||||
zone->sweepAnalysis(fop, rt->gc.releaseObservedTypes && !zone->isPreservingCode());
|
zone->sweepBreakpoints(fop);
|
||||||
zone->sweepBreakpoints(fop);
|
|
||||||
|
|
||||||
for (CompartmentsInZoneIter c(zone); !c.done(); c.next()) {
|
for (CompartmentsInZoneIter c(zone); !c.done(); c.next()) {
|
||||||
c->sweepInnerViews();
|
c->sweepInnerViews();
|
||||||
c->sweepCrossCompartmentWrappers();
|
c->sweepCrossCompartmentWrappers();
|
||||||
c->sweepBaseShapeTable();
|
c->sweepBaseShapeTable();
|
||||||
c->sweepInitialShapeTable();
|
c->sweepInitialShapeTable();
|
||||||
c->sweepTypeObjectTables();
|
c->sweepTypeObjectTables();
|
||||||
c->sweepRegExps();
|
c->sweepRegExps();
|
||||||
c->sweepCallsiteClones();
|
c->sweepCallsiteClones();
|
||||||
c->sweepSavedStacks();
|
c->sweepSavedStacks();
|
||||||
c->sweepGlobalObject(fop);
|
c->sweepGlobalObject(fop);
|
||||||
c->sweepSelfHostingScriptSource();
|
c->sweepSelfHostingScriptSource();
|
||||||
c->sweepDebugScopes();
|
c->sweepDebugScopes();
|
||||||
c->sweepJitCompartment(fop);
|
c->sweepJitCompartment(fop);
|
||||||
c->sweepWeakMaps();
|
c->sweepWeakMaps();
|
||||||
c->sweepNativeIterators();
|
c->sweepNativeIterators();
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* Update cross compartment wrappers into moved zones. */
|
|
||||||
for (CompartmentsInZoneIter c(zone); !c.done(); c.next())
|
|
||||||
c->sweepCrossCompartmentWrappers();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2417,7 +2412,7 @@ GCRuntime::updatePointersToRelocatedCells()
|
|||||||
|
|
||||||
// Fixup cross compartment wrappers as we assert the existence of wrappers in the map.
|
// Fixup cross compartment wrappers as we assert the existence of wrappers in the map.
|
||||||
for (CompartmentsIter comp(rt, SkipAtoms); !comp.done(); comp.next())
|
for (CompartmentsIter comp(rt, SkipAtoms); !comp.done(); comp.next())
|
||||||
comp->fixupCrossCompartmentWrappers(&trc);
|
comp->sweepCrossCompartmentWrappers();
|
||||||
|
|
||||||
// Fixup generators as these are not normally traced.
|
// Fixup generators as these are not normally traced.
|
||||||
for (ContextIter i(rt); !i.done(); i.next()) {
|
for (ContextIter i(rt); !i.done(); i.next()) {
|
||||||
@ -2458,9 +2453,10 @@ GCRuntime::updatePointersToRelocatedCells()
|
|||||||
// Sweep everything to fix up weak pointers
|
// Sweep everything to fix up weak pointers
|
||||||
WatchpointMap::sweepAll(rt);
|
WatchpointMap::sweepAll(rt);
|
||||||
Debugger::sweepAll(rt->defaultFreeOp());
|
Debugger::sweepAll(rt->defaultFreeOp());
|
||||||
|
for (GCZonesIter zone(rt); !zone.done(); zone.next()) {
|
||||||
for (ZonesIter zone(rt, SkipAtoms); !zone.done(); zone.next())
|
if (!rt->isAtomsZone(zone))
|
||||||
rt->gc.sweepZoneAfterCompacting(zone);
|
rt->gc.sweepZoneAfterCompacting(zone);
|
||||||
|
}
|
||||||
|
|
||||||
// Type inference may put more blocks here to free.
|
// Type inference may put more blocks here to free.
|
||||||
rt->freeLifoAlloc.freeAll();
|
rt->freeLifoAlloc.freeAll();
|
||||||
|
Loading…
Reference in New Issue
Block a user