Skip to content

Commit

Permalink
8260004: Shenandoah: Rename ShenandoahMarkCompact to ShenandoahFullGC
Browse files Browse the repository at this point in the history
Reviewed-by: shade, rkennke
  • Loading branch information
zhengyu123 committed Feb 1, 2021
1 parent df33595 commit e963ebd
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 34 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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();

Expand All @@ -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) {
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand All @@ -67,7 +67,7 @@ class ShenandoahMarkCompact : public ShenandoahGC {
PreservedMarksSet* _preserved_marks;

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

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

#endif // SHARE_GC_SHENANDOAH_SHENANDOAHMARKCOMPACT_HPP
#endif // SHARE_GC_SHENANDOAH_SHENANDOAHFULLGC_HPP
1 change: 0 additions & 1 deletion src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ShenandoahHeapRegionClosure;
class ShenandoahCollectionSet;
class ShenandoahFreeSet;
class ShenandoahConcurrentMark;
class ShenandoahMarkCompact;
class ShenandoahFullGC;
class ShenandoahMonitoringSupport;
class ShenandoahPacer;
class ShenandoahReferenceProcessor;
Expand Down Expand Up @@ -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
//
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/shenandoah/shenandoahVMOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/share/gc/shenandoah/shenandoahVMOperations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

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

// VM_operations for the Shenandoah Collector.
//
Expand Down Expand Up @@ -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) {};
Expand Down

0 comments on commit e963ebd

Please sign in to comment.