Skip to content

Commit

Permalink
Bug 1134754 - Skip compacting zones when there is little benefit
Browse files Browse the repository at this point in the history
  • Loading branch information
rmottola committed Mar 12, 2019
1 parent 23133d7 commit fbc9bec
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 97 deletions.
4 changes: 2 additions & 2 deletions js/src/gc/GCRuntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -916,10 +916,10 @@ class GCRuntime
void sweepBackgroundThings(ZoneList &zones, LifoAlloc &freeBlocks, ThreadType threadType);
void assertBackgroundSweepingFinished();
bool shouldCompact();
IncrementalProgress compactPhase(bool lastGC);
IncrementalProgress compactPhase(bool lastGC, JS::gcreason::Reason reason);
void sweepTypesAfterCompacting(Zone *zone);
void sweepZoneAfterCompacting(Zone *zone);
ArenaHeader *relocateArenas();
ArenaHeader *relocateArenas(JS::gcreason::Reason reason);
void updateAllCellPointersParallel(MovingTracer *trc);
void updateAllCellPointersSerial(MovingTracer *trc);
void updatePointersToRelocatedCells();
Expand Down
8 changes: 4 additions & 4 deletions js/src/jscompartment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,14 +487,14 @@ JSCompartment::wrap(JSContext* cx, MutableHandle<PropDesc> desc)
}

/*
* This method marks pointers that cross compartment boundaries. It should be
* called only for per-compartment GCs, since full GCs naturally follow pointers
* across compartments.
* This method marks pointers that cross compartment boundaries. It is called in
* per-zone GCs (since full GCs naturally follow pointers across compartments)
* and when compacting to update cross-compartment pointers.
*/
void
JSCompartment::markCrossCompartmentWrappers(JSTracer *trc)
{
MOZ_ASSERT(!zone()->isCollecting());
MOZ_ASSERT(!zone()->isCollecting() || trc->runtime()->isHeapCompacting());

for (WrapperMap::Enum e(crossCompartmentWrappers); !e.empty(); e.popFront()) {
Value v = e.front().value();
Expand Down
Loading

0 comments on commit fbc9bec

Please sign in to comment.