Skip to content

Commit

Permalink
8256955: Move includes of events.hpp out of header files
Browse files Browse the repository at this point in the history
Reviewed-by: kbarrett, coleenp
  • Loading branch information
stefank committed Jan 14, 2021
1 parent 8b8b1f9 commit 3462f7a
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 27 deletions.
1 change: 1 addition & 0 deletions src/hotspot/share/classfile/classLoaderDataGraph.cpp
Expand Up @@ -45,6 +45,7 @@
#include "utilities/growableArray.hpp"
#include "utilities/macros.hpp"
#include "utilities/ostream.hpp"
#include "utilities/vmError.hpp"

volatile size_t ClassLoaderDataGraph::_num_array_classes = 0;
volatile size_t ClassLoaderDataGraph::_num_instance_classes = 0;
Expand Down
21 changes: 21 additions & 0 deletions src/hotspot/share/gc/shared/collectedHeap.cpp
Expand Up @@ -52,17 +52,38 @@
#include "services/heapDumper.hpp"
#include "utilities/align.hpp"
#include "utilities/copy.hpp"
#include "utilities/events.hpp"

class ClassLoaderData;

size_t CollectedHeap::_filler_array_max_size = 0;

class GCMessage : public FormatBuffer<1024> {
public:
bool is_before;
};

template <>
void EventLogBase<GCMessage>::print(outputStream* st, GCMessage& m) {
st->print_cr("GC heap %s", m.is_before ? "before" : "after");
st->print_raw(m);
}

class GCHeapLog : public EventLogBase<GCMessage> {
private:
void log_heap(CollectedHeap* heap, bool before);

public:
GCHeapLog() : EventLogBase<GCMessage>("GC Heap History", "gc") {}

void log_heap_before(CollectedHeap* heap) {
log_heap(heap, true);
}
void log_heap_after(CollectedHeap* heap) {
log_heap(heap, false);
}
};

void GCHeapLog::log_heap(CollectedHeap* heap, bool before) {
if (!should_log()) {
return;
Expand Down
27 changes: 1 addition & 26 deletions src/hotspot/share/gc/shared/collectedHeap.hpp
Expand Up @@ -36,7 +36,6 @@
#include "runtime/safepoint.hpp"
#include "services/memoryUsage.hpp"
#include "utilities/debug.hpp"
#include "utilities/events.hpp"
#include "utilities/formatBuffer.hpp"
#include "utilities/growableArray.hpp"

Expand All @@ -48,6 +47,7 @@
class AbstractGangTask;
class AdaptiveSizePolicy;
class BarrierSet;
class GCHeapLog;
class GCHeapSummary;
class GCTimer;
class GCTracer;
Expand All @@ -62,31 +62,6 @@ class VirtualSpaceSummary;
class WorkGang;
class nmethod;

class GCMessage : public FormatBuffer<1024> {
public:
bool is_before;

public:
GCMessage() {}
};

class CollectedHeap;

class GCHeapLog : public EventLogBase<GCMessage> {
private:
void log_heap(CollectedHeap* heap, bool before);

public:
GCHeapLog() : EventLogBase<GCMessage>("GC Heap History", "gc") {}

void log_heap_before(CollectedHeap* heap) {
log_heap(heap, true);
}
void log_heap_after(CollectedHeap* heap) {
log_heap(heap, false);
}
};

class ParallelObjectIterator : public CHeapObj<mtGC> {
public:
virtual void object_iterate(ObjectClosure* cl, uint worker_id) = 0;
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
Expand Up @@ -85,6 +85,7 @@
#include "runtime/vmThread.hpp"
#include "services/mallocTracker.hpp"
#include "services/memTracker.hpp"
#include "utilities/events.hpp"
#include "utilities/powerOfTwo.hpp"

class ShenandoahPretouchHeapTask : public AbstractGangTask {
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/jvmci/jvmci.cpp
Expand Up @@ -33,6 +33,7 @@
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "runtime/arguments.hpp"
#include "utilities/events.hpp"

JVMCIRuntime* JVMCI::_compiler_runtime = NULL;
JVMCIRuntime* JVMCI::_java_runtime = NULL;
Expand Down
6 changes: 5 additions & 1 deletion src/hotspot/share/jvmci/jvmci.hpp
Expand Up @@ -26,7 +26,6 @@

#include "compiler/compiler_globals.hpp"
#include "compiler/compilerDefinitions.hpp"
#include "utilities/events.hpp"
#include "utilities/exceptions.hpp"

class BoolObjectClosure;
Expand All @@ -39,6 +38,11 @@ class MetadataHandleBlock;
class OopClosure;
class OopStorage;

template <size_t>
class FormatStringEventLog;

typedef FormatStringEventLog<256> StringEventLog;

struct _jmetadata;
typedef struct _jmetadata *jmetadata;

Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/runtime/vmStructs.cpp
Expand Up @@ -103,6 +103,7 @@
#include "utilities/globalDefinitions.hpp"
#include "utilities/hashtable.hpp"
#include "utilities/macros.hpp"
#include "utilities/vmError.hpp"

#include CPU_HEADER(vmStructs)
#include OS_HEADER(vmStructs)
Expand Down

1 comment on commit 3462f7a

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.