Mercurial > hg > truffle
comparison src/share/vm/memory/collectorPolicy.cpp @ 12350:ab68fc0101ce
8025855: Simplify GenRemSet code slightly
Summary: Remove a few redundant switch-statements
Reviewed-by: jcoomes, tschatzl
author | jwilhelm |
---|---|
date | Thu, 03 Oct 2013 13:19:19 +0200 |
parents | 9ecd6d3782b1 |
children | 9b4d0569f2f4 |
comparison
equal
deleted
inserted
replaced
12349:379ef2cc19c0 | 12350:ab68fc0101ce |
---|---|
135 return result; | 135 return result; |
136 } | 136 } |
137 | 137 |
138 GenRemSet* CollectorPolicy::create_rem_set(MemRegion whole_heap, | 138 GenRemSet* CollectorPolicy::create_rem_set(MemRegion whole_heap, |
139 int max_covered_regions) { | 139 int max_covered_regions) { |
140 switch (rem_set_name()) { | 140 assert(rem_set_name() == GenRemSet::CardTable, "unrecognized GenRemSet::Name"); |
141 case GenRemSet::CardTable: { | 141 return new CardTableRS(whole_heap, max_covered_regions); |
142 CardTableRS* res = new CardTableRS(whole_heap, max_covered_regions); | |
143 return res; | |
144 } | |
145 default: | |
146 guarantee(false, "unrecognized GenRemSet::Name"); | |
147 return NULL; | |
148 } | |
149 } | 142 } |
150 | 143 |
151 void CollectorPolicy::cleared_all_soft_refs() { | 144 void CollectorPolicy::cleared_all_soft_refs() { |
152 // If near gc overhear limit, continue to clear SoftRefs. SoftRefs may | 145 // If near gc overhear limit, continue to clear SoftRefs. SoftRefs may |
153 // have been cleared in the last collection but if the gc overhear | 146 // have been cleared in the last collection but if the gc overhear |