Skip to content
Permalink
Browse files
8260004: Shenandoah: Rename ShenandoahMarkCompact to ShenandoahFullGC
Reviewed-by: shade, rkennke
  • Loading branch information
zhengyu123 committed Feb 1, 2021
1 parent df33595 commit e963ebd721c3abd0a75e478b4bf245256c0bde7a
@@ -29,10 +29,10 @@
#include "gc/shenandoah/shenandoahControlThread.hpp"
#include "gc/shenandoah/shenandoahDegeneratedGC.hpp"
#include "gc/shenandoah/shenandoahFreeSet.hpp"
#include "gc/shenandoah/shenandoahFullGC.hpp"
#include "gc/shenandoah/shenandoahPhaseTimings.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahMark.inline.hpp"
#include "gc/shenandoah/shenandoahMarkCompact.hpp"
#include "gc/shenandoah/shenandoahMonitoringSupport.hpp"
#include "gc/shenandoah/shenandoahOopClosures.inline.hpp"
#include "gc/shenandoah/shenandoahRootProcessor.inline.hpp"
@@ -422,7 +422,7 @@ void ShenandoahControlThread::service_stw_full_cycle(GCCause::Cause cause) {
GCIdMark gc_id_mark;
ShenandoahGCSession session(cause);

ShenandoahMarkCompact gc;
ShenandoahFullGC gc;
gc.collect(cause);

ShenandoahHeap* const heap = ShenandoahHeap::heap();
@@ -29,8 +29,8 @@
#include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
#include "gc/shenandoah/shenandoahConcurrentMark.hpp"
#include "gc/shenandoah/shenandoahDegeneratedGC.hpp"
#include "gc/shenandoah/shenandoahFullGC.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahMarkCompact.hpp"
#include "gc/shenandoah/shenandoahMetrics.hpp"
#include "gc/shenandoah/shenandoahMonitoringSupport.hpp"
#include "gc/shenandoah/shenandoahOopClosures.inline.hpp"
@@ -326,13 +326,13 @@ void ShenandoahDegenGC::op_degenerated_fail() {
log_info(gc)("Cannot finish degeneration, upgrading to Full GC");
ShenandoahHeap::heap()->shenandoah_policy()->record_degenerated_upgrade_to_full();

ShenandoahMarkCompact full_gc;
ShenandoahFullGC full_gc;
full_gc.op_full(GCCause::_shenandoah_upgrade_to_full_gc);
}

void ShenandoahDegenGC::op_degenerated_futile() {
ShenandoahHeap::heap()->shenandoah_policy()->record_degenerated_upgrade_to_full();
ShenandoahMarkCompact full_gc;
ShenandoahFullGC full_gc;
full_gc.op_full(GCCause::_shenandoah_upgrade_to_full_gc);
}

@@ -31,9 +31,9 @@
#include "gc/shenandoah/shenandoahConcurrentGC.hpp"
#include "gc/shenandoah/shenandoahCollectionSet.hpp"
#include "gc/shenandoah/shenandoahFreeSet.hpp"
#include "gc/shenandoah/shenandoahFullGC.hpp"
#include "gc/shenandoah/shenandoahPhaseTimings.hpp"
#include "gc/shenandoah/shenandoahMark.inline.hpp"
#include "gc/shenandoah/shenandoahMarkCompact.hpp"
#include "gc/shenandoah/shenandoahMonitoringSupport.hpp"
#include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
@@ -61,17 +61,17 @@
#include "utilities/growableArray.hpp"
#include "gc/shared/workgroup.hpp"

ShenandoahMarkCompact::ShenandoahMarkCompact() :
ShenandoahFullGC::ShenandoahFullGC() :
_gc_timer(ShenandoahHeap::heap()->gc_timer()),
_preserved_marks(new PreservedMarksSet(true)) {}

bool ShenandoahMarkCompact::collect(GCCause::Cause cause) {
bool ShenandoahFullGC::collect(GCCause::Cause cause) {
vmop_entry_full(cause);
// Always success
return true;
}

void ShenandoahMarkCompact::vmop_entry_full(GCCause::Cause cause) {
void ShenandoahFullGC::vmop_entry_full(GCCause::Cause cause) {
ShenandoahHeap* const heap = ShenandoahHeap::heap();
TraceCollectorStats tcs(heap->monitoring_support()->full_stw_collection_counters());
ShenandoahTimingsTracker timing(ShenandoahPhaseTimings::full_gc_gross);
@@ -81,7 +81,7 @@ void ShenandoahMarkCompact::vmop_entry_full(GCCause::Cause cause) {
VMThread::execute(&op);
}

void ShenandoahMarkCompact::entry_full(GCCause::Cause cause) {
void ShenandoahFullGC::entry_full(GCCause::Cause cause) {
static const char* msg = "Pause Full";
ShenandoahPausePhase gc_phase(msg, ShenandoahPhaseTimings::full_gc, true /* log_heap_usage */);
EventMark em("%s", msg);
@@ -93,7 +93,7 @@ void ShenandoahMarkCompact::entry_full(GCCause::Cause cause) {
op_full(cause);
}

void ShenandoahMarkCompact::op_full(GCCause::Cause cause) {
void ShenandoahFullGC::op_full(GCCause::Cause cause) {
ShenandoahMetricsSnapshot metrics;
metrics.snap_before();

@@ -111,7 +111,7 @@ void ShenandoahMarkCompact::op_full(GCCause::Cause cause) {
}
}

void ShenandoahMarkCompact::do_it(GCCause::Cause gc_cause) {
void ShenandoahFullGC::do_it(GCCause::Cause gc_cause) {
ShenandoahHeap* heap = ShenandoahHeap::heap();

if (ShenandoahVerify) {
@@ -275,7 +275,7 @@ class ShenandoahPrepareForMarkClosure: public ShenandoahHeapRegionClosure {
}
};

void ShenandoahMarkCompact::phase1_mark_heap() {
void ShenandoahFullGC::phase1_mark_heap() {
GCTraceTime(Info, gc, phases) time("Phase 1: Mark live objects", _gc_timer);
ShenandoahGCPhase mark_phase(ShenandoahPhaseTimings::full_gc_mark);

@@ -435,7 +435,7 @@ class ShenandoahPrepareForCompactionTask : public AbstractGangTask {
}
};

void ShenandoahMarkCompact::calculate_target_humongous_objects() {
void ShenandoahFullGC::calculate_target_humongous_objects() {
ShenandoahHeap* heap = ShenandoahHeap::heap();

// Compute the new addresses for humongous objects. We need to do this after addresses
@@ -540,7 +540,7 @@ class ShenandoahTrashImmediateGarbageClosure: public ShenandoahHeapRegionClosure
}
};

void ShenandoahMarkCompact::distribute_slices(ShenandoahHeapRegionSet** worker_slices) {
void ShenandoahFullGC::distribute_slices(ShenandoahHeapRegionSet** worker_slices) {
ShenandoahHeap* heap = ShenandoahHeap::heap();

uint n_workers = heap->workers()->active_workers();
@@ -682,7 +682,7 @@ void ShenandoahMarkCompact::distribute_slices(ShenandoahHeapRegionSet** worker_s
#endif
}

void ShenandoahMarkCompact::phase2_calculate_target_addresses(ShenandoahHeapRegionSet** worker_slices) {
void ShenandoahFullGC::phase2_calculate_target_addresses(ShenandoahHeapRegionSet** worker_slices) {
GCTraceTime(Info, gc, phases) time("Phase 2: Compute new object addresses", _gc_timer);
ShenandoahGCPhase calculate_address_phase(ShenandoahPhaseTimings::full_gc_calculate_addresses);

@@ -804,7 +804,7 @@ class ShenandoahAdjustRootPointersTask : public AbstractGangTask {
}
};

void ShenandoahMarkCompact::phase3_update_references() {
void ShenandoahFullGC::phase3_update_references() {
GCTraceTime(Info, gc, phases) time("Phase 3: Adjust pointers", _gc_timer);
ShenandoahGCPhase adjust_pointer_phase(ShenandoahPhaseTimings::full_gc_adjust_pointers);

@@ -929,7 +929,7 @@ class ShenandoahPostCompactClosure : public ShenandoahHeapRegionClosure {
}
};

void ShenandoahMarkCompact::compact_humongous_objects() {
void ShenandoahFullGC::compact_humongous_objects() {
// Compact humongous regions, based on their fwdptr objects.
//
// This code is serial, because doing the in-slice parallel sliding is tricky. In most cases,
@@ -1023,7 +1023,7 @@ class ShenandoahMCResetCompleteBitmapTask : public AbstractGangTask {
}
};

void ShenandoahMarkCompact::phase4_compact_objects(ShenandoahHeapRegionSet** worker_slices) {
void ShenandoahFullGC::phase4_compact_objects(ShenandoahHeapRegionSet** worker_slices) {
GCTraceTime(Info, gc, phases) time("Phase 4: Move objects", _gc_timer);
ShenandoahGCPhase compaction_phase(ShenandoahPhaseTimings::full_gc_copy_objects);

@@ -22,8 +22,8 @@
*
*/

#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHMARKCOMPACT_HPP
#define SHARE_GC_SHENANDOAH_SHENANDOAHMARKCOMPACT_HPP
#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHFULLGC_HPP
#define SHARE_GC_SHENANDOAH_SHENANDOAHFULLGC_HPP

#include "gc/shared/gcTimer.hpp"
#include "gc/shenandoah/shenandoahGC.hpp"
@@ -56,7 +56,7 @@ class PreservedMarksSet;
class VM_ShenandoahFullGC;
class ShenandoahDegenGC;

class ShenandoahMarkCompact : public ShenandoahGC {
class ShenandoahFullGC : public ShenandoahGC {
friend class ShenandoahPrepareForCompactionObjectClosure;
friend class VM_ShenandoahFullGC;
friend class ShenandoahDegenGC;
@@ -67,7 +67,7 @@ class ShenandoahMarkCompact : public ShenandoahGC {
PreservedMarksSet* _preserved_marks;

public:
ShenandoahMarkCompact();
ShenandoahFullGC();
bool collect(GCCause::Cause cause);

private:
@@ -88,4 +88,4 @@ class ShenandoahMarkCompact : public ShenandoahGC {
void compact_humongous_objects();
};

#endif // SHARE_GC_SHENANDOAH_SHENANDOAHMARKCOMPACT_HPP
#endif // SHARE_GC_SHENANDOAH_SHENANDOAHFULLGC_HPP
@@ -46,7 +46,6 @@
#include "gc/shenandoah/shenandoahHeapRegion.inline.hpp"
#include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
#include "gc/shenandoah/shenandoahInitLogger.hpp"
#include "gc/shenandoah/shenandoahMarkCompact.hpp"
#include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
#include "gc/shenandoah/shenandoahMemoryPool.hpp"
#include "gc/shenandoah/shenandoahMetrics.hpp"
@@ -56,7 +56,7 @@ class ShenandoahHeapRegionClosure;
class ShenandoahCollectionSet;
class ShenandoahFreeSet;
class ShenandoahConcurrentMark;
class ShenandoahMarkCompact;
class ShenandoahFullGC;
class ShenandoahMonitoringSupport;
class ShenandoahPacer;
class ShenandoahReferenceProcessor;
@@ -125,7 +125,7 @@ class ShenandoahHeap : public CollectedHeap {
// Supported GC
friend class ShenandoahConcurrentGC;
friend class ShenandoahDegenGC;
friend class ShenandoahMarkCompact;
friend class ShenandoahFullGC;

// ---------- Locks that guard important data structures in Heap
//
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019, Red Hat, Inc. All rights reserved.
* Copyright (c) 2017, 2021, Red Hat, Inc. 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
@@ -29,7 +29,6 @@
#include "gc/shared/gcTrace.hpp"
#include "gc/shared/gcWhen.hpp"
#include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
#include "gc/shenandoah/shenandoahMarkCompact.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahUtils.hpp"
#include "gc/shenandoah/heuristics/shenandoahHeuristics.hpp"
@@ -26,9 +26,9 @@

#include "gc/shenandoah/shenandoahConcurrentGC.hpp"
#include "gc/shenandoah/shenandoahDegeneratedGC.hpp"
#include "gc/shenandoah/shenandoahFullGC.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahMark.inline.hpp"
#include "gc/shenandoah/shenandoahMarkCompact.hpp"
#include "gc/shenandoah/shenandoahOopClosures.inline.hpp"
#include "gc/shenandoah/shenandoahUtils.hpp"
#include "gc/shenandoah/shenandoahVMOperations.hpp"
@@ -29,7 +29,7 @@

class ShenandoahConcurrentGC;
class ShenandoahDegenGC;
class ShenandoahMarkCompact;
class ShenandoahFullGC;

// VM_operations for the Shenandoah Collector.
//
@@ -95,10 +95,10 @@ class VM_ShenandoahDegeneratedGC: public VM_ShenandoahReferenceOperation {

class VM_ShenandoahFullGC : public VM_ShenandoahReferenceOperation {
private:
GCCause::Cause _gc_cause;
ShenandoahMarkCompact* const _full_gc;
GCCause::Cause _gc_cause;
ShenandoahFullGC* const _full_gc;
public:
VM_ShenandoahFullGC(GCCause::Cause gc_cause, ShenandoahMarkCompact* full_gc) :
VM_ShenandoahFullGC(GCCause::Cause gc_cause, ShenandoahFullGC* full_gc) :
VM_ShenandoahReferenceOperation(),
_gc_cause(gc_cause),
_full_gc(full_gc) {};

0 comments on commit e963ebd

Please sign in to comment.