mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8031776
: Remove the unnecessary enum GenRemSet::Name
Reviewed-by: stefank, tschatzl, jwilhelm
This commit is contained in:
parent
70fd1802a0
commit
ba54cfdf88
7 changed files with 6 additions and 22 deletions
|
@ -318,7 +318,7 @@ G1CollectorPolicy::G1CollectorPolicy() :
|
||||||
|
|
||||||
void G1CollectorPolicy::initialize_alignments() {
|
void G1CollectorPolicy::initialize_alignments() {
|
||||||
_space_alignment = HeapRegion::GrainBytes;
|
_space_alignment = HeapRegion::GrainBytes;
|
||||||
size_t card_table_alignment = GenRemSet::max_alignment_constraint(GenRemSet::CardTable);
|
size_t card_table_alignment = GenRemSet::max_alignment_constraint();
|
||||||
size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();
|
size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();
|
||||||
_heap_alignment = MAX3(card_table_alignment, _space_alignment, page_size);
|
_heap_alignment = MAX3(card_table_alignment, _space_alignment, page_size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,8 +105,6 @@ public:
|
||||||
~CardTableRS();
|
~CardTableRS();
|
||||||
|
|
||||||
// *** GenRemSet functions.
|
// *** GenRemSet functions.
|
||||||
GenRemSet::Name rs_kind() { return GenRemSet::CardTable; }
|
|
||||||
|
|
||||||
CardTableRS* as_CardTableRS() { return this; }
|
CardTableRS* as_CardTableRS() { return this; }
|
||||||
|
|
||||||
CardTableModRefBS* ct_bs() { return _ct_bs; }
|
CardTableModRefBS* ct_bs() { return _ct_bs; }
|
||||||
|
|
|
@ -178,10 +178,7 @@ size_t CollectorPolicy::compute_heap_alignment() {
|
||||||
// byte entry and the os page size is 4096, the maximum heap size should
|
// byte entry and the os page size is 4096, the maximum heap size should
|
||||||
// be 512*4096 = 2MB aligned.
|
// be 512*4096 = 2MB aligned.
|
||||||
|
|
||||||
// There is only the GenRemSet in Hotspot and only the GenRemSet::CardTable
|
size_t alignment = GenRemSet::max_alignment_constraint();
|
||||||
// is supported.
|
|
||||||
// Requirements of any new remembered set implementations must be added here.
|
|
||||||
size_t alignment = GenRemSet::max_alignment_constraint(GenRemSet::CardTable);
|
|
||||||
|
|
||||||
// Parallel GC does its own alignment of the generations to avoid requiring a
|
// Parallel GC does its own alignment of the generations to avoid requiring a
|
||||||
// large page (256M on some platforms) for the permanent generation. The
|
// large page (256M on some platforms) for the permanent generation. The
|
||||||
|
|
|
@ -61,7 +61,6 @@ bool DefNewGeneration::IsAliveClosure::do_object_b(oop p) {
|
||||||
DefNewGeneration::KeepAliveClosure::
|
DefNewGeneration::KeepAliveClosure::
|
||||||
KeepAliveClosure(ScanWeakRefClosure* cl) : _cl(cl) {
|
KeepAliveClosure(ScanWeakRefClosure* cl) : _cl(cl) {
|
||||||
GenRemSet* rs = GenCollectedHeap::heap()->rem_set();
|
GenRemSet* rs = GenCollectedHeap::heap()->rem_set();
|
||||||
assert(rs->rs_kind() == GenRemSet::CardTable, "Wrong rem set kind.");
|
|
||||||
_rs = (CardTableRS*)rs;
|
_rs = (CardTableRS*)rs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,6 @@ inline void OopsInGenClosure::set_generation(Generation* gen) {
|
||||||
// Barrier set for the heap, must be set after heap is initialized
|
// Barrier set for the heap, must be set after heap is initialized
|
||||||
if (_rs == NULL) {
|
if (_rs == NULL) {
|
||||||
GenRemSet* rs = SharedHeap::heap()->rem_set();
|
GenRemSet* rs = SharedHeap::heap()->rem_set();
|
||||||
assert(rs->rs_kind() == GenRemSet::CardTable, "Wrong rem set kind");
|
|
||||||
_rs = (CardTableRS*)rs;
|
_rs = (CardTableRS*)rs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,8 +31,7 @@
|
||||||
// enumerate ref fields that have been modified (since the last
|
// enumerate ref fields that have been modified (since the last
|
||||||
// enumeration.)
|
// enumeration.)
|
||||||
|
|
||||||
uintx GenRemSet::max_alignment_constraint(Name nm) {
|
uintx GenRemSet::max_alignment_constraint() {
|
||||||
assert(nm == GenRemSet::CardTable, "Unrecognized GenRemSet type.");
|
|
||||||
return CardTableRS::ct_max_alignment_constraint();
|
return CardTableRS::ct_max_alignment_constraint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,16 +53,9 @@ class GenRemSet: public CHeapObj<mtGC> {
|
||||||
KlassRemSet _klass_rem_set;
|
KlassRemSet _klass_rem_set;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum Name {
|
|
||||||
CardTable,
|
|
||||||
Other
|
|
||||||
};
|
|
||||||
|
|
||||||
GenRemSet(BarrierSet * bs) : _bs(bs) {}
|
GenRemSet(BarrierSet * bs) : _bs(bs) {}
|
||||||
GenRemSet() : _bs(NULL) {}
|
GenRemSet() : _bs(NULL) {}
|
||||||
|
|
||||||
virtual Name rs_kind() = 0;
|
|
||||||
|
|
||||||
// These are for dynamic downcasts. Unfortunately that it names the
|
// These are for dynamic downcasts. Unfortunately that it names the
|
||||||
// possible subtypes (but not that they are subtypes!) Return NULL if
|
// possible subtypes (but not that they are subtypes!) Return NULL if
|
||||||
// the cast is invalide.
|
// the cast is invalide.
|
||||||
|
@ -106,10 +99,9 @@ public:
|
||||||
// within the heap, this function tells whether they are met.
|
// within the heap, this function tells whether they are met.
|
||||||
virtual bool is_aligned(HeapWord* addr) = 0;
|
virtual bool is_aligned(HeapWord* addr) = 0;
|
||||||
|
|
||||||
// If the RS (or BS) imposes an aligment constraint on maximum heap size.
|
// Returns any alignment constraint that the remembered set imposes upon the
|
||||||
// (This must be static, and dispatch on "nm", because it is called
|
// heap.
|
||||||
// before an RS is created.)
|
static uintx max_alignment_constraint();
|
||||||
static uintx max_alignment_constraint(Name nm);
|
|
||||||
|
|
||||||
virtual void verify() = 0;
|
virtual void verify() = 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue