--- old/src/hotspot/share/gc/g1/g1FullCollector.cpp 2017-11-21 11:59:45.090730887 +0100 +++ new/src/hotspot/share/gc/g1/g1FullCollector.cpp 2017-11-21 11:59:44.710715670 +0100 @@ -64,23 +64,23 @@ } G1CMBitMap* G1FullCollector::mark_bitmap() { - return heap()->concurrent_mark()->next_mark_bitmap(); + return _heap->concurrent_mark()->next_mark_bitmap(); } ReferenceProcessor* G1FullCollector::reference_processor() { - return heap()->ref_processor_stw(); + return _heap->ref_processor_stw(); } G1FullCollector::G1FullCollector(G1CollectedHeap* heap, bool explicit_gc, bool clear_soft_refs) : _heap(heap), _scope(explicit_gc, clear_soft_refs), - _num_workers(_heap->workers()->active_workers()), + _num_workers(heap->workers()->active_workers()), _oop_queue_set(_num_workers), _array_queue_set(_num_workers), _preserved_marks_set(true), _serial_compaction_point(), - _is_alive(mark_bitmap()), - _is_alive_mutator(reference_processor(), &_is_alive) { + _is_alive(heap->concurrent_mark()->next_mark_bitmap()), + _is_alive_mutator(heap->ref_processor_stw(), &_is_alive) { assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint"); _preserved_marks_set.init(_num_workers); @@ -104,16 +104,16 @@ } void G1FullCollector::prepare_collection() { - heap()->g1_policy()->record_full_collection_start(); + _heap->g1_policy()->record_full_collection_start(); - heap()->print_heap_before_gc(); - heap()->print_heap_regions(); + _heap->print_heap_before_gc(); + _heap->print_heap_regions(); - heap()->abort_concurrent_cycle(); - heap()->verify_before_full_collection(scope()->is_explicit_gc()); + _heap->abort_concurrent_cycle(); + _heap->verify_before_full_collection(scope()->is_explicit_gc()); - heap()->gc_prologue(true); - heap()->prepare_heap_for_full_collection(); + _heap->gc_prologue(true); + _heap->prepare_heap_for_full_collection(); reference_processor()->enable_discovery(); reference_processor()->setup_policy(scope()->should_clear_soft_refs()); @@ -156,14 +156,14 @@ CodeCache::gc_epilogue(); JvmtiExport::gc_epilogue(); - heap()->prepare_heap_for_mutators(); + _heap->prepare_heap_for_mutators(); - heap()->g1_policy()->record_full_collection_end(); - heap()->gc_epilogue(true); + _heap->g1_policy()->record_full_collection_end(); + _heap->gc_epilogue(true); - heap()->verify_after_full_collection(); + _heap->verify_after_full_collection(); - heap()->print_heap_after_full_collection(scope()->heap_transition()); + _heap->print_heap_after_full_collection(scope()->heap_transition()); } void G1FullCollector::phase1_mark_live_objects() { @@ -189,11 +189,11 @@ GCTraceTime(Debug, gc, phases) debug("Phase 1: Class Unloading and Cleanup", scope()->timer()); // Unload classes and purge the SystemDictionary. bool purged_class = SystemDictionary::do_unloading(&_is_alive, scope()->timer()); - G1CollectedHeap::heap()->complete_cleaning(&_is_alive, purged_class); + _heap->complete_cleaning(&_is_alive, purged_class); } else { GCTraceTime(Debug, gc, phases) debug("Phase 1: String and Symbol Tables Cleanup", scope()->timer()); // If no class unloading just clean out strings and symbols. - G1CollectedHeap::heap()->partial_cleaning(&_is_alive, true, true, G1StringDedup::is_enabled()); + _heap->partial_cleaning(&_is_alive, true, true, G1StringDedup::is_enabled()); } scope()->tracer()->report_object_count_after_gc(&_is_alive); @@ -235,13 +235,13 @@ } void G1FullCollector::restore_marks() { - SharedRestorePreservedMarksTaskExecutor task_executor(G1CollectedHeap::heap()->workers()); + SharedRestorePreservedMarksTaskExecutor task_executor(_heap->workers()); _preserved_marks_set.restore(&task_executor); _preserved_marks_set.reclaim(); } void G1FullCollector::run_task(AbstractGangTask* task) { - G1CollectedHeap::heap()->workers()->run_task(task, _num_workers); + _heap->workers()->run_task(task, _num_workers); } void G1FullCollector::verify_after_marking() { @@ -254,7 +254,7 @@ #if COMPILER2_OR_JVMCI DerivedPointerTableDeactivate dpt_deact; #endif - G1CollectedHeap::heap()->prepare_for_verify(); + _heap->prepare_for_verify(); // Note: we can verify only the heap here. When an object is // marked, the previous value of the mark word (including // identity hash values, ages, etc) is preserved, and the mark @@ -266,5 +266,5 @@ // (including hash values) are restored to the appropriate // objects. GCTraceTime(Info, gc, verify)("During GC (full)"); - G1CollectedHeap::heap()->verify(VerifyOption_G1UseFullMarking); + _heap->verify(VerifyOption_G1UseFullMarking); }