зеркало из https://github.com/mozilla/gecko-dev.git
Bug 961091 - Don't compact full store buffers so often after GC has been triggered r=terrence
This commit is contained in:
Родитель
fe4db66203
Коммит
1438060ab1
|
@ -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. */
|
||||||
|
|
Загрузка…
Ссылка в новой задаче