LiveObjectList* HeapVerifier::liveObjectListForGathering(HeapVerifier::Phase phase) { switch (phase) { case Phase::BeforeMarking: return ¤tCycle().before; case Phase::AfterMarking: return ¤tCycle().after; case Phase::BeforeGC: case Phase::AfterGC: // We should not be gathering live objects during these phases. break; } RELEASE_ASSERT_NOT_REACHED(); return nullptr; // Silencing a compiler warning. }
void HeapVerifier::trimDeadObjects() { HashSet<JSObject*> knownLiveSet; LiveObjectList& after = currentCycle().after; for (size_t i = 0; i < after.liveObjects.size(); i++) { LiveObjectData& objData = after.liveObjects[i]; knownLiveSet.add(objData.obj); } trimDeadObjectsFromList(knownLiveSet, currentCycle().before); for (int i = -1; i > -m_numberOfCycles; i--) { trimDeadObjectsFromList(knownLiveSet, cycleForIndex(i).before); trimDeadObjectsFromList(knownLiveSet, cycleForIndex(i).after); } }
int PaletteCycleEditor ::numCurrentCycleStates() { return (currentCycle().numStates()); }
PaletteCycleState& PaletteCycleEditor ::currentCycleState() { return currentCycle().state(stateNum_); }
void HeapVerifier::verify(HeapVerifier::Phase phase) { bool beforeVerified = verifyButterflyIsInStorageSpace(phase, currentCycle().before); bool afterVerified = verifyButterflyIsInStorageSpace(phase, currentCycle().after); RELEASE_ASSERT(beforeVerified && afterVerified); }
void HeapVerifier::initializeGCCycle() { Heap* heap = m_heap; incrementCycle(); currentCycle().collectionType = heap->operationInProgress(); }