Skip to content

Commit 655e9cd

Browse files
committed
8373335: Serial: Clean up SerialHeap members by access specifies
Reviewed-by: jsikstro
1 parent b58e3b6 commit 655e9cd

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

src/hotspot/share/gc/serial/serialHeap.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,16 @@ SerialHeap::SerialHeap() :
9191
CollectedHeap(),
9292
_young_gen(nullptr),
9393
_old_gen(nullptr),
94+
_young_gen_saved_top(nullptr),
95+
_old_gen_saved_top(nullptr),
9496
_rem_set(nullptr),
9597
_gc_policy_counters(new GCPolicyCounters("Copy:MSC", 2, 2)),
9698
_young_manager(nullptr),
9799
_old_manager(nullptr),
98-
_is_heap_almost_full(false),
99100
_eden_pool(nullptr),
100101
_survivor_pool(nullptr),
101-
_old_pool(nullptr) {
102+
_old_pool(nullptr),
103+
_is_heap_almost_full(false) {
102104
_young_manager = new GCMemoryManager("Copy");
103105
_old_manager = new GCMemoryManager("MarkSweepCompact");
104106
GCLocker::initialize();

src/hotspot/share/gc/serial/serialHeap.hpp

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ class SerialHeap : public CollectedHeap {
7676
private:
7777
DefNewGeneration* _young_gen;
7878
TenuredGeneration* _old_gen;
79+
80+
// Used during young-gc
7981
HeapWord* _young_gen_saved_top;
8082
HeapWord* _old_gen_saved_top;
8183

@@ -94,6 +96,10 @@ class SerialHeap : public CollectedHeap {
9496
GCMemoryManager* _young_manager;
9597
GCMemoryManager* _old_manager;
9698

99+
MemoryPool* _eden_pool;
100+
MemoryPool* _survivor_pool;
101+
MemoryPool* _old_pool;
102+
97103
// Indicate whether heap is almost or approaching full.
98104
// Usually, there is some memory headroom for application/gc to run properly.
99105
// However, in extreme cases, e.g. young-gen is non-empty after a full gc, we
@@ -113,6 +119,19 @@ class SerialHeap : public CollectedHeap {
113119

114120
static void verify_not_in_native_if_java_thread() NOT_DEBUG_RETURN;
115121

122+
// Try to allocate space by expanding the heap.
123+
HeapWord* expand_heap_and_allocate(size_t size, bool is_tlab);
124+
125+
HeapWord* mem_allocate_cas_noexpand(size_t size, bool is_tlab);
126+
HeapWord* mem_allocate_work(size_t size, bool is_tlab);
127+
128+
void initialize_serviceability() override;
129+
130+
// Set the saved marks of generations, if that makes sense.
131+
// In particular, if any generation might iterate over the oops
132+
// in other generations, it should call this method.
133+
void save_marks();
134+
116135
public:
117136
// Returns JNI_OK on success
118137
jint initialize() override;
@@ -211,26 +230,6 @@ class SerialHeap : public CollectedHeap {
211230
// generations in a fully generational heap.
212231
CardTableRS* rem_set() { return _rem_set; }
213232

214-
public:
215-
// Set the saved marks of generations, if that makes sense.
216-
// In particular, if any generation might iterate over the oops
217-
// in other generations, it should call this method.
218-
void save_marks();
219-
220-
private:
221-
// Try to allocate space by expanding the heap.
222-
HeapWord* expand_heap_and_allocate(size_t size, bool is_tlab);
223-
224-
HeapWord* mem_allocate_cas_noexpand(size_t size, bool is_tlab);
225-
HeapWord* mem_allocate_work(size_t size, bool is_tlab);
226-
227-
MemoryPool* _eden_pool;
228-
MemoryPool* _survivor_pool;
229-
MemoryPool* _old_pool;
230-
231-
void initialize_serviceability() override;
232-
233-
public:
234233
static SerialHeap* heap();
235234

236235
SerialHeap();

0 commit comments

Comments
 (0)