зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1074961 - Part 2: change the name of chunkPool to be more descriptive; r=sfink
--HG-- extra : rebase_source : 2a6319591731c2d46f12ac749f8e1f69d50762c5
This commit is contained in:
Родитель
1bd413b659
Коммит
2a684f78ec
|
@ -590,7 +590,7 @@ class GCRuntime
|
|||
*/
|
||||
js::gc::Chunk *systemAvailableChunkListHead;
|
||||
js::gc::Chunk *userAvailableChunkListHead;
|
||||
js::gc::ChunkPool chunkPool;
|
||||
js::gc::ChunkPool emptyChunks;
|
||||
|
||||
js::RootedValueMap rootsHash;
|
||||
|
||||
|
|
|
@ -720,7 +720,7 @@ GCRuntime::expireChunkPool(bool shrinkBuffers, bool releaseAll)
|
|||
*/
|
||||
Chunk *freeList = nullptr;
|
||||
unsigned freeChunkCount = 0;
|
||||
for (ChunkPool::Enum e(chunkPool); !e.empty(); ) {
|
||||
for (ChunkPool::Enum e(emptyChunks); !e.empty(); ) {
|
||||
Chunk *chunk = e.front();
|
||||
MOZ_ASSERT(chunk->unused());
|
||||
MOZ_ASSERT(!chunkSet.has(chunk));
|
||||
|
@ -739,9 +739,9 @@ GCRuntime::expireChunkPool(bool shrinkBuffers, bool releaseAll)
|
|||
e.popFront();
|
||||
}
|
||||
}
|
||||
MOZ_ASSERT(chunkPool.count() <= tunables.maxEmptyChunkCount());
|
||||
MOZ_ASSERT_IF(shrinkBuffers, chunkPool.count() <= tunables.minEmptyChunkCount());
|
||||
MOZ_ASSERT_IF(releaseAll, chunkPool.count() == 0);
|
||||
MOZ_ASSERT(emptyChunks.count() <= tunables.maxEmptyChunkCount());
|
||||
MOZ_ASSERT_IF(shrinkBuffers, emptyChunks.count() <= tunables.minEmptyChunkCount());
|
||||
MOZ_ASSERT_IF(releaseAll, emptyChunks.count() == 0);
|
||||
return freeList;
|
||||
}
|
||||
|
||||
|
@ -1037,7 +1037,7 @@ GCRuntime::moveChunkToFreePool(Chunk *chunk)
|
|||
MOZ_ASSERT(chunk->unused());
|
||||
MOZ_ASSERT(chunkSet.has(chunk));
|
||||
chunkSet.remove(chunk);
|
||||
chunkPool.put(chunk);
|
||||
emptyChunks.put(chunk);
|
||||
}
|
||||
|
||||
inline bool
|
||||
|
@ -1049,7 +1049,7 @@ GCRuntime::wantBackgroundAllocation() const
|
|||
* of them.
|
||||
*/
|
||||
return helperState.canBackgroundAllocate() &&
|
||||
chunkPool.count() < tunables.minEmptyChunkCount() &&
|
||||
emptyChunks.count() < tunables.minEmptyChunkCount() &&
|
||||
chunkSet.count() >= 4;
|
||||
}
|
||||
|
||||
|
@ -1088,7 +1088,7 @@ GCRuntime::pickChunk(Zone *zone, AutoMaybeStartBackgroundAllocation &maybeStartB
|
|||
if (chunk)
|
||||
return chunk;
|
||||
|
||||
chunk = chunkPool.get(rt);
|
||||
chunk = emptyChunks.get(rt);
|
||||
if (!chunk) {
|
||||
chunk = Chunk::allocate(rt);
|
||||
if (!chunk)
|
||||
|
@ -1512,9 +1512,9 @@ GCRuntime::getParameter(JSGCParamKey key)
|
|||
case JSGC_MODE:
|
||||
return uint32_t(mode);
|
||||
case JSGC_UNUSED_CHUNKS:
|
||||
return uint32_t(chunkPool.count());
|
||||
return uint32_t(emptyChunks.count());
|
||||
case JSGC_TOTAL_CHUNKS:
|
||||
return uint32_t(chunkSet.count() + chunkPool.count());
|
||||
return uint32_t(chunkSet.count() + emptyChunks.count());
|
||||
case JSGC_SLICE_TIME_BUDGET:
|
||||
return uint32_t(sliceBudget > 0 ? sliceBudget / PRMJ_USEC_PER_MSEC : 0);
|
||||
case JSGC_MARK_STACK_LIMIT:
|
||||
|
@ -3302,7 +3302,7 @@ GCHelperState::work()
|
|||
if (!chunk)
|
||||
break;
|
||||
MOZ_ASSERT(chunk->info.numArenasFreeCommitted == 0);
|
||||
rt->gc.chunkPool.put(chunk);
|
||||
rt->gc.emptyChunks.put(chunk);
|
||||
} while (state() == ALLOCATING && rt->gc.wantBackgroundAllocation());
|
||||
|
||||
MOZ_ASSERT(state() == ALLOCATING || state() == CANCEL_ALLOCATION);
|
||||
|
|
Загрузка…
Ссылка в новой задаче