8031776: Remove the unnecessary enum GenRemSet::Name
Reviewed-by: stefank, tschatzl, jwilhelm
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Mon Jan 20 11:47:53 2014 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Mon Jan 20 17:15:55 2014 +0100
@@ -318,7 +318,7 @@
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);
}
--- a/hotspot/src/share/vm/memory/cardTableRS.hpp Mon Jan 20 11:47:53 2014 +0100
+++ b/hotspot/src/share/vm/memory/cardTableRS.hpp Mon Jan 20 17:15:55 2014 +0100
@@ -105,8 +105,6 @@
~CardTableRS();
// *** GenRemSet functions.
- GenRemSet::Name rs_kind() { return GenRemSet::CardTable; }
-
CardTableRS* as_CardTableRS() { return this; }
CardTableModRefBS* ct_bs() { return _ct_bs; }
--- a/hotspot/src/share/vm/memory/collectorPolicy.cpp Mon Jan 20 11:47:53 2014 +0100
+++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp Mon Jan 20 17:15:55 2014 +0100
@@ -178,10 +178,7 @@
// 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
--- a/hotspot/src/share/vm/memory/defNewGeneration.cpp Mon Jan 20 11:47:53 2014 +0100
+++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp Mon Jan 20 17:15:55 2014 +0100
@@ -61,7 +61,6 @@
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;
}
--- a/hotspot/src/share/vm/memory/genOopClosures.inline.hpp Mon Jan 20 11:47:53 2014 +0100
+++ b/hotspot/src/share/vm/memory/genOopClosures.inline.hpp Mon Jan 20 17:15:55 2014 +0100
@@ -45,7 +45,6 @@
// 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;
}
}
--- a/hotspot/src/share/vm/memory/genRemSet.cpp Mon Jan 20 11:47:53 2014 +0100
+++ b/hotspot/src/share/vm/memory/genRemSet.cpp Mon Jan 20 17:15:55 2014 +0100
@@ -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();
}
--- a/hotspot/src/share/vm/memory/genRemSet.hpp Mon Jan 20 11:47:53 2014 +0100
+++ b/hotspot/src/share/vm/memory/genRemSet.hpp Mon Jan 20 17:15:55 2014 +0100
@@ -53,16 +53,9 @@
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 @@
// 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;