You need to sign in or sign up before continuing.
提交 35b1fad1 编写于 作者: J jwilhelm

8025855: Simplify GenRemSet code slightly

Summary: Remove a few redundant switch-statements
Reviewed-by: jcoomes, tschatzl
上级 26a90292
...@@ -137,15 +137,8 @@ bool CollectorPolicy::use_should_clear_all_soft_refs(bool v) { ...@@ -137,15 +137,8 @@ bool CollectorPolicy::use_should_clear_all_soft_refs(bool v) {
GenRemSet* CollectorPolicy::create_rem_set(MemRegion whole_heap, GenRemSet* CollectorPolicy::create_rem_set(MemRegion whole_heap,
int max_covered_regions) { int max_covered_regions) {
switch (rem_set_name()) { assert(rem_set_name() == GenRemSet::CardTable, "unrecognized GenRemSet::Name");
case GenRemSet::CardTable: { return new CardTableRS(whole_heap, max_covered_regions);
CardTableRS* res = new CardTableRS(whole_heap, max_covered_regions);
return res;
}
default:
guarantee(false, "unrecognized GenRemSet::Name");
return NULL;
}
} }
void CollectorPolicy::cleared_all_soft_refs() { void CollectorPolicy::cleared_all_soft_refs() {
......
...@@ -32,13 +32,8 @@ ...@@ -32,13 +32,8 @@
// enumeration.) // enumeration.)
uintx GenRemSet::max_alignment_constraint(Name nm) { uintx GenRemSet::max_alignment_constraint(Name nm) {
switch (nm) { assert(nm == GenRemSet::CardTable, "Unrecognized GenRemSet type.");
case GenRemSet::CardTable: return CardTableRS::ct_max_alignment_constraint();
return CardTableRS::ct_max_alignment_constraint();
default:
guarantee(false, "Unrecognized GenRemSet type.");
return (0); // Make Windows compiler happy
}
} }
class HasAccumulatedModifiedOopsClosure : public KlassClosure { class HasAccumulatedModifiedOopsClosure : public KlassClosure {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册