@@ -76,6 +76,8 @@ class SerialHeap : public CollectedHeap {
7676private:
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+
116135public:
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