8065218: Move CMS-specific fields from Space to CompactibleFreeListSpace

Reviewed-by: brutisso, tschatzl, sangheki
This commit is contained in:
Mikael Gerdin 2014-11-26 10:51:52 +01:00
parent f65caabf9c
commit d65f3c41b7
3 changed files with 16 additions and 9 deletions

View File

@ -90,7 +90,8 @@ CompactibleFreeListSpace::CompactibleFreeListSpace(BlockOffsetSharedArray* bs,
CMSRescanMultiple),
_marking_task_size(CardTableModRefBS::card_size_in_words * BitsPerWord *
CMSConcMarkMultiple),
_collector(NULL)
_collector(NULL),
_preconsumptionDirtyCardClosure(NULL)
{
assert(sizeof(FreeChunk) / BytesPerWord <= MinChunkSize,
"FreeChunk is larger than expected");

View File

@ -155,6 +155,9 @@ class CompactibleFreeListSpace: public CompactibleSpace {
// Used to keep track of limit of sweep for the space
HeapWord* _sweep_limit;
// Used to make the young collector update the mod union table
MemRegionClosure* _preconsumptionDirtyCardClosure;
// Support for compacting cms
HeapWord* cross_threshold(HeapWord* start, HeapWord* end);
HeapWord* forward(oop q, size_t size, CompactPoint* cp, HeapWord* compact_top);
@ -356,6 +359,14 @@ class CompactibleFreeListSpace: public CompactibleSpace {
void initialize_sequential_subtasks_for_marking(int n_threads,
HeapWord* low = NULL);
virtual MemRegionClosure* preconsumptionDirtyCardClosure() const {
return _preconsumptionDirtyCardClosure;
}
void setPreconsumptionDirtyCardClosure(MemRegionClosure* cl) {
_preconsumptionDirtyCardClosure = cl;
}
// Space enquiries
size_t used() const;
size_t free() const;

View File

@ -70,15 +70,13 @@ class Space: public CHeapObj<mtGC> {
// Used in support of save_marks()
HeapWord* _saved_mark_word;
MemRegionClosure* _preconsumptionDirtyCardClosure;
// A sequential tasks done structure. This supports
// parallel GC, where we have threads dynamically
// claiming sub-tasks from a larger parallel task.
SequentialSubTasksDone _par_seq_tasks;
Space():
_bottom(NULL), _end(NULL), _preconsumptionDirtyCardClosure(NULL) { }
_bottom(NULL), _end(NULL) { }
public:
// Accessors
@ -97,11 +95,8 @@ class Space: public CHeapObj<mtGC> {
return (HeapWord*)obj >= saved_mark_word();
}
MemRegionClosure* preconsumptionDirtyCardClosure() const {
return _preconsumptionDirtyCardClosure;
}
void setPreconsumptionDirtyCardClosure(MemRegionClosure* cl) {
_preconsumptionDirtyCardClosure = cl;
virtual MemRegionClosure* preconsumptionDirtyCardClosure() const {
return NULL;
}
// Returns a subregion of the space containing only the allocated objects in