mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1144920 - Move gray buffer clearing out of GCMarker; r=jonco
This commit is contained in:
parent
b2f8da5c1c
commit
d9aa475dc5
@ -1037,8 +1037,16 @@ class GCRuntime
|
||||
};
|
||||
GrayBufferState grayBufferState;
|
||||
bool hasBufferedGrayRoots() const { return grayBufferState == GrayBufferState::Okay; }
|
||||
|
||||
// Clear each zone's gray buffers, but do not change the current state.
|
||||
void resetBufferedGrayRoots() const;
|
||||
|
||||
// Reset the gray buffering state to Unused.
|
||||
void clearBufferedGrayRoots() {
|
||||
grayBufferState = GrayBufferState::Unused;
|
||||
resetBufferedGrayRoots();
|
||||
}
|
||||
|
||||
/*
|
||||
* The gray bits can become invalid if UnmarkGray overflows the stack. A
|
||||
* full GC will reset this bit, since it fills in all the gray bits.
|
||||
|
@ -554,9 +554,6 @@ GCMarker::stop()
|
||||
|
||||
/* Free non-ballast stack memory. */
|
||||
stack.reset();
|
||||
|
||||
runtime()->gc.resetBufferedGrayRoots();
|
||||
runtime()->gc.grayBufferState = GCRuntime::GrayBufferState::Unused;
|
||||
}
|
||||
|
||||
void
|
||||
@ -650,6 +647,8 @@ GCMarker::checkZone(void *p)
|
||||
void
|
||||
GCRuntime::resetBufferedGrayRoots() const
|
||||
{
|
||||
MOZ_ASSERT(grayBufferState != GrayBufferState::Okay,
|
||||
"Do not clear the gray buffers unless we are Failed or becoming Unused");
|
||||
for (GCZonesIter zone(rt); !zone.done(); zone.next())
|
||||
zone->gcGrayRoots.clearAndFree();
|
||||
}
|
||||
|
@ -5373,6 +5373,7 @@ GCRuntime::finishCollection(JS::gcreason::Reason reason)
|
||||
{
|
||||
MOZ_ASSERT(marker.isDrained());
|
||||
marker.stop();
|
||||
clearBufferedGrayRoots();
|
||||
|
||||
uint64_t currentTime = PRMJ_Now();
|
||||
schedulingState.updateHighFrequencyMode(lastGCTime, currentTime, tunables);
|
||||
@ -5496,6 +5497,7 @@ GCRuntime::resetIncrementalGC(const char *reason)
|
||||
|
||||
marker.reset();
|
||||
marker.stop();
|
||||
clearBufferedGrayRoots();
|
||||
|
||||
for (GCCompartmentsIter c(rt); !c.done(); c.next())
|
||||
ResetGrayList(c);
|
||||
|
Loading…
Reference in New Issue
Block a user