Add support for Nursery only compact#8248
Conversation
| @@ -48,6 +48,7 @@ class MM_ParallelCompactTask : public MM_ParallelTask | |||
| MM_CompactScheme *_compactScheme; | |||
| bool _rebuildMarkBits; | |||
| bool _aggressive; | |||
| bool nurseryOnly; | |||
There was a problem hiding this comment.
members should start with '_'
| if (CompactReason::COMPACT_ABORTED_SCAVENGE == compactStats->_compactReason) | ||
| { | ||
| nurseryOnly = true; | ||
| } |
There was a problem hiding this comment.
you can collapse it into one line:
bool nurseryOnly = (CompactReason::COMPACT_ABORTED_SCAVENGE == compactStats->_compactReason);
| { | ||
| nurseryOnly = true; | ||
| } | ||
| MM_ParallelCompactTask compactTask(env, _dispatcher, _compactScheme, rebuildMarkBits, env->_cycleState->_gcCode.shouldAggressivelyCompact(), nurseryOnly); |
There was a problem hiding this comment.
Honestly, don't know why rebuildMarkBits and aggressive (and now nurseryOnly) are passed to the CompactTask, rather than CompactScheme.
If they were part of CompactScheme then we would not need to pass them later through various methods via params, instead of just fetching them from CompactScheme when needed.
Perhaps we can fix/simplify that later. For now, let's keep the focus on minimal changes.
6c15ce7 to
a4b04f0
Compare
| if(nurseryOnly && MEMORY_TYPE_OLD == memorySubSpace->getTypeFlags()) | ||
| { | ||
| state = SubAreaEntry::fixup_only; | ||
| } |
There was a problem hiding this comment.
| } | |
| if (nurseryOnly && (MEMORY_TYPE_OLD == memorySubSpace->getTypeFlags())) { | |
| state = SubAreaEntry::fixup_only; | |
| } |
There was a problem hiding this comment.
fix the formatting for other similar spots accordingly
- add extra oval brackets
- curly bracket is up one line
There was a problem hiding this comment.
fully correct check is actually
MEMORY_TYPE_OLD == (getTypeFlags() & MEMORY_TYPE_OLD))
since other bit-wise flags could be set too (like MEMORY_TYPE_RAM)
| if (changeSubAreaAction(env, &subAreaTable[i], SubAreaEntry::fixing_heap_for_walk)) { | ||
| omrobjectptr_t start = subAreaTable[i].firstObject; | ||
| omrobjectptr_t end = subAreaTable[i].firstObject; | ||
| omrobjectptr_t end = subAreaTable[i+1].firstObject; |
There was a problem hiding this comment.
we typically provide extra space around binary operators
[i + 1]
a4b04f0 to
c8f8040
Compare
|
|
||
| while(NULL != (memoryPool = poolIterator.nextPool())) { | ||
| memoryPool->postProcess(env, MM_MemoryPool::forCompact); | ||
| if(!nurseryOnly || (MEMORY_TYPE_OLD != (memoryPool->getSubSpace()->getTypeFlags() & MEMORY_TYPE_OLD))) { |
There was a problem hiding this comment.
there should be space between keywords if, while, for,... and opening oval bracket
fix anywhere in the code you updated or even in vicinity of those that you have not updated
| MM_CompactScheme *_compactScheme; | ||
| bool _rebuildMarkBits; | ||
| bool _aggressive; | ||
| bool _nurseryOnly; |
There was a problem hiding this comment.
add comment
/**< if true, Nursery is only compacted and Tenure fixed-up via RS, otherwise whole heap is compacted/fixed-up */
| compactStats->_startTime = omrtime_hires_clock(); | ||
| MM_ParallelCompactTask compactTask(env, _dispatcher, _compactScheme, rebuildMarkBits, env->_cycleState->_gcCode.shouldAggressivelyCompact()); | ||
| bool nurseryOnly = false; | ||
| nurseryOnly = (CompactReason::COMPACT_ABORTED_SCAVENGE == compactStats->_compactReason); |
There was a problem hiding this comment.
could be one line:
bool nurseryOnly = (CompactReason::COMPACT_ABORTED_SCAVENGE == compactStats->_compactReason);
1820145 to
7cf582c
Compare
- add a flag to control if whole heap compacted or Nursery only - use the fixup_only subarea state to skip moving Tenure objects Issue: eclipse-openj9/openj9#20515 Signed-off-by: Shadman Siddiqui shadman2606@gmail.com
ecab2c7 to
2b54835
Compare
Add support for Nursery only compact
Issue: eclipse-openj9/openj9#20515
Signed-off-by: Shadman Siddiqui shadman2606@gmail.com