# HG changeset patch # User jwilhelm # Date 1380799159 -7200 # Node ID ab68fc0101ce1e2adcf8c75e688e61194d43b68c # Parent 379ef2cc19c079825a935d5dfca44727de279dcb 8025855: Simplify GenRemSet code slightly Summary: Remove a few redundant switch-statements Reviewed-by: jcoomes, tschatzl diff -r 379ef2cc19c0 -r ab68fc0101ce src/share/vm/memory/collectorPolicy.cpp --- a/src/share/vm/memory/collectorPolicy.cpp Wed Oct 02 18:24:58 2013 +0200 +++ b/src/share/vm/memory/collectorPolicy.cpp Thu Oct 03 13:19:19 2013 +0200 @@ -137,15 +137,8 @@ GenRemSet* CollectorPolicy::create_rem_set(MemRegion whole_heap, int max_covered_regions) { - switch (rem_set_name()) { - case GenRemSet::CardTable: { - CardTableRS* res = new CardTableRS(whole_heap, max_covered_regions); - return res; - } - default: - guarantee(false, "unrecognized GenRemSet::Name"); - return NULL; - } + assert(rem_set_name() == GenRemSet::CardTable, "unrecognized GenRemSet::Name"); + return new CardTableRS(whole_heap, max_covered_regions); } void CollectorPolicy::cleared_all_soft_refs() { diff -r 379ef2cc19c0 -r ab68fc0101ce src/share/vm/memory/genRemSet.cpp --- a/src/share/vm/memory/genRemSet.cpp Wed Oct 02 18:24:58 2013 +0200 +++ b/src/share/vm/memory/genRemSet.cpp Thu Oct 03 13:19:19 2013 +0200 @@ -32,13 +32,8 @@ // enumeration.) uintx GenRemSet::max_alignment_constraint(Name nm) { - switch (nm) { - case GenRemSet::CardTable: - return CardTableRS::ct_max_alignment_constraint(); - default: - guarantee(false, "Unrecognized GenRemSet type."); - return (0); // Make Windows compiler happy - } + assert(nm == GenRemSet::CardTable, "Unrecognized GenRemSet type."); + return CardTableRS::ct_max_alignment_constraint(); } class HasAccumulatedModifiedOopsClosure : public KlassClosure {