Skip to content

8361349: Fix visibility of CollectedHeap::stop() and ::print_tracing_info() #26160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/hotspot/share/gc/epsilon/epsilonHeap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ class EpsilonHeap : public CollectedHeap {
volatile size_t _last_counter_update;
volatile size_t _last_heap_print;

void print_tracing_info() const override;
void stop() override {};

public:
static EpsilonHeap* heap();

Expand All @@ -67,8 +70,6 @@ class EpsilonHeap : public CollectedHeap {
jint initialize() override;
void initialize_serviceability() override;

void stop() override {};

GrowableArray<GCMemoryManager*> memory_managers() override;
GrowableArray<MemoryPool*> memory_pools() override;

Expand Down Expand Up @@ -130,7 +131,6 @@ class EpsilonHeap : public CollectedHeap {

void print_heap_on(outputStream* st) const override;
void print_gc_on(outputStream* st) const override {}
void print_tracing_info() const override;
bool print_location(outputStream* st, void* addr) const override;

private:
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/share/gc/g1/g1CollectedHeap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,10 @@ class G1CollectedHeap : public CollectedHeap {
private:
jint initialize_concurrent_refinement();
jint initialize_service_thread();

void print_tracing_info() const override;
void stop() override;

public:
// Initialize the G1CollectedHeap to have the initial and
// maximum sizes and remembered and barrier sets
Expand All @@ -891,7 +895,6 @@ class G1CollectedHeap : public CollectedHeap {
// Returns whether concurrent mark threads (and the VM) are about to terminate.
bool concurrent_mark_is_terminating() const;

void stop() override;
void safepoint_synchronize_begin() override;
void safepoint_synchronize_end() override;

Expand Down Expand Up @@ -1309,9 +1312,6 @@ class G1CollectedHeap : public CollectedHeap {

void gc_threads_do(ThreadClosure* tc) const override;

// Override
void print_tracing_info() const override;

// Used to print information about locations in the hs_err file.
bool print_location(outputStream* st, void* addr) const override;
};
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ class ParallelScavengeHeap : public CollectedHeap {

void do_full_collection(bool clear_all_soft_refs) override;

void print_tracing_info() const override;
void stop() override {};

public:
ParallelScavengeHeap() :
CollectedHeap(),
Expand Down Expand Up @@ -155,8 +158,6 @@ class ParallelScavengeHeap : public CollectedHeap {
void post_initialize() override;
void update_counters();

void stop() override {};

size_t capacity() const override;
size_t used() const override;

Expand Down Expand Up @@ -214,7 +215,6 @@ class ParallelScavengeHeap : public CollectedHeap {
void print_heap_on(outputStream* st) const override;
void print_gc_on(outputStream* st) const override;
void gc_threads_do(ThreadClosure* tc) const override;
void print_tracing_info() const override;

WorkerThreads* safepoint_workers() override { return &_workers; }

Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/gc/serial/serialHeap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,16 @@ class SerialHeap : public CollectedHeap {
void gc_prologue();
void gc_epilogue(bool full);

void print_tracing_info() const override;
void stop() override {};

public:
// Returns JNI_OK on success
jint initialize() override;

// Does operations required after initialization has been done.
void post_initialize() override;

void stop() override {};

bool is_in_reserved(const void* addr) const { return _reserved.contains(addr); }

// Performance Counter support
Expand Down Expand Up @@ -211,7 +212,6 @@ class SerialHeap : public CollectedHeap {
void print_heap_on(outputStream* st) const override;
void print_gc_on(outputStream* st) const override;
void gc_threads_do(ThreadClosure* tc) const override;
void print_tracing_info() const override;

// Used to print information about locations in the hs_err file.
bool print_location(outputStream* st, void* addr) const override;
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/share/gc/shared/collectedHeap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ class CollectedHeap : public CHeapObj<mtGC> {
return static_cast<T*>(heap);
}

// Print any relevant tracing info that flags imply.
// Default implementation does nothing.
virtual void print_tracing_info() const = 0;

// Stop any onging concurrent work and prepare for exit.
virtual void stop() = 0;

Expand Down Expand Up @@ -459,10 +463,6 @@ class CollectedHeap : public CHeapObj<mtGC> {
// Iterator for all GC threads (other than VM thread)
virtual void gc_threads_do(ThreadClosure* tc) const = 0;

// Print any relevant tracing info that flags imply.
// Default implementation does nothing.
virtual void print_tracing_info() const = 0;

double elapsed_gc_cpu_time() const;

void print_before_gc() const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class ShenandoahGenerationalControlThread;
class ShenandoahAgeCensus;

class ShenandoahGenerationalHeap : public ShenandoahHeap {
void print_tracing_info() const override;
void stop() override;

public:
explicit ShenandoahGenerationalHeap(ShenandoahCollectorPolicy* policy);
void post_initialize() override;
Expand All @@ -53,7 +56,6 @@ class ShenandoahGenerationalHeap : public ShenandoahHeap {
}

void print_init_logger() const override;
void print_tracing_info() const override;

size_t unsafe_max_tlab_alloc(Thread *thread) const override;

Expand Down Expand Up @@ -126,8 +128,6 @@ class ShenandoahGenerationalHeap : public ShenandoahHeap {

void gc_threads_do(ThreadClosure* tcl) const override;

void stop() override;

bool requires_barriers(stackChunkOop obj) const override;

// Used for logging the result of a region transfer outside the heap lock
Expand Down
7 changes: 4 additions & 3 deletions src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ class ShenandoahHeap : public CollectedHeap {
// updated at each STW pause associated with a ShenandoahVMOp.
ShenandoahGeneration* _active_generation;

protected:
void print_tracing_info() const override;
void stop() override;

public:
ShenandoahHeapLock* lock() {
return &_lock;
Expand Down Expand Up @@ -204,11 +208,8 @@ class ShenandoahHeap : public CollectedHeap {

void print_heap_on(outputStream* st) const override;
void print_gc_on(outputStream *st) const override;
void print_tracing_info() const override;
void print_heap_regions_on(outputStream* st) const;

void stop() override;

void prepare_for_verify() override;
void verify(VerifyOption vo) override;

Expand Down
5 changes: 3 additions & 2 deletions src/hotspot/share/gc/z/zCollectedHeap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ class ZCollectedHeap : public CollectedHeap {
size_t requested_size,
size_t* actual_size) override;

void print_tracing_info() const override;
void stop() override;

public:
static ZCollectedHeap* heap();

Expand All @@ -63,7 +66,6 @@ class ZCollectedHeap : public CollectedHeap {
const char* name() const override;
jint initialize() override;
void initialize_serviceability() override;
void stop() override;

size_t max_capacity() const override;
size_t capacity() const override;
Expand Down Expand Up @@ -116,7 +118,6 @@ class ZCollectedHeap : public CollectedHeap {

void print_heap_on(outputStream* st) const override;
void print_gc_on(outputStream* st) const override;
void print_tracing_info() const override;
bool print_location(outputStream* st, void* addr) const override;

void prepare_for_verify() override;
Expand Down