From 53f0ad2cb329e69ef30e1bbea6a1585aaaec77e9 Mon Sep 17 00:00:00 2001 From: Lin Hu Date: Thu, 30 May 2019 12:10:09 -0400 Subject: [PATCH] Merge FreeEntryAllocateStats after compaction - FreeEntryAllocateStats has been updated after sweep, but compaction would change freeEntries stats, update FreeEntryAllocateStats after compaction. Signed-off-by: Lin Hu --- gc/base/standard/ParallelGlobalGC.cpp | 10 ++++++++++ gc/base/standard/ParallelGlobalGC.hpp | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/gc/base/standard/ParallelGlobalGC.cpp b/gc/base/standard/ParallelGlobalGC.cpp index 282b4ece2b..76c58e645a 100644 --- a/gc/base/standard/ParallelGlobalGC.cpp +++ b/gc/base/standard/ParallelGlobalGC.cpp @@ -478,6 +478,9 @@ MM_ParallelGlobalGC::masterThreadGarbageCollect(MM_EnvironmentBase *env, MM_Allo masterThreadCompact(env, allocDescription, rebuildMarkBits); _collectionStatistics._tenureFragmentation = NO_FRAGMENTATION; + if (_extensions->processLargeAllocateStats) { + processLargeAllocateStatsAfterCompact(env); + } } else { /* If a compaction was prevented, report the reason */ CompactPreventedReason compactPreventedReason = (CompactPreventedReason)(_extensions->globalGCStats.compactStats._compactPreventedReason); @@ -1115,6 +1118,13 @@ MM_ParallelGlobalGC::processLargeAllocateStatsBeforeGC(MM_EnvironmentBase *env) } } +void +MM_ParallelGlobalGC::processLargeAllocateStatsAfterCompact(MM_EnvironmentBase *env) +{ + processLargeAllocateStatsAfterSweep(env); +} + + void MM_ParallelGlobalGC::processLargeAllocateStatsAfterSweep(MM_EnvironmentBase *env) { diff --git a/gc/base/standard/ParallelGlobalGC.hpp b/gc/base/standard/ParallelGlobalGC.hpp index a3b8c8284c..0f9e815eb8 100644 --- a/gc/base/standard/ParallelGlobalGC.hpp +++ b/gc/base/standard/ParallelGlobalGC.hpp @@ -240,6 +240,12 @@ class MM_ParallelGlobalGC : public MM_GlobalCollector */ virtual void processLargeAllocateStatsAfterSweep(MM_EnvironmentBase *env); + /** + * compaction would change freeEntries stats, merge FreeEntryAllocateStats after compaction. + * currently processLargeAllocateStatsAfterCompact() is same as processLargeAllocateStatsAfterSweep() + */ + void processLargeAllocateStatsAfterCompact(MM_EnvironmentBase *env); + virtual void postMark(MM_EnvironmentBase *env); MM_ParallelSweepScheme*