Thu, 03 Oct 2013 13:19:19 +0200
8025855: Simplify GenRemSet code slightly
Summary: Remove a few redundant switch-statements
Reviewed-by: jcoomes, tschatzl
src/share/vm/memory/collectorPolicy.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/memory/genRemSet.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/memory/collectorPolicy.cpp Wed Oct 02 18:24:58 2013 +0200 1.2 +++ b/src/share/vm/memory/collectorPolicy.cpp Thu Oct 03 13:19:19 2013 +0200 1.3 @@ -137,15 +137,8 @@ 1.4 1.5 GenRemSet* CollectorPolicy::create_rem_set(MemRegion whole_heap, 1.6 int max_covered_regions) { 1.7 - switch (rem_set_name()) { 1.8 - case GenRemSet::CardTable: { 1.9 - CardTableRS* res = new CardTableRS(whole_heap, max_covered_regions); 1.10 - return res; 1.11 - } 1.12 - default: 1.13 - guarantee(false, "unrecognized GenRemSet::Name"); 1.14 - return NULL; 1.15 - } 1.16 + assert(rem_set_name() == GenRemSet::CardTable, "unrecognized GenRemSet::Name"); 1.17 + return new CardTableRS(whole_heap, max_covered_regions); 1.18 } 1.19 1.20 void CollectorPolicy::cleared_all_soft_refs() {
2.1 --- a/src/share/vm/memory/genRemSet.cpp Wed Oct 02 18:24:58 2013 +0200 2.2 +++ b/src/share/vm/memory/genRemSet.cpp Thu Oct 03 13:19:19 2013 +0200 2.3 @@ -32,13 +32,8 @@ 2.4 // enumeration.) 2.5 2.6 uintx GenRemSet::max_alignment_constraint(Name nm) { 2.7 - switch (nm) { 2.8 - case GenRemSet::CardTable: 2.9 - return CardTableRS::ct_max_alignment_constraint(); 2.10 - default: 2.11 - guarantee(false, "Unrecognized GenRemSet type."); 2.12 - return (0); // Make Windows compiler happy 2.13 - } 2.14 + assert(nm == GenRemSet::CardTable, "Unrecognized GenRemSet type."); 2.15 + return CardTableRS::ct_max_alignment_constraint(); 2.16 } 2.17 2.18 class HasAccumulatedModifiedOopsClosure : public KlassClosure {