mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 961091 - Don't compact full store buffers so often after GC has been triggered r=terrence
This commit is contained in:
parent
912f4637ff
commit
ebca104c52
@ -82,6 +82,28 @@ StoreBuffer::WholeCellEdges::mark(JSTracer *trc)
|
|||||||
|
|
||||||
/*** MonoTypeBuffer ***/
|
/*** MonoTypeBuffer ***/
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
void
|
||||||
|
StoreBuffer::MonoTypeBuffer<T>::handleOverflow(StoreBuffer *owner)
|
||||||
|
{
|
||||||
|
if (!owner->isAboutToOverflow()) {
|
||||||
|
/*
|
||||||
|
* Compact the buffer now, and if that fails to free enough space then
|
||||||
|
* trigger a minor collection.
|
||||||
|
*/
|
||||||
|
compact(owner);
|
||||||
|
if (isAboutToOverflow())
|
||||||
|
owner->setAboutToOverflow();
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
* A minor GC has already been triggered, so there's no point
|
||||||
|
* compacting unless the buffer is totally full.
|
||||||
|
*/
|
||||||
|
if (storage_->availableInCurrentChunk() < sizeof(T))
|
||||||
|
compact(owner);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void
|
void
|
||||||
StoreBuffer::MonoTypeBuffer<T>::compactRemoveDuplicates(StoreBuffer *owner)
|
StoreBuffer::MonoTypeBuffer<T>::compactRemoveDuplicates(StoreBuffer *owner)
|
||||||
|
@ -115,6 +115,8 @@ class StoreBuffer
|
|||||||
return !storage_->isEmpty() && storage_->availableInCurrentChunk() < MinAvailableSize;
|
return !storage_->isEmpty() && storage_->availableInCurrentChunk() < MinAvailableSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void handleOverflow(StoreBuffer *owner);
|
||||||
|
|
||||||
/* Compaction algorithms. */
|
/* Compaction algorithms. */
|
||||||
void compactRemoveDuplicates(StoreBuffer *owner);
|
void compactRemoveDuplicates(StoreBuffer *owner);
|
||||||
|
|
||||||
@ -135,11 +137,8 @@ class StoreBuffer
|
|||||||
if (!tp)
|
if (!tp)
|
||||||
CrashAtUnhandlableOOM("Failed to allocate for MonoTypeBuffer::put.");
|
CrashAtUnhandlableOOM("Failed to allocate for MonoTypeBuffer::put.");
|
||||||
|
|
||||||
if (isAboutToOverflow()) {
|
if (isAboutToOverflow())
|
||||||
compact(owner);
|
handleOverflow(owner);
|
||||||
if (isAboutToOverflow())
|
|
||||||
owner->setAboutToOverflow();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mark the source of all edges in the store buffer. */
|
/* Mark the source of all edges in the store buffer. */
|
||||||
|
Loading…
Reference in New Issue
Block a user