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() {
|
||||
_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();
|
||||
_heap_alignment = MAX3(card_table_alignment, _space_alignment, page_size);
|
||||
}
|
||||
|
|
|
@ -105,8 +105,6 @@ public:
|
|||
~CardTableRS();
|
||||
|
||||
// *** GenRemSet functions.
|
||||
GenRemSet::Name rs_kind() { return GenRemSet::CardTable; }
|
||||
|
||||
CardTableRS* as_CardTableRS() { return this; }
|
||||
|
||||
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
|
||||
// be 512*4096 = 2MB aligned.
|
||||
|
||||
// There is only the GenRemSet in Hotspot and only the GenRemSet::CardTable
|
||||
// is supported.
|
||||
// Requirements of any new remembered set implementations must be added here.
|
||||
size_t alignment = GenRemSet::max_alignment_constraint(GenRemSet::CardTable);
|
||||
size_t alignment = GenRemSet::max_alignment_constraint();
|
||||
|
||||
// Parallel GC does its own alignment of the generations to avoid requiring a
|
||||
// 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::
|
||||
KeepAliveClosure(ScanWeakRefClosure* cl) : _cl(cl) {
|
||||
GenRemSet* rs = GenCollectedHeap::heap()->rem_set();
|
||||
assert(rs->rs_kind() == GenRemSet::CardTable, "Wrong rem set kind.");
|
||||
_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
|
||||
if (_rs == NULL) {
|
||||
GenRemSet* rs = SharedHeap::heap()->rem_set();
|
||||
assert(rs->rs_kind() == GenRemSet::CardTable, "Wrong rem set kind");
|
||||
_rs = (CardTableRS*)rs;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,8 +31,7 @@
|
|||
// enumerate ref fields that have been modified (since the last
|
||||
// enumeration.)
|
||||
|
||||
uintx GenRemSet::max_alignment_constraint(Name nm) {
|
||||
assert(nm == GenRemSet::CardTable, "Unrecognized GenRemSet type.");
|
||||
uintx GenRemSet::max_alignment_constraint() {
|
||||
return CardTableRS::ct_max_alignment_constraint();
|
||||
}
|
||||
|
||||
|
|
|
@ -53,16 +53,9 @@ class GenRemSet: public CHeapObj<mtGC> {
|
|||
KlassRemSet _klass_rem_set;
|
||||
|
||||
public:
|
||||
enum Name {
|
||||
CardTable,
|
||||
Other
|
||||
};
|
||||
|
||||
GenRemSet(BarrierSet * bs) : _bs(bs) {}
|
||||
GenRemSet() : _bs(NULL) {}
|
||||
|
||||
virtual Name rs_kind() = 0;
|
||||
|
||||
// These are for dynamic downcasts. Unfortunately that it names the
|
||||
// possible subtypes (but not that they are subtypes!) Return NULL if
|
||||
// the cast is invalide.
|
||||
|
@ -106,10 +99,9 @@ public:
|
|||
// within the heap, this function tells whether they are met.
|
||||
virtual bool is_aligned(HeapWord* addr) = 0;
|
||||
|
||||
// If the RS (or BS) imposes an aligment constraint on maximum heap size.
|
||||
// (This must be static, and dispatch on "nm", because it is called
|
||||
// before an RS is created.)
|
||||
static uintx max_alignment_constraint(Name nm);
|
||||
// Returns any alignment constraint that the remembered set imposes upon the
|
||||
// heap.
|
||||
static uintx max_alignment_constraint();
|
||||
|
||||
virtual void verify() = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue