Skip to content

Commit 58ef9e4

Browse files
author
Thomas Schatzl
committed
8331402: G1: Remove is_active() calls in G1HRPrinter logging
Reviewed-by: iwalulya, ayang, gli
1 parent 3c77dad commit 58ef9e4

File tree

1 file changed

+12
-62
lines changed

1 file changed

+12
-62
lines changed

src/hotspot/share/gc/g1/g1HRPrinter.hpp

Lines changed: 12 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class FreeRegionList;
3333

3434
class G1HRPrinter : public AllStatic {
3535

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

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

56-
static void alloc(HeapRegion* hr, bool force = false) {
57-
if (is_active()) {
58-
print((force) ? "ALLOC-FORCE" : "ALLOC", hr);
59-
}
60-
}
54+
static void alloc(HeapRegion* hr, bool force = false) { print(force ? "ALLOC-FORCE" : "ALLOC", hr); }
6155

62-
static void retire(HeapRegion* hr) {
63-
if (is_active()) {
64-
print("RETIRE", hr);
65-
}
66-
}
56+
static void retire(HeapRegion* hr) { print("RETIRE", hr); }
6757

68-
static void reuse(HeapRegion* hr) {
69-
if (is_active()) {
70-
print("REUSE", hr);
71-
}
72-
}
58+
static void reuse(HeapRegion* hr) { print("REUSE", hr); }
7359

74-
static void cset(HeapRegion* hr) {
75-
if (is_active()) {
76-
print("CSET", hr);
77-
}
78-
}
60+
static void cset(HeapRegion* hr) { print("CSET", hr); }
7961

80-
static void evac_failure(HeapRegion* hr) {
81-
if (is_active()) {
82-
print("EVAC-FAILURE", hr);
83-
}
84-
}
62+
static void evac_failure(HeapRegion* hr) { print("EVAC-FAILURE", hr); }
8563

8664
static void mark_reclaim(FreeRegionList* free_list);
8765

88-
static void eager_reclaim(HeapRegion* hr) {
89-
if (is_active()) {
90-
print("EAGER-RECLAIM", hr);
91-
}
92-
}
66+
static void eager_reclaim(HeapRegion* hr) { print("EAGER-RECLAIM", hr); }
9367

94-
static void evac_reclaim(HeapRegion* hr) {
95-
if (is_active()) {
96-
print("EVAC-RECLAIM", hr);
97-
}
98-
}
68+
static void evac_reclaim(HeapRegion* hr) { print("EVAC-RECLAIM", hr); }
9969

100-
static void post_compaction(HeapRegion* hr) {
101-
if (is_active()) {
102-
print("POST-COMPACTION", hr);
103-
}
104-
}
70+
static void post_compaction(HeapRegion* hr) { print("POST-COMPACTION", hr); }
10571

106-
static void commit(HeapRegion* hr) {
107-
if (is_active()) {
108-
print("COMMIT", hr);
109-
}
110-
}
72+
static void commit(HeapRegion* hr) { print("COMMIT", hr); }
11173

112-
static void active(HeapRegion* hr) {
113-
if (is_active()) {
114-
print("ACTIVE", hr);
115-
}
116-
}
74+
static void active(HeapRegion* hr) { print("ACTIVE", hr); }
11775

118-
static void inactive(HeapRegion* hr) {
119-
if (is_active()) {
120-
print("INACTIVE", hr);
121-
}
122-
}
76+
static void inactive(HeapRegion* hr) { print("INACTIVE", hr); }
12377

124-
static void uncommit(HeapRegion* hr) {
125-
if (is_active()) {
126-
print("UNCOMMIT", hr);
127-
}
128-
}
78+
static void uncommit(HeapRegion* hr) { print("UNCOMMIT", hr); }
12979
};
13080

13181
#endif // SHARE_GC_G1_G1HRPRINTER_HPP

0 commit comments

Comments
 (0)