Bug 650161 - Fix a bug than meant we relocated fewer arenas than we should have r=terrence

This commit is contained in:
Jon Coppeard 2014-12-02 18:02:45 -08:00
Родитель 49545109bb
Коммит be4331ca4b
2 изменённых файлов: 6 добавлений и 16 удалений

Просмотреть файл

@ -2082,20 +2082,6 @@ size_t ArenaHeader::countUsedCells()
return Arena::thingsPerArena(getThingSize()) - countFreeCells();
}
/*
* Iterate throught the list and count the number of cells used.
*
* We may be able to precalculate this while sweeping and store the result
* somewhere.
*/
size_t ArenaList::countUsedCells()
{
size_t count = 0;
for (ArenaHeader *arena = head_; arena; arena = arena->next)
count += arena->countUsedCells();
return count;
}
ArenaHeader *
ArenaList::removeRemainingArenas(ArenaHeader **arenap, const AutoLockGC &lock)
{
@ -2153,7 +2139,12 @@ ArenaList::pickArenasToRelocate(JSRuntime *runtime)
ArenaHeader **arenap = cursorp_; // Next arena to consider
size_t previousFreeCells = 0; // Count of free cells before
size_t followingUsedCells = countUsedCells(); // Count of used cells after
// Count of used cells after arenap.
size_t followingUsedCells = 0;
for (ArenaHeader *arena = *arenap; arena; arena = arena->next)
followingUsedCells += arena->countUsedCells();
mozilla::DebugOnly<size_t> lastFreeCells(0);
size_t cellsPerArena = Arena::thingsPerArena((*arenap)->getThingSize());

Просмотреть файл

@ -503,7 +503,6 @@ class ArenaList {
}
#ifdef JSGC_COMPACTING
size_t countUsedCells();
ArenaHeader *removeRemainingArenas(ArenaHeader **arenap, const AutoLockGC &lock);
ArenaHeader *pickArenasToRelocate(JSRuntime *runtime);
ArenaHeader *relocateArenas(ArenaHeader *toRelocate, ArenaHeader *relocated);