8198373: Remove CollectorPolicy::is/as functions

Reviewed-by: sjohanss, pliden
This commit is contained in:
Stefan Karlsson 2018-02-22 18:34:18 +01:00
parent d3d2bc3228
commit 713858f459
4 changed files with 1 additions and 27 deletions

View File

@ -35,8 +35,6 @@ class ConcurrentMarkSweepPolicy : public GenCollectorPolicy {
public:
ConcurrentMarkSweepPolicy() {}
ConcurrentMarkSweepPolicy* as_concurrent_mark_sweep_policy() { return this; }
void initialize_gc_policy_counters();
virtual void initialize_size_policy(size_t init_eden_size,

View File

@ -77,7 +77,6 @@ jint CMSHeap::initialize() {
// If we are running CMS, create the collector responsible
// for collecting the CMS generations.
assert(collector_policy()->is_concurrent_mark_sweep_policy(), "must be CMS policy");
if (!create_cms_collector()) {
return JNI_ENOMEM;
}
@ -152,11 +151,10 @@ void CMSHeap::print_on_error(outputStream* st) const {
bool CMSHeap::create_cms_collector() {
assert(old_gen()->kind() == Generation::ConcurrentMarkSweep,
"Unexpected generation kinds");
assert(gen_policy()->is_concurrent_mark_sweep_policy(), "Unexpected policy type");
CMSCollector* collector =
new CMSCollector((ConcurrentMarkSweepGeneration*) old_gen(),
rem_set(),
gen_policy()->as_concurrent_mark_sweep_policy());
(ConcurrentMarkSweepPolicy*) gen_policy());
if (collector == NULL || !collector->completed_initialization()) {
if (collector) {

View File

@ -1182,8 +1182,6 @@ bool CMSCollector::shouldConcurrentCollect() {
// this is not likely to be productive in practice because it's probably too
// late anyway.
CMSHeap* heap = CMSHeap::heap();
assert(heap->collector_policy()->is_generation_policy(),
"You may want to check the correctness of the following");
if (heap->incremental_collection_will_fail(true /* consult_young */)) {
log.print("CMSCollector: collect because incremental collection will fail ");
return true;

View File

@ -114,22 +114,6 @@ class CollectorPolicy : public CHeapObj<mtGC> {
// that the request in _should_clear_all_soft_refs has been fulfilled.
virtual void cleared_all_soft_refs();
// Identification methods.
virtual GenCollectorPolicy* as_generation_policy() { return NULL; }
virtual MarkSweepPolicy* as_mark_sweep_policy() { return NULL; }
#if INCLUDE_ALL_GCS
virtual ConcurrentMarkSweepPolicy* as_concurrent_mark_sweep_policy() { return NULL; }
#endif // INCLUDE_ALL_GCS
// Note that these are not virtual.
bool is_generation_policy() { return as_generation_policy() != NULL; }
bool is_mark_sweep_policy() { return as_mark_sweep_policy() != NULL; }
#if INCLUDE_ALL_GCS
bool is_concurrent_mark_sweep_policy() { return as_concurrent_mark_sweep_policy() != NULL; }
#else // INCLUDE_ALL_GCS
bool is_concurrent_mark_sweep_policy() { return false; }
#endif // INCLUDE_ALL_GCS
virtual CardTableRS* create_rem_set(MemRegion reserved);
virtual MetaWord* satisfy_failed_metadata_allocation(ClassLoaderData* loader_data,
@ -231,8 +215,6 @@ protected:
// Create the jstat counters for the GC policy.
virtual void initialize_gc_policy_counters() = 0;
virtual GenCollectorPolicy* as_generation_policy() { return this; }
virtual void initialize_generations() { };
virtual void initialize_all() {
@ -269,8 +251,6 @@ class MarkSweepPolicy : public GenCollectorPolicy {
public:
MarkSweepPolicy() {}
MarkSweepPolicy* as_mark_sweep_policy() { return this; }
void initialize_gc_policy_counters();
};