Skip to content

Commit

Permalink
8331402: G1: Remove is_active() calls in G1HRPrinter logging
Browse files Browse the repository at this point in the history
Reviewed-by: iwalulya, ayang, gli
  • Loading branch information
Thomas Schatzl committed May 3, 2024
1 parent 3c77dad commit 58ef9e4
Showing 1 changed file with 12 additions and 62 deletions.
74 changes: 12 additions & 62 deletions src/hotspot/share/gc/g1/g1HRPrinter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class FreeRegionList;

class G1HRPrinter : public AllStatic {

private:

// Print an action event.
static void print(const char* action, HeapRegion* hr) {
log_trace(gc, region)("G1HR %s(%s) [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT "]",
Expand All @@ -53,79 +51,31 @@ class G1HRPrinter : public AllStatic {

// The methods below are convenient wrappers for the print() method.

static void alloc(HeapRegion* hr, bool force = false) {
if (is_active()) {
print((force) ? "ALLOC-FORCE" : "ALLOC", hr);
}
}
static void alloc(HeapRegion* hr, bool force = false) { print(force ? "ALLOC-FORCE" : "ALLOC", hr); }

static void retire(HeapRegion* hr) {
if (is_active()) {
print("RETIRE", hr);
}
}
static void retire(HeapRegion* hr) { print("RETIRE", hr); }

static void reuse(HeapRegion* hr) {
if (is_active()) {
print("REUSE", hr);
}
}
static void reuse(HeapRegion* hr) { print("REUSE", hr); }

static void cset(HeapRegion* hr) {
if (is_active()) {
print("CSET", hr);
}
}
static void cset(HeapRegion* hr) { print("CSET", hr); }

static void evac_failure(HeapRegion* hr) {
if (is_active()) {
print("EVAC-FAILURE", hr);
}
}
static void evac_failure(HeapRegion* hr) { print("EVAC-FAILURE", hr); }

static void mark_reclaim(FreeRegionList* free_list);

static void eager_reclaim(HeapRegion* hr) {
if (is_active()) {
print("EAGER-RECLAIM", hr);
}
}
static void eager_reclaim(HeapRegion* hr) { print("EAGER-RECLAIM", hr); }

static void evac_reclaim(HeapRegion* hr) {
if (is_active()) {
print("EVAC-RECLAIM", hr);
}
}
static void evac_reclaim(HeapRegion* hr) { print("EVAC-RECLAIM", hr); }

static void post_compaction(HeapRegion* hr) {
if (is_active()) {
print("POST-COMPACTION", hr);
}
}
static void post_compaction(HeapRegion* hr) { print("POST-COMPACTION", hr); }

static void commit(HeapRegion* hr) {
if (is_active()) {
print("COMMIT", hr);
}
}
static void commit(HeapRegion* hr) { print("COMMIT", hr); }

static void active(HeapRegion* hr) {
if (is_active()) {
print("ACTIVE", hr);
}
}
static void active(HeapRegion* hr) { print("ACTIVE", hr); }

static void inactive(HeapRegion* hr) {
if (is_active()) {
print("INACTIVE", hr);
}
}
static void inactive(HeapRegion* hr) { print("INACTIVE", hr); }

static void uncommit(HeapRegion* hr) {
if (is_active()) {
print("UNCOMMIT", hr);
}
}
static void uncommit(HeapRegion* hr) { print("UNCOMMIT", hr); }
};

#endif // SHARE_GC_G1_G1HRPRINTER_HPP

1 comment on commit 58ef9e4

@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.