8219747: Remove g1_ prefix to g1_remset and g1_policy members in G1CollectedHeap
Reviewed-by: shade, sangheki
--- a/src/hotspot/share/gc/g1/g1Allocator.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1Allocator.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -369,7 +369,7 @@
} else {
hr->set_closed_archive();
}
- _g1h->g1_policy()->remset_tracker()->update_at_allocate(hr);
+ _g1h->policy()->remset_tracker()->update_at_allocate(hr);
_g1h->archive_set_add(hr);
_g1h->hr_printer()->alloc(hr);
_allocated_regions.append(hr);
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -259,14 +259,14 @@
// that there is a single object that starts at the bottom of the
// first region.
first_hr->set_starts_humongous(obj_top, word_fill_size);
- _g1_policy->remset_tracker()->update_at_allocate(first_hr);
+ _policy->remset_tracker()->update_at_allocate(first_hr);
// Then, if there are any, we will set up the "continues
// humongous" regions.
HeapRegion* hr = NULL;
for (uint i = first + 1; i <= last; ++i) {
hr = region_at(i);
hr->set_continues_humongous(first_hr);
- _g1_policy->remset_tracker()->update_at_allocate(hr);
+ _policy->remset_tracker()->update_at_allocate(hr);
}
// Up to this point no concurrent thread would have been able to
@@ -356,7 +356,7 @@
word_size * HeapWordSize);
_hrm->expand_at(first, obj_regions, workers());
- g1_policy()->record_new_heap_size(num_regions());
+ policy()->record_new_heap_size(num_regions());
#ifdef ASSERT
for (uint i = first; i < first + obj_regions; ++i) {
@@ -440,7 +440,7 @@
// If the GCLocker is active and we are bound for a GC, try expanding young gen.
// This is different to when only GCLocker::needs_gc() is set: try to avoid
// waiting because the GCLocker is active to not wait too long.
- if (GCLocker::is_active_and_needs_gc() && g1_policy()->can_expand_young_list()) {
+ if (GCLocker::is_active_and_needs_gc() && policy()->can_expand_young_list()) {
// No need for an ergo message here, can_expand_young_list() does this when
// it returns true.
result = _allocator->attempt_allocation_force(word_size);
@@ -861,7 +861,7 @@
// the check before we do the actual allocation. The reason for doing it
// before the allocation is that we avoid having to keep track of the newly
// allocated memory while we do a GC.
- if (g1_policy()->need_to_start_conc_mark("concurrent humongous allocation",
+ if (policy()->need_to_start_conc_mark("concurrent humongous allocation",
word_size)) {
collect(GCCause::_g1_humongous_allocation);
}
@@ -885,7 +885,7 @@
result = humongous_obj_allocate(word_size);
if (result != NULL) {
size_t size_in_regions = humongous_obj_size_in_regions(word_size);
- g1_policy()->add_bytes_allocated_in_old_since_last_gc(size_in_regions * HeapRegion::GrainBytes);
+ policy()->add_bytes_allocated_in_old_since_last_gc(size_in_regions * HeapRegion::GrainBytes);
return result;
}
@@ -963,7 +963,7 @@
return _allocator->attempt_allocation_locked(word_size);
} else {
HeapWord* result = humongous_obj_allocate(word_size);
- if (result != NULL && g1_policy()->need_to_start_conc_mark("STW humongous allocation")) {
+ if (result != NULL && policy()->need_to_start_conc_mark("STW humongous allocation")) {
collector_state()->set_initiate_conc_mark_if_possible(true);
}
return result;
@@ -1363,7 +1363,7 @@
if (expanded_by > 0) {
size_t actual_expand_bytes = expanded_by * HeapRegion::GrainBytes;
assert(actual_expand_bytes <= aligned_expand_bytes, "post-condition");
- g1_policy()->record_new_heap_size(num_regions());
+ policy()->record_new_heap_size(num_regions());
} else {
log_debug(gc, ergo, heap)("Did not expand the heap (heap expansion operation failed)");
@@ -1392,7 +1392,7 @@
log_debug(gc, ergo, heap)("Shrink the heap. requested shrinking amount: " SIZE_FORMAT "B aligned shrinking amount: " SIZE_FORMAT "B attempted shrinking amount: " SIZE_FORMAT "B",
shrink_bytes, aligned_shrink_bytes, shrunk_bytes);
if (num_regions_removed > 0) {
- g1_policy()->record_new_heap_size(num_regions());
+ policy()->record_new_heap_size(num_regions());
} else {
log_debug(gc, ergo, heap)("Did not expand the heap (heap shrinking operation failed)");
}
@@ -1510,11 +1510,11 @@
_survivor(),
_gc_timer_stw(new (ResourceObj::C_HEAP, mtGC) STWGCTimer()),
_gc_tracer_stw(new (ResourceObj::C_HEAP, mtGC) G1NewTracer()),
- _g1_policy(G1Policy::create_policy(collector_policy, _gc_timer_stw)),
+ _policy(G1Policy::create_policy(collector_policy, _gc_timer_stw)),
_heap_sizing_policy(NULL),
- _collection_set(this, _g1_policy),
+ _collection_set(this, _policy),
_hot_card_cache(NULL),
- _g1_rem_set(NULL),
+ _rem_set(NULL),
_dirty_card_queue_set(false),
_cm(NULL),
_cm_thread(NULL),
@@ -1540,7 +1540,7 @@
_allocator = new G1Allocator(this);
- _heap_sizing_policy = G1HeapSizingPolicy::create(this, _g1_policy->analytics());
+ _heap_sizing_policy = G1HeapSizingPolicy::create(this, _policy->analytics());
_humongous_object_threshold_in_words = humongous_threshold_for(HeapRegion::GrainWords);
@@ -1637,7 +1637,7 @@
guarantee(HeapWordSize == wordSize, "HeapWordSize must equal wordSize");
size_t init_byte_size = collector_policy()->initial_heap_byte_size();
- size_t max_byte_size = g1_collector_policy()->heap_reserved_size_bytes();
+ size_t max_byte_size = _collector_policy->heap_reserved_size_bytes();
size_t heap_alignment = collector_policy()->heap_alignment();
// Ensure that the sizes are properly aligned.
@@ -1738,7 +1738,7 @@
G1RegionToSpaceMapper* next_bitmap_storage =
create_aux_memory_mapper("Next Bitmap", bitmap_size, G1CMBitMap::heap_map_factor());
- _hrm = HeapRegionManager::create_manager(this, g1_collector_policy());
+ _hrm = HeapRegionManager::create_manager(this, _collector_policy);
_hrm->initialize(heap_storage, prev_bitmap_storage, next_bitmap_storage, bot_storage, cardtable_storage, card_counts_storage);
_card_table->initialize(cardtable_storage);
@@ -1754,8 +1754,8 @@
// start within the first card.
guarantee(g1_rs.base() >= (char*)G1CardTable::card_size, "Java heap must not start within the first card.");
// Also create a G1 rem set.
- _g1_rem_set = new G1RemSet(this, _card_table, _hot_card_cache);
- _g1_rem_set->initialize(max_reserved_capacity(), max_regions());
+ _rem_set = new G1RemSet(this, _card_table, _hot_card_cache);
+ _rem_set->initialize(max_reserved_capacity(), max_regions());
size_t max_cards_per_region = ((size_t)1 << (sizeof(CardIdx_t)*BitsPerByte-1)) - 1;
guarantee(HeapRegion::CardsPerRegion > 0, "make sure it's initialized");
@@ -1799,7 +1799,7 @@
}
// Perform any initialization actions delegated to the policy.
- g1_policy()->init(this, &_collection_set);
+ policy()->init(this, &_collection_set);
jint ecode = initialize_concurrent_refinement();
if (ecode != JNI_OK) {
@@ -1939,10 +1939,6 @@
return _collector_policy;
}
-G1CollectorPolicy* G1CollectedHeap::g1_collector_policy() const {
- return _collector_policy;
-}
-
SoftRefPolicy* G1CollectedHeap::soft_ref_policy() {
return &_soft_ref_policy;
}
@@ -1966,7 +1962,7 @@
n_completed_buffers++;
}
assert(dcqs.completed_buffers_num() == 0, "Completed buffers exist!");
- g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::UpdateRS, worker_i, n_completed_buffers, G1GCPhaseTimes::UpdateRSProcessedBuffers);
+ policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::UpdateRS, worker_i, n_completed_buffers, G1GCPhaseTimes::UpdateRSProcessedBuffers);
}
// Computes the sum of the storage used by the various regions.
@@ -2018,7 +2014,7 @@
}
bool G1CollectedHeap::should_upgrade_to_full_gc(GCCause::Cause cause) {
- if(g1_policy()->force_upgrade_to_full()) {
+ if(policy()->force_upgrade_to_full()) {
return true;
} else if (should_do_concurrent_full_gc(_gc_cause)) {
return false;
@@ -2146,7 +2142,7 @@
gc_count_before,
cause,
true, /* should_initiate_conc_mark */
- g1_policy()->max_pause_time_ms());
+ policy()->max_pause_time_ms());
VMThread::execute(&op);
gc_succeeded = op.gc_succeeded();
if (!gc_succeeded && retry_on_gc_failure) {
@@ -2172,7 +2168,7 @@
gc_count_before,
cause,
false, /* should_initiate_conc_mark */
- g1_policy()->max_pause_time_ms());
+ policy()->max_pause_time_ms());
VMThread::execute(&op);
gc_succeeded = op.gc_succeeded();
} else {
@@ -2274,7 +2270,7 @@
}
size_t G1CollectedHeap::tlab_capacity(Thread* ignored) const {
- return (_g1_policy->young_list_target_length() - _survivor.length()) * HeapRegion::GrainBytes;
+ return (_policy->young_list_target_length() - _survivor.length()) * HeapRegion::GrainBytes;
}
size_t G1CollectedHeap::tlab_used(Thread* ignored) const {
@@ -2303,7 +2299,7 @@
// See the notes in GenCollectedHeap::millis_since_last_gc()
// for more information about the implementation.
jlong ret_val = (os::javaTimeNanos() / NANOSECS_PER_MILLISEC) -
- _g1_policy->collection_pause_end_millis();
+ _policy->collection_pause_end_millis();
if (ret_val < 0) {
log_warning(gc)("millis_since_last_gc() would return : " JLONG_FORMAT
". returning zero instead.", ret_val);
@@ -2336,6 +2332,10 @@
return _cm_thread->request_concurrent_phase(phase);
}
+bool G1CollectedHeap::is_hetero_heap() const {
+ return _collector_policy->is_hetero_heap();
+}
+
class PrintRegionClosure: public HeapRegionClosure {
outputStream* _st;
public:
@@ -2445,7 +2445,7 @@
}
void G1CollectedHeap::print_tracing_info() const {
- g1_rem_set()->print_summary_info();
+ rem_set()->print_summary_info();
concurrent_mark()->print_summary_info();
}
@@ -2505,7 +2505,7 @@
size_t heap_used = Heap_lock->owned_by_self() ? used() : used_unlocked();
size_t eden_capacity_bytes =
- (g1_policy()->young_list_target_length() * HeapRegion::GrainBytes) - survivor_used_bytes;
+ (policy()->young_list_target_length() * HeapRegion::GrainBytes) - survivor_used_bytes;
VirtualSpaceSummary heap_summary = create_heap_space_summary();
return G1HeapSummary(heap_summary, heap_used, eden_used_bytes,
@@ -2539,7 +2539,7 @@
assert(InlineCacheBuffer::is_empty(), "should have cleaned up ICBuffer");
// This summary needs to be printed before incrementing total collections.
- g1_rem_set()->print_periodic_summary_info("Before GC RS summary", total_collections());
+ rem_set()->print_periodic_summary_info("Before GC RS summary", total_collections());
// Update common counters.
increment_total_collections(full /* full gc */);
@@ -2550,7 +2550,7 @@
// Fill TLAB's and such
double start = os::elapsedTime();
ensure_parsability(true);
- g1_policy()->phase_times()->record_prepare_tlab_time_ms((os::elapsedTime() - start) * 1000.0);
+ policy()->phase_times()->record_prepare_tlab_time_ms((os::elapsedTime() - start) * 1000.0);
}
void G1CollectedHeap::gc_epilogue(bool full) {
@@ -2561,7 +2561,7 @@
}
// We are at the end of the GC. Total collections has already been increased.
- g1_rem_set()->print_periodic_summary_info("After GC RS summary", total_collections() - 1);
+ rem_set()->print_periodic_summary_info("After GC RS summary", total_collections() - 1);
// FIXME: what is this about?
// I'm ignoring the "fill_newgen()" call if "alloc_event_enabled"
@@ -2573,7 +2573,7 @@
double start = os::elapsedTime();
resize_all_tlabs();
- g1_policy()->phase_times()->record_resize_tlab_time_ms((os::elapsedTime() - start) * 1000.0);
+ policy()->phase_times()->record_resize_tlab_time_ms((os::elapsedTime() - start) * 1000.0);
MemoryService::track_memory_usage();
// We have just completed a GC. Update the soft reference
@@ -2590,7 +2590,7 @@
gc_count_before,
gc_cause,
false, /* should_initiate_conc_mark */
- g1_policy()->max_pause_time_ms());
+ policy()->max_pause_time_ms());
VMThread::execute(&op);
HeapWord* result = op.result();
@@ -2767,7 +2767,7 @@
void G1CollectedHeap::register_humongous_regions_with_cset() {
if (!G1EagerReclaimHumongousObjects) {
- g1_policy()->phase_times()->record_fast_reclaim_humongous_stats(0.0, 0, 0);
+ policy()->phase_times()->record_fast_reclaim_humongous_stats(0.0, 0, 0);
return;
}
double time = os::elapsed_counter();
@@ -2777,9 +2777,9 @@
heap_region_iterate(&cl);
time = ((double)(os::elapsed_counter() - time) / os::elapsed_frequency()) * 1000.0;
- g1_policy()->phase_times()->record_fast_reclaim_humongous_stats(time,
- cl.total_humongous(),
- cl.candidate_humongous());
+ policy()->phase_times()->record_fast_reclaim_humongous_stats(time,
+ cl.total_humongous(),
+ cl.candidate_humongous());
_has_humongous_reclaim_candidates = cl.candidate_humongous() > 0;
// Finally flush all remembered set entries to re-check into the global DCQS.
@@ -2849,7 +2849,7 @@
double scan_wait_end = os::elapsedTime();
wait_time_ms = (scan_wait_end - scan_wait_start) * 1000.0;
}
- g1_policy()->phase_times()->record_root_region_scan_wait_time(wait_time_ms);
+ policy()->phase_times()->record_root_region_scan_wait_time(wait_time_ms);
}
class G1PrintCollectionSetClosure : public HeapRegionClosure {
@@ -2870,7 +2870,7 @@
clear_cset_fast_test();
guarantee(_eden.length() == 0, "eden should have been cleared");
- g1_policy()->transfer_survivors_to_cset(survivor());
+ policy()->transfer_survivors_to_cset(survivor());
}
bool
@@ -2890,7 +2890,7 @@
SvcGCMarker sgcm(SvcGCMarker::MINOR);
ResourceMark rm;
- g1_policy()->note_gc_start();
+ policy()->note_gc_start();
wait_for_root_region_scanning();
@@ -2906,7 +2906,7 @@
// This call will decide whether this pause is an initial-mark
// pause. If it is, in_initial_mark_gc() will return true
// for the duration of this pause.
- g1_policy()->decide_on_conc_mark_initiation();
+ policy()->decide_on_conc_mark_initiation();
}
// We do not allow initial-mark to be piggy-backed on a mixed GC.
@@ -3018,13 +3018,13 @@
// the possible verification above.
double sample_start_time_sec = os::elapsedTime();
- g1_policy()->record_collection_pause_start(sample_start_time_sec);
+ policy()->record_collection_pause_start(sample_start_time_sec);
if (collector_state()->in_initial_mark_gc()) {
concurrent_mark()->pre_initial_mark();
}
- g1_policy()->finalize_collection_set(target_pause_time_ms, &_survivor);
+ policy()->finalize_collection_set(target_pause_time_ms, &_survivor);
evacuation_info.set_collectionset_regions(collection_set()->region_length());
@@ -3067,12 +3067,12 @@
double start = os::elapsedTime();
start_new_collection_set();
- g1_policy()->phase_times()->record_start_new_cset_time_ms((os::elapsedTime() - start) * 1000.0);
+ policy()->phase_times()->record_start_new_cset_time_ms((os::elapsedTime() - start) * 1000.0);
if (evacuation_failed()) {
double recalculate_used_start = os::elapsedTime();
set_used(recalculate_used());
- g1_policy()->phase_times()->record_evac_fail_recalc_used_time((os::elapsedTime() - recalculate_used_start) * 1000.0);
+ policy()->phase_times()->record_evac_fail_recalc_used_time((os::elapsedTime() - recalculate_used_start) * 1000.0);
if (_archive_allocator != NULL) {
_archive_allocator->clear_used();
@@ -3085,7 +3085,7 @@
} else {
// The "used" of the the collection set have already been subtracted
// when they were freed. Add in the bytes evacuated.
- increase_used(g1_policy()->bytes_copied_during_gc());
+ increase_used(policy()->bytes_copied_during_gc());
}
if (collector_state()->in_initial_mark_gc()) {
@@ -3112,7 +3112,7 @@
if (!expand(expand_bytes, _workers, &expand_ms)) {
// We failed to expand the heap. Cannot do anything about it.
}
- g1_policy()->phase_times()->record_expand_heap_time(expand_ms);
+ policy()->phase_times()->record_expand_heap_time(expand_ms);
}
}
@@ -3125,11 +3125,11 @@
// investigate this in CR 7178365.
double sample_end_time_sec = os::elapsedTime();
double pause_time_ms = (sample_end_time_sec - sample_start_time_sec) * MILLIUNITS;
- size_t total_cards_scanned = g1_policy()->phase_times()->sum_thread_work_items(G1GCPhaseTimes::ScanRS, G1GCPhaseTimes::ScanRSScannedCards);
- g1_policy()->record_collection_pause_end(pause_time_ms, total_cards_scanned, heap_used_bytes_before_gc);
+ size_t total_cards_scanned = policy()->phase_times()->sum_thread_work_items(G1GCPhaseTimes::ScanRS, G1GCPhaseTimes::ScanRSScannedCards);
+ policy()->record_collection_pause_end(pause_time_ms, total_cards_scanned, heap_used_bytes_before_gc);
evacuation_info.set_collectionset_used_before(collection_set()->bytes_used_before());
- evacuation_info.set_bytes_copied(g1_policy()->bytes_copied_during_gc());
+ evacuation_info.set_bytes_copied(policy()->bytes_copied_during_gc());
if (VerifyRememberedSets) {
log_info(gc, verify)("[Verifying RemSets after GC]");
@@ -3158,7 +3158,7 @@
log_info(gc)("To-space exhausted");
}
- g1_policy()->print_phases();
+ policy()->print_phases();
heap_transition.print();
// It is not yet to safe to tell the concurrent mark to
@@ -3183,7 +3183,7 @@
g1mm()->update_sizes();
_gc_tracer_stw->report_evacuation_info(&evacuation_info);
- _gc_tracer_stw->report_tenuring_threshold(_g1_policy->tenuring_threshold());
+ _gc_tracer_stw->report_tenuring_threshold(_policy->tenuring_threshold());
_gc_timer_stw->register_gc_end();
_gc_tracer_stw->report_gc_end(_gc_timer_stw->gc_end(), _gc_timer_stw->time_partitions());
}
@@ -3217,7 +3217,7 @@
SharedRestorePreservedMarksTaskExecutor task_executor(workers());
_preserved_marks_set.restore(&task_executor);
- g1_policy()->phase_times()->record_evac_fail_remove_self_forwards((os::elapsedTime() - remove_self_forwards_start) * 1000.0);
+ policy()->phase_times()->record_evac_fail_remove_self_forwards((os::elapsedTime() - remove_self_forwards_start) * 1000.0);
}
void G1CollectedHeap::preserve_mark_during_evac_failure(uint worker_id, oop obj, markOop m) {
@@ -3275,7 +3275,7 @@
if (worker_id >= _n_workers) return; // no work needed this round
double start_sec = os::elapsedTime();
- _g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerStart, worker_id, start_sec);
+ _g1h->policy()->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerStart, worker_id, start_sec);
{
ResourceMark rm;
@@ -3290,7 +3290,7 @@
_root_processor->evacuate_roots(pss, worker_id);
- _g1h->g1_rem_set()->oops_into_collection_set_do(pss, worker_id);
+ _g1h->rem_set()->oops_into_collection_set_do(pss, worker_id);
double strong_roots_sec = os::elapsedTime() - start_strong_roots_sec;
@@ -3305,7 +3305,7 @@
term_sec = evac.term_time();
double elapsed_sec = os::elapsedTime() - start;
- G1GCPhaseTimes* p = _g1h->g1_policy()->phase_times();
+ G1GCPhaseTimes* p = _g1h->policy()->phase_times();
p->add_time_secs(G1GCPhaseTimes::ObjCopy, worker_id, elapsed_sec - term_sec);
p->record_or_add_thread_work_item(G1GCPhaseTimes::ObjCopy,
@@ -3327,7 +3327,7 @@
// destructors are executed here and are included as part of the
// "GC Worker Time".
}
- _g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerEnd, worker_id, os::elapsedTime());
+ _g1h->policy()->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerEnd, worker_id, os::elapsedTime());
}
};
@@ -3392,7 +3392,7 @@
_queue(queue), _g1h(g1h) { }
virtual void work(uint worker_id) {
- G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
+ G1GCPhaseTimes* phase_times = _g1h->policy()->phase_times();
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::RedirtyCards, worker_id);
RedirtyLoggedCardTableEntryClosure cl(_g1h);
@@ -3413,7 +3413,7 @@
dcq.merge_bufferlists(&dirty_card_queue_set());
assert(dirty_card_queue_set().completed_buffers_num() == 0, "All should be consumed");
- g1_policy()->phase_times()->record_redirty_logged_cards_time_ms((os::elapsedTime() - redirty_logged_cards_start) * 1000.0);
+ policy()->phase_times()->record_redirty_logged_cards_time_ms((os::elapsedTime() - redirty_logged_cards_start) * 1000.0);
}
// Weak Reference Processing support
@@ -3646,7 +3646,7 @@
// Setup the soft refs policy...
rp->setup_policy(false);
- ReferenceProcessorPhaseTimes* pt = g1_policy()->phase_times()->ref_phase_times();
+ ReferenceProcessorPhaseTimes* pt = policy()->phase_times()->ref_phase_times();
ReferenceProcessorStats stats;
if (!rp->processing_is_mt()) {
@@ -3682,7 +3682,7 @@
rp->verify_no_references_recorded();
double ref_proc_time = os::elapsedTime() - ref_proc_start;
- g1_policy()->phase_times()->record_ref_proc_time(ref_proc_time * 1000.0);
+ policy()->phase_times()->record_ref_proc_time(ref_proc_time * 1000.0);
}
void G1CollectedHeap::make_pending_list_reachable() {
@@ -3698,7 +3698,7 @@
void G1CollectedHeap::merge_per_thread_state_info(G1ParScanThreadStateSet* per_thread_states) {
double merge_pss_time_start = os::elapsedTime();
per_thread_states->flush();
- g1_policy()->phase_times()->record_merge_pss_time_ms((os::elapsedTime() - merge_pss_time_start) * 1000.0);
+ policy()->phase_times()->record_merge_pss_time_ms((os::elapsedTime() - merge_pss_time_start) * 1000.0);
}
void G1CollectedHeap::pre_evacuate_collection_set() {
@@ -3709,10 +3709,10 @@
_hot_card_cache->reset_hot_cache_claimed_index();
_hot_card_cache->set_use_cache(false);
- g1_rem_set()->prepare_for_oops_into_collection_set_do();
+ rem_set()->prepare_for_oops_into_collection_set_do();
_preserved_marks_set.assert_empty();
- G1GCPhaseTimes* phase_times = g1_policy()->phase_times();
+ G1GCPhaseTimes* phase_times = policy()->phase_times();
// InitialMark needs claim bits to keep track of the marked-through CLDs.
if (collector_state()->in_initial_mark_gc()) {
@@ -3731,7 +3731,7 @@
assert(dirty_card_queue_set().completed_buffers_num() == 0, "Should be empty");
- G1GCPhaseTimes* phase_times = g1_policy()->phase_times();
+ G1GCPhaseTimes* phase_times = policy()->phase_times();
double start_par_time_sec = os::elapsedTime();
double end_par_time_sec;
@@ -3790,7 +3790,7 @@
pss->oops_into_optional_region(hr)->oops_do(&scan_opt_cl, root_cls->raw_strong_oops());
copy_time += trim_ticks(pss);
- G1ScanRSForRegionClosure scan_rs_cl(_g1h->g1_rem_set()->scan_state(), &obj_cl, pss, G1GCPhaseTimes::OptScanRS, worker_id);
+ G1ScanRSForRegionClosure scan_rs_cl(_g1h->rem_set()->scan_state(), &obj_cl, pss, G1GCPhaseTimes::OptScanRS, worker_id);
scan_rs_cl.do_heap_region(hr);
copy_time += trim_ticks(pss);
scanned += scan_rs_cl.cards_scanned();
@@ -3802,7 +3802,7 @@
}
Tickspan scan_time = (Ticks::now() - start) - copy_time;
- G1GCPhaseTimes* p = _g1h->g1_policy()->phase_times();
+ G1GCPhaseTimes* p = _g1h->policy()->phase_times();
p->record_or_add_time_secs(G1GCPhaseTimes::OptScanRS, worker_id, scan_time.seconds());
p->record_or_add_time_secs(G1GCPhaseTimes::OptObjCopy, worker_id, copy_time.seconds());
@@ -3818,7 +3818,7 @@
cl.do_void();
Tickspan evac_time = (Ticks::now() - start);
- G1GCPhaseTimes* p = _g1h->g1_policy()->phase_times();
+ G1GCPhaseTimes* p = _g1h->policy()->phase_times();
p->record_or_add_time_secs(G1GCPhaseTimes::OptObjCopy, worker_id, evac_time.seconds());
assert(pss->trim_ticks().seconds() == 0.0, "Unexpected partial trimming done during optional evacuation");
}
@@ -3867,7 +3867,7 @@
return;
}
- G1GCPhaseTimes* phase_times = g1_policy()->phase_times();
+ G1GCPhaseTimes* phase_times = policy()->phase_times();
const double gc_start_time_ms = phase_times->cur_collection_start_sec() * 1000.0;
double start_time_sec = os::elapsedTime();
@@ -3881,7 +3881,7 @@
break;
}
- optional_cset.prepare_evacuation(time_left_ms * _g1_policy->optional_evacuation_fraction());
+ optional_cset.prepare_evacuation(time_left_ms * _policy->optional_evacuation_fraction());
if (optional_cset.prepare_failed()) {
log_trace(gc, ergo, cset)("Skipping %u optional regions, no regions can be evacuated in %.3fms", optional_cset.size(), time_left_ms);
break;
@@ -3901,7 +3901,7 @@
void G1CollectedHeap::post_evacuate_collection_set(G1EvacuationInfo& evacuation_info, G1ParScanThreadStateSet* per_thread_states) {
// Also cleans the card table from temporary duplicate detection information used
// during UpdateRS/ScanRS.
- g1_rem_set()->cleanup_after_oops_into_collection_set_do();
+ rem_set()->cleanup_after_oops_into_collection_set_do();
// Process any discovered reference objects - we have
// to do this _before_ we retire the GC alloc regions
@@ -3914,15 +3914,15 @@
G1KeepAliveClosure keep_alive(this);
WeakProcessor::weak_oops_do(workers(), &is_alive, &keep_alive,
- g1_policy()->phase_times()->weak_phase_times());
+ policy()->phase_times()->weak_phase_times());
if (G1StringDedup::is_enabled()) {
double string_dedup_time_ms = os::elapsedTime();
- string_dedup_cleaning(&is_alive, &keep_alive, g1_policy()->phase_times());
+ string_dedup_cleaning(&is_alive, &keep_alive, policy()->phase_times());
double string_cleanup_time_ms = (os::elapsedTime() - string_dedup_time_ms) * 1000.0;
- g1_policy()->phase_times()->record_string_deduplication_time(string_cleanup_time_ms);
+ policy()->phase_times()->record_string_deduplication_time(string_cleanup_time_ms);
}
if (evacuation_failed()) {
@@ -3952,13 +3952,13 @@
#if COMPILER2_OR_JVMCI
double start = os::elapsedTime();
DerivedPointerTable::update_pointers();
- g1_policy()->phase_times()->record_derived_pointer_table_update_time((os::elapsedTime() - start) * 1000.0);
+ policy()->phase_times()->record_derived_pointer_table_update_time((os::elapsedTime() - start) * 1000.0);
#endif
- g1_policy()->print_age_table();
+ policy()->print_age_table();
}
void G1CollectedHeap::record_obj_copy_mem_stats() {
- g1_policy()->add_bytes_allocated_in_old_since_last_gc(_old_evac_stats.allocated() * HeapWordSize);
+ policy()->add_bytes_allocated_in_old_since_last_gc(_old_evac_stats.allocated() * HeapWordSize);
_gc_tracer_stw->report_evacuation_statistics(create_g1_evac_summary(&_survivor_evac_stats),
create_g1_evac_summary(&_old_evac_stats));
@@ -3986,7 +3986,7 @@
_hot_card_cache->reset_card_counts(hr);
}
hr->hr_clear(skip_remset, true /* clear_space */, locked /* locked */);
- _g1_policy->remset_tracker()->update_at_free(hr);
+ _policy->remset_tracker()->update_at_free(hr);
free_list->add_ordered(hr);
}
@@ -4116,7 +4116,7 @@
g1h->prepend_to_freelist(&_local_free_list);
g1h->decrement_summary_bytes(_before_used_bytes);
- G1Policy* policy = g1h->g1_policy();
+ G1Policy* policy = g1h->policy();
policy->add_bytes_allocated_in_old_since_last_gc(_bytes_allocated_in_old_since_last_gc);
g1h->alloc_buffer_stats(InCSetState::Old)->add_failure_used_and_waste(_failure_used_words, _failure_waste_words);
@@ -4191,7 +4191,7 @@
void complete_work() {
_cl.complete_work();
- G1Policy* policy = G1CollectedHeap::heap()->g1_policy();
+ G1Policy* policy = G1CollectedHeap::heap()->policy();
policy->record_max_rs_lengths(_rs_lengths);
policy->cset_regions_freed();
}
@@ -4219,7 +4219,7 @@
static uint chunk_size() { return 32; }
virtual void work(uint worker_id) {
- G1GCPhaseTimes* timer = G1CollectedHeap::heap()->g1_policy()->phase_times();
+ G1GCPhaseTimes* timer = G1CollectedHeap::heap()->policy()->phase_times();
// Claim serial work.
if (_serial_work_claim == 0) {
@@ -4296,7 +4296,7 @@
_collection_set.region_length());
workers()->run_task(&cl, num_workers);
}
- g1_policy()->phase_times()->record_total_free_cset_time_ms((os::elapsedTime() - free_cset_start_time) * 1000.0);
+ policy()->phase_times()->record_total_free_cset_time_ms((os::elapsedTime() - free_cset_start_time) * 1000.0);
collection_set->clear();
}
@@ -4421,7 +4421,7 @@
if (!G1EagerReclaimHumongousObjects ||
(!_has_humongous_reclaim_candidates && !log_is_enabled(Debug, gc, humongous))) {
- g1_policy()->phase_times()->record_fast_reclaim_humongous_time_ms(0.0, 0);
+ policy()->phase_times()->record_fast_reclaim_humongous_time_ms(0.0, 0);
return;
}
@@ -4446,8 +4446,8 @@
prepend_to_freelist(&local_cleanup_list);
decrement_summary_bytes(cl.bytes_freed());
- g1_policy()->phase_times()->record_fast_reclaim_humongous_time_ms((os::elapsedTime() - start_time) * 1000.0,
- cl.humongous_objects_reclaimed());
+ policy()->phase_times()->record_fast_reclaim_humongous_time_ms((os::elapsedTime() - start_time) * 1000.0,
+ cl.humongous_objects_reclaimed());
}
class G1AbandonCollectionSetClosure : public HeapRegionClosure {
@@ -4474,7 +4474,7 @@
void G1CollectedHeap::set_region_short_lived_locked(HeapRegion* hr) {
_eden.add(hr);
- _g1_policy->set_region_eden(hr);
+ _policy->set_region_eden(hr);
}
#ifdef ASSERT
@@ -4644,7 +4644,7 @@
HeapRegion* G1CollectedHeap::new_mutator_alloc_region(size_t word_size,
bool force) {
assert_heap_locked_or_at_safepoint(true /* should_be_vm_thread */);
- bool should_allocate = g1_policy()->should_allocate_mutator_region();
+ bool should_allocate = policy()->should_allocate_mutator_region();
if (force || should_allocate) {
HeapRegion* new_alloc_region = new_region(word_size,
HeapRegionType::Eden,
@@ -4653,7 +4653,7 @@
set_region_short_lived_locked(new_alloc_region);
_hr_printer.alloc(new_alloc_region, !should_allocate);
_verifier->check_bitmaps("Mutator Region Allocation", new_alloc_region);
- _g1_policy->remset_tracker()->update_at_allocate(new_alloc_region);
+ _policy->remset_tracker()->update_at_allocate(new_alloc_region);
return new_alloc_region;
}
}
@@ -4680,7 +4680,7 @@
if (dest.is_old()) {
return true;
} else {
- return survivor_regions_count() < g1_policy()->max_survivor_regions();
+ return survivor_regions_count() < policy()->max_survivor_regions();
}
}
@@ -4711,7 +4711,7 @@
new_alloc_region->set_old();
_verifier->check_bitmaps("Old Region Allocation", new_alloc_region);
}
- _g1_policy->remset_tracker()->update_at_allocate(new_alloc_region);
+ _policy->remset_tracker()->update_at_allocate(new_alloc_region);
_hr_printer.alloc(new_alloc_region);
return new_alloc_region;
}
@@ -4721,7 +4721,7 @@
void G1CollectedHeap::retire_gc_alloc_region(HeapRegion* alloc_region,
size_t allocated_bytes,
InCSetState dest) {
- g1_policy()->record_bytes_copied_during_gc(allocated_bytes);
+ policy()->record_bytes_copied_during_gc(allocated_bytes);
if (dest.is_old()) {
old_set_add(alloc_region);
}
@@ -4826,7 +4826,7 @@
double purge_start = os::elapsedTime();
G1CodeRootSet::purge();
double purge_time_ms = (os::elapsedTime() - purge_start) * 1000.0;
- g1_policy()->phase_times()->record_strong_code_root_purge_time(purge_time_ms);
+ policy()->phase_times()->record_strong_code_root_purge_time(purge_time_ms);
}
class RebuildStrongCodeRootClosure: public CodeBlobClosure {
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp Mon Mar 04 11:49:16 2019 +0100
@@ -366,7 +366,7 @@
G1NewTracer* _gc_tracer_stw;
// The current policy object for the collector.
- G1Policy* _g1_policy;
+ G1Policy* _policy;
G1HeapSizingPolicy* _heap_sizing_policy;
G1CollectionSet _collection_set;
@@ -745,7 +745,7 @@
G1HotCardCache* _hot_card_cache;
// The g1 remembered set of the heap.
- G1RemSet* _g1_rem_set;
+ G1RemSet* _rem_set;
// A set of cards that cover the objects for which the Rsets should be updated
// concurrently after the collection.
@@ -950,7 +950,9 @@
G1CollectorState* collector_state() { return &_collector_state; }
// The current policy object for the collector.
- G1Policy* g1_policy() const { return _g1_policy; }
+ G1Policy* policy() const { return _policy; }
+ // The remembered set.
+ G1RemSet* rem_set() const { return _rem_set; }
HeapRegionManager* hrm() const { return _hrm; }
@@ -958,7 +960,6 @@
G1CollectionSet* collection_set() { return &_collection_set; }
virtual CollectorPolicy* collector_policy() const;
- virtual G1CollectorPolicy* g1_collector_policy() const;
virtual SoftRefPolicy* soft_ref_policy();
@@ -967,9 +968,6 @@
virtual GrowableArray<GCMemoryManager*> memory_managers();
virtual GrowableArray<MemoryPool*> memory_pools();
- // The rem set and barrier set.
- G1RemSet* g1_rem_set() const { return _g1_rem_set; }
-
// Try to minimize the remembered set.
void scrub_rem_set();
@@ -1366,6 +1364,7 @@
// WhiteBox testing support.
virtual bool supports_concurrent_phase_control() const;
virtual bool request_concurrent_phase(const char* phase);
+ bool is_hetero_heap() const;
virtual WorkGang* get_safepoint_workers() { return _workers; }
--- a/src/hotspot/share/gc/g1/g1CollectorPolicy.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1CollectorPolicy.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -1013,7 +1013,7 @@
uint _num_regions_selected_for_rebuild; // The number of regions actually selected for rebuild.
void update_remset_before_rebuild(HeapRegion* hr) {
- G1RemSetTrackingPolicy* tracking_policy = _g1h->g1_policy()->remset_tracker();
+ G1RemSetTrackingPolicy* tracking_policy = _g1h->policy()->remset_tracker();
bool selected_for_rebuild;
if (hr->is_humongous()) {
@@ -1118,7 +1118,7 @@
G1UpdateRemSetTrackingAfterRebuild(G1CollectedHeap* g1h) : _g1h(g1h) { }
virtual bool do_heap_region(HeapRegion* r) {
- _g1h->g1_policy()->remset_tracker()->update_after_rebuild(r);
+ _g1h->policy()->remset_tracker()->update_after_rebuild(r);
return false;
}
};
@@ -1132,8 +1132,8 @@
return;
}
- G1Policy* g1p = _g1h->g1_policy();
- g1p->record_concurrent_mark_remark_start();
+ G1Policy* policy = _g1h->policy();
+ policy->record_concurrent_mark_remark_start();
double start = os::elapsedTime();
@@ -1220,7 +1220,7 @@
_remark_weak_ref_times.add((now - mark_work_end) * 1000.0);
_remark_times.add((now - start) * 1000.0);
- g1p->record_concurrent_mark_remark_end();
+ policy->record_concurrent_mark_remark_end();
}
class G1ReclaimEmptyRegionsTask : public AbstractGangTask {
@@ -1338,8 +1338,8 @@
return;
}
- G1Policy* g1p = _g1h->g1_policy();
- g1p->record_concurrent_mark_cleanup_start();
+ G1Policy* policy = _g1h->policy();
+ policy->record_concurrent_mark_cleanup_start();
double start = os::elapsedTime();
@@ -1369,7 +1369,7 @@
{
GCTraceTime(Debug, gc, phases) debug("Finalize Concurrent Mark Cleanup", _gc_timer_cm);
- _g1h->g1_policy()->record_concurrent_mark_cleanup_end();
+ policy->record_concurrent_mark_cleanup_end();
}
}
@@ -1993,7 +1993,7 @@
#endif // PRODUCT
void G1ConcurrentMark::rebuild_rem_set_concurrently() {
- _g1h->g1_rem_set()->rebuild_rem_set(this, _concurrent_workers, _worker_id_offset);
+ _g1h->rem_set()->rebuild_rem_set(this, _concurrent_workers, _worker_id_offset);
}
void G1ConcurrentMark::print_stats() {
@@ -2572,7 +2572,7 @@
// and do_marking_step() is not being called serially.
bool do_stealing = do_termination && !is_serial;
- double diff_prediction_ms = _g1h->g1_policy()->predictor().get_new_prediction(&_marking_step_diffs_ms);
+ double diff_prediction_ms = _g1h->policy()->predictor().get_new_prediction(&_marking_step_diffs_ms);
_time_target_ms = time_target_ms - diff_prediction_ms;
// set up the variables that are used in the work-based scheme to
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp Mon Mar 04 11:49:16 2019 +0100
@@ -194,7 +194,7 @@
assert(_top_at_rebuild_starts[region] == NULL,
"TARS for region %u has already been set to " PTR_FORMAT " should be NULL",
region, p2i(_top_at_rebuild_starts[region]));
- G1RemSetTrackingPolicy* tracker = _g1h->g1_policy()->remset_tracker();
+ G1RemSetTrackingPolicy* tracker = _g1h->policy()->remset_tracker();
if (tracker->needs_scan_for_rebuild(r)) {
_top_at_rebuild_starts[region] = r->top();
} else {
--- a/src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -243,7 +243,7 @@
_vtime_start = os::elapsedVTime();
G1CollectedHeap* g1h = G1CollectedHeap::heap();
- G1Policy* g1_policy = g1h->g1_policy();
+ G1Policy* policy = g1h->policy();
G1ConcPhaseManager cpmanager(G1ConcurrentPhase::IDLE, this);
@@ -322,7 +322,7 @@
double mark_end_time = os::elapsedVTime();
jlong mark_end = os::elapsed_counter();
_vtime_mark_accum += (mark_end_time - cycle_start);
- delay_to_keep_mmu(g1_policy, true /* remark */);
+ delay_to_keep_mmu(policy, true /* remark */);
if (_cm->has_aborted()) {
break;
}
@@ -361,7 +361,7 @@
_vtime_accum = (end_time - _vtime_start);
if (!_cm->has_aborted()) {
- delay_to_keep_mmu(g1_policy, false /* cleanup */);
+ delay_to_keep_mmu(policy, false /* cleanup */);
}
if (!_cm->has_aborted()) {
--- a/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -45,7 +45,7 @@
class G1RefineCardConcurrentlyClosure: public G1CardTableEntryClosure {
public:
bool do_card_ptr(jbyte* card_ptr, uint worker_i) {
- G1CollectedHeap::heap()->g1_rem_set()->refine_card_concurrently(card_ptr, worker_i);
+ G1CollectedHeap::heap()->rem_set()->refine_card_concurrently(card_ptr, worker_i);
if (SuspendibleThreadSet::should_yield()) {
// Caller will actually yield.
--- a/src/hotspot/share/gc/g1/g1FullCollector.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1FullCollector.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -138,7 +138,7 @@
}
void G1FullCollector::prepare_collection() {
- _heap->g1_policy()->record_full_collection_start();
+ _heap->policy()->record_full_collection_start();
_heap->print_heap_before_gc();
_heap->print_heap_regions();
@@ -192,7 +192,7 @@
_heap->prepare_heap_for_mutators();
- _heap->g1_policy()->record_full_collection_end();
+ _heap->policy()->record_full_collection_end();
_heap->gc_epilogue(true);
_heap->verify_after_full_collection();
--- a/src/hotspot/share/gc/g1/g1HeapTransition.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1HeapTransition.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -88,8 +88,8 @@
void G1HeapTransition::print() {
Data after(_g1_heap);
- size_t eden_capacity_length_after_gc = _g1_heap->g1_policy()->young_list_target_length() - after._survivor_length;
- size_t survivor_capacity_length_before_gc = _g1_heap->g1_policy()->max_survivor_regions();
+ size_t eden_capacity_length_after_gc = _g1_heap->policy()->young_list_target_length() - after._survivor_length;
+ size_t survivor_capacity_length_before_gc = _g1_heap->policy()->max_survivor_regions();
DetailedUsage usage;
if (log_is_enabled(Trace, gc, heap)) {
--- a/src/hotspot/share/gc/g1/g1HeapVerifier.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1HeapVerifier.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -495,7 +495,7 @@
bool failures = rootsCl.failures() || codeRootsCl.failures();
- if (!_g1h->g1_policy()->collector_state()->in_full_gc()) {
+ if (!_g1h->policy()->collector_state()->in_full_gc()) {
// If we're verifying during a full GC then the region sets
// will have been torn down at the start of the GC. Therefore
// verifying the region sets will fail. So we only verify
@@ -630,14 +630,14 @@
void G1HeapVerifier::verify_before_gc(G1VerifyType type) {
if (VerifyBeforeGC) {
double verify_time_ms = verify(type, VerifyOption_G1UsePrevMarking, "Before GC");
- _g1h->g1_policy()->phase_times()->record_verify_before_time_ms(verify_time_ms);
+ _g1h->policy()->phase_times()->record_verify_before_time_ms(verify_time_ms);
}
}
void G1HeapVerifier::verify_after_gc(G1VerifyType type) {
if (VerifyAfterGC) {
double verify_time_ms = verify(type, VerifyOption_G1UsePrevMarking, "After GC");
- _g1h->g1_policy()->phase_times()->record_verify_after_time_ms(verify_time_ms);
+ _g1h->policy()->phase_times()->record_verify_after_time_ms(verify_time_ms);
}
}
--- a/src/hotspot/share/gc/g1/g1HeterogeneousCollectorPolicy.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1HeterogeneousCollectorPolicy.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
--- a/src/hotspot/share/gc/g1/g1MonitoringSupport.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1MonitoringSupport.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -234,7 +234,7 @@
uint eden_list_length = young_list_length - survivor_list_length;
// Max length includes any potential extensions to the young gen
// we'll do when the GC locker is active.
- uint young_list_max_length = _g1h->g1_policy()->young_list_max_length();
+ uint young_list_max_length = _g1h->policy()->young_list_max_length();
assert(young_list_max_length >= survivor_list_length, "invariant");
uint eden_list_max_length = young_list_max_length - survivor_list_length;
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -48,7 +48,7 @@
_closures(NULL),
_plab_allocator(NULL),
_age_table(false),
- _tenuring_threshold(g1h->g1_policy()->tenuring_threshold()),
+ _tenuring_threshold(g1h->policy()->tenuring_threshold()),
_scanner(g1h, this),
_worker_id(worker_id),
_stack_trim_upper_threshold(GCDrainStackTargetSize * 2 + 1),
@@ -91,7 +91,7 @@
_dcq.flush();
// Update allocation statistics.
_plab_allocator->flush_and_retire_stats();
- _g1h->g1_policy()->record_age_table(&_age_table);
+ _g1h->policy()->record_age_table(&_age_table);
uint length = _g1h->collection_set()->young_region_length();
for (uint region_index = 0; region_index < length; region_index++) {
@@ -372,7 +372,7 @@
}
size_t used_memory = pss->oops_into_optional_region(hr)->used_memory();
- _g1h->g1_policy()->phase_times()->record_or_add_thread_work_item(G1GCPhaseTimes::OptScanRS, worker_index, used_memory, G1GCPhaseTimes::OptCSetUsedMemory);
+ _g1h->policy()->phase_times()->record_or_add_thread_work_item(G1GCPhaseTimes::OptScanRS, worker_index, used_memory, G1GCPhaseTimes::OptCSetUsedMemory);
}
}
--- a/src/hotspot/share/gc/g1/g1RemSet.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1RemSet.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -288,7 +288,7 @@
_g1h(g1h),
_num_conc_refined_cards(0),
_ct(ct),
- _g1p(_g1h->g1_policy()),
+ _g1p(_g1h->policy()),
_hot_card_cache(hot_card_cache) {
}
@@ -467,7 +467,7 @@
size_t _cards_skipped;
public:
G1RefineCardClosure(G1CollectedHeap* g1h, G1ScanObjsDuringUpdateRSClosure* update_rs_cl) :
- _g1rs(g1h->g1_rem_set()), _update_rs_cl(update_rs_cl), _cards_scanned(0), _cards_skipped(0)
+ _g1rs(g1h->rem_set()), _update_rs_cl(update_rs_cl), _cards_scanned(0), _cards_skipped(0)
{}
bool do_card_ptr(jbyte* card_ptr, uint worker_i) {
@@ -530,7 +530,7 @@
}
void G1RemSet::cleanup_after_oops_into_collection_set_do() {
- G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
+ G1GCPhaseTimes* phase_times = _g1h->policy()->phase_times();
// Set all cards back to clean.
double start = os::elapsedTime();
--- a/src/hotspot/share/gc/g1/g1RootProcessor.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1RootProcessor.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -76,7 +76,7 @@
_n_workers_discovered_strong_classes(0) {}
void G1RootProcessor::evacuate_roots(G1ParScanThreadState* pss, uint worker_i) {
- G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
+ G1GCPhaseTimes* phase_times = _g1h->policy()->phase_times();
G1EvacPhaseTimesTracker timer(phase_times, pss, G1GCPhaseTimes::ExtRootScan, worker_i);
--- a/src/hotspot/share/gc/g1/g1VMOperations.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1VMOperations.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -100,7 +100,7 @@
// At this point we are supposed to start a concurrent cycle. We
// will do so if one is not already in progress.
- bool res = g1h->g1_policy()->force_initial_mark_if_outside_cycle(_gc_cause);
+ bool res = g1h->policy()->force_initial_mark_if_outside_cycle(_gc_cause);
// The above routine returns true if we were able to force the
// next GC pause to be an initial mark; it returns false if a
--- a/src/hotspot/share/gc/g1/g1YoungGenSizer.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1YoungGenSizer.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
--- a/src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -163,16 +163,16 @@
void G1YoungRemSetSamplingThread::sample_young_list_rs_lengths() {
SuspendibleThreadSetJoiner sts;
G1CollectedHeap* g1h = G1CollectedHeap::heap();
- G1Policy* g1p = g1h->g1_policy();
+ G1Policy* policy = g1h->policy();
- if (g1p->adaptive_young_list_length()) {
+ if (policy->adaptive_young_list_length()) {
G1YoungRemSetSamplingClosure cl(&sts);
G1CollectionSet* g1cs = g1h->collection_set();
g1cs->iterate(&cl);
if (cl.is_complete()) {
- g1p->revise_young_list_target_length_if_necessary(cl.sampled_rs_lengths());
+ policy->revise_young_list_target_length_if_necessary(cl.sampled_rs_lengths());
}
}
}
--- a/src/hotspot/share/gc/g1/heapRegion.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/heapRegion.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -144,13 +144,13 @@
// GC efficiency is the ratio of how much space would be
// reclaimed over how long we predict it would take to reclaim it.
G1CollectedHeap* g1h = G1CollectedHeap::heap();
- G1Policy* g1p = g1h->g1_policy();
+ G1Policy* policy = g1h->policy();
// Retrieve a prediction of the elapsed time for this region for
// a mixed gc because the region will only be evacuated during a
// mixed gc.
double region_elapsed_time_ms =
- g1p->predict_region_elapsed_time_ms(this, false /* for_young_gc */);
+ policy->predict_region_elapsed_time_ms(this, false /* for_young_gc */);
_gc_efficiency = (double) reclaimable_bytes() / region_elapsed_time_ms;
}
--- a/src/hotspot/share/gc/g1/heapRegionManager.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/g1/heapRegionManager.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
--- a/src/hotspot/share/gc/shared/gcVMOperations.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/gc/shared/gcVMOperations.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -201,16 +201,16 @@
#if INCLUDE_G1GC
if (UseG1GC && ClassUnloadingWithConcurrentMark) {
G1CollectedHeap* g1h = G1CollectedHeap::heap();
- g1h->g1_policy()->collector_state()->set_initiate_conc_mark_if_possible(true);
+ g1h->policy()->collector_state()->set_initiate_conc_mark_if_possible(true);
GCCauseSetter x(g1h, _gc_cause);
// At this point we are supposed to start a concurrent cycle. We
// will do so if one is not already in progress.
- bool should_start = g1h->g1_policy()->force_initial_mark_if_outside_cycle(_gc_cause);
+ bool should_start = g1h->policy()->force_initial_mark_if_outside_cycle(_gc_cause);
if (should_start) {
- double pause_target = g1h->g1_policy()->max_pause_time_ms();
+ double pause_target = g1h->policy()->max_pause_time_ms();
g1h->do_collection_pause_at_safepoint(pause_target);
}
return true;
--- a/src/hotspot/share/prims/whitebox.cpp Mon Mar 04 11:49:16 2019 +0100
+++ b/src/hotspot/share/prims/whitebox.cpp Mon Mar 04 11:49:16 2019 +0100
@@ -483,7 +483,7 @@
#if INCLUDE_G1GC
if (UseG1GC) {
G1CollectedHeap* g1h = G1CollectedHeap::heap();
- if (g1h->g1_collector_policy()->is_hetero_heap()) {
+ if (g1h->is_hetero_heap()) {
uint start_region = HeterogeneousHeapRegionManager::manager()->start_index_of_dram();
return (jlong)(g1h->base() + start_region * HeapRegion::GrainBytes);
} else {
@@ -509,7 +509,7 @@
#if INCLUDE_G1GC
if (UseG1GC) {
G1CollectedHeap* g1h = G1CollectedHeap::heap();
- if (g1h->g1_collector_policy()->is_hetero_heap()) {
+ if (g1h->is_hetero_heap()) {
uint end_region = HeterogeneousHeapRegionManager::manager()->end_index_of_dram();
return (jlong)(g1h->base() + (end_region + 1) * HeapRegion::GrainBytes - 1);
} else {
@@ -535,7 +535,7 @@
#if INCLUDE_G1GC
if (UseG1GC) {
G1CollectedHeap* g1h = G1CollectedHeap::heap();
- if (g1h->g1_collector_policy()->is_hetero_heap()) {
+ if (g1h->is_hetero_heap()) {
uint start_region = HeterogeneousHeapRegionManager::manager()->start_index_of_nvdimm();
return (jlong)(g1h->base() + start_region * HeapRegion::GrainBytes);
} else {
@@ -561,7 +561,7 @@
#if INCLUDE_G1GC
if (UseG1GC) {
G1CollectedHeap* g1h = G1CollectedHeap::heap();
- if (g1h->g1_collector_policy()->is_hetero_heap()) {
+ if (g1h->is_hetero_heap()) {
uint end_region = HeterogeneousHeapRegionManager::manager()->start_index_of_nvdimm();
return (jlong)(g1h->base() + (end_region + 1) * HeapRegion::GrainBytes - 1);
} else {