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 ***/
|
||||
|
||||
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>
|
||||
void
|
||||
StoreBuffer::MonoTypeBuffer<T>::compactRemoveDuplicates(StoreBuffer *owner)
|
||||
|
@ -115,6 +115,8 @@ class StoreBuffer
|
||||
return !storage_->isEmpty() && storage_->availableInCurrentChunk() < MinAvailableSize;
|
||||
}
|
||||
|
||||
void handleOverflow(StoreBuffer *owner);
|
||||
|
||||
/* Compaction algorithms. */
|
||||
void compactRemoveDuplicates(StoreBuffer *owner);
|
||||
|
||||
@ -135,11 +137,8 @@ class StoreBuffer
|
||||
if (!tp)
|
||||
CrashAtUnhandlableOOM("Failed to allocate for MonoTypeBuffer::put.");
|
||||
|
||||
if (isAboutToOverflow()) {
|
||||
compact(owner);
|
||||
if (isAboutToOverflow())
|
||||
owner->setAboutToOverflow();
|
||||
}
|
||||
handleOverflow(owner);
|
||||
}
|
||||
|
||||
/* Mark the source of all edges in the store buffer. */
|
||||
|
Loading…
Reference in New Issue
Block a user