mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 790338 - Mark weak references in the current compartment group only rather than for all collecting compartments r=billm
--HG-- extra : rebase_source : 46d236a1f70a2f8fa80ef7d0b1eb8f73ccdd7c34
This commit is contained in:
parent
33e1b47edf
commit
c71c449d4a
@ -3467,16 +3467,6 @@ BeginMarkPhase(JSRuntime *rt)
|
||||
rt->gcFoundBlackGrayEdges = false;
|
||||
}
|
||||
|
||||
bool
|
||||
MarkWeakMapsIteratively(JSRuntime *rt)
|
||||
{
|
||||
bool markedAny = false;
|
||||
GCMarker *gcmarker = &rt->gcMarker;
|
||||
for (GCCompartmentGroupIter c(rt); !c.done(); c.next())
|
||||
markedAny |= WeakMapBase::markCompartmentIteratively(c, gcmarker);
|
||||
return markedAny;
|
||||
}
|
||||
|
||||
void
|
||||
MarkWeakReferences(JSRuntime *rt, gcstats::Phase phase)
|
||||
{
|
||||
@ -3485,10 +3475,17 @@ MarkWeakReferences(JSRuntime *rt, gcstats::Phase phase)
|
||||
|
||||
gcstats::AutoPhase ap(rt->gcStats, phase);
|
||||
|
||||
while (WatchpointMap::markAllIteratively(gcmarker) ||
|
||||
MarkWeakMapsIteratively(rt) ||
|
||||
Debugger::markAllIteratively(gcmarker))
|
||||
{
|
||||
for (;;) {
|
||||
bool markedAny = false;
|
||||
for (GCCompartmentGroupIter c(rt); !c.done(); c.next()) {
|
||||
markedAny |= WatchpointMap::markCompartmentIteratively(c, gcmarker);
|
||||
markedAny |= WeakMapBase::markCompartmentIteratively(c, gcmarker);
|
||||
}
|
||||
markedAny |= Debugger::markAllIteratively(gcmarker);
|
||||
|
||||
if (!markedAny)
|
||||
break;
|
||||
|
||||
SliceBudget budget;
|
||||
gcmarker->drainMarkStack(budget);
|
||||
}
|
||||
|
@ -143,15 +143,11 @@ WatchpointMap::triggerWatchpoint(JSContext *cx, HandleObject obj, HandleId id, M
|
||||
}
|
||||
|
||||
bool
|
||||
WatchpointMap::markAllIteratively(JSTracer *trc)
|
||||
WatchpointMap::markCompartmentIteratively(JSCompartment *c, JSTracer *trc)
|
||||
{
|
||||
JSRuntime *rt = trc->runtime;
|
||||
bool mutated = false;
|
||||
for (GCCompartmentsIter c(rt); !c.done(); c.next()) {
|
||||
if (c->isGCMarking() && c->watchpointMap)
|
||||
mutated |= c->watchpointMap->markIteratively(trc);
|
||||
}
|
||||
return mutated;
|
||||
if (!c->watchpointMap)
|
||||
return false;
|
||||
return c->watchpointMap->markIteratively(trc);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -55,7 +55,7 @@ class WatchpointMap {
|
||||
|
||||
bool triggerWatchpoint(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp);
|
||||
|
||||
static bool markAllIteratively(JSTracer *trc);
|
||||
static bool markCompartmentIteratively(JSCompartment *c, JSTracer *trc);
|
||||
bool markIteratively(JSTracer *trc);
|
||||
void markAll(JSTracer *trc);
|
||||
static void sweepAll(JSRuntime *rt);
|
||||
|
Loading…
Reference in New Issue
Block a user