15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_GC_SERIAL_SERIALHEAP_HPP
26 #define SHARE_GC_SERIAL_SERIALHEAP_HPP
27
28 #include "gc/serial/defNewGeneration.hpp"
29 #include "gc/serial/tenuredGeneration.hpp"
30 #include "gc/shared/genCollectedHeap.hpp"
31 #include "utilities/growableArray.hpp"
32
33 class GCMemoryManager;
34 class MemoryPool;
35 class TenuredGeneration;
36
37 class SerialHeap : public GenCollectedHeap {
38 private:
39 MemoryPool* _eden_pool;
40 MemoryPool* _survivor_pool;
41 MemoryPool* _old_pool;
42
43 virtual void initialize_serviceability();
44
45 public:
46 static SerialHeap* heap();
47
48 SerialHeap();
49
50 virtual Name kind() const {
51 return CollectedHeap::Serial;
52 }
53
54 virtual const char* name() const {
58 virtual GrowableArray<GCMemoryManager*> memory_managers();
59 virtual GrowableArray<MemoryPool*> memory_pools();
60
61 DefNewGeneration* young_gen() const {
62 assert(_young_gen->kind() == Generation::DefNew, "Wrong generation type");
63 return static_cast<DefNewGeneration*>(_young_gen);
64 }
65
66 TenuredGeneration* old_gen() const {
67 assert(_old_gen->kind() == Generation::MarkSweepCompact, "Wrong generation type");
68 return static_cast<TenuredGeneration*>(_old_gen);
69 }
70
71 // Apply "cur->do_oop" or "older->do_oop" to all the oops in objects
72 // allocated since the last call to save_marks in the young generation.
73 // The "cur" closure is applied to references in the younger generation
74 // at "level", and the "older" closure to older generations.
75 template <typename OopClosureType1, typename OopClosureType2>
76 void oop_since_save_marks_iterate(OopClosureType1* cur,
77 OopClosureType2* older);
78 };
79
80 #endif // SHARE_GC_SERIAL_SERIALHEAP_HPP
|
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_GC_SERIAL_SERIALHEAP_HPP
26 #define SHARE_GC_SERIAL_SERIALHEAP_HPP
27
28 #include "gc/serial/defNewGeneration.hpp"
29 #include "gc/serial/tenuredGeneration.hpp"
30 #include "gc/shared/genCollectedHeap.hpp"
31 #include "utilities/growableArray.hpp"
32
33 class GCMemoryManager;
34 class MemoryPool;
35 class OopsInGenClosure;
36 class TenuredGeneration;
37
38 class SerialHeap : public GenCollectedHeap {
39 private:
40 MemoryPool* _eden_pool;
41 MemoryPool* _survivor_pool;
42 MemoryPool* _old_pool;
43
44 virtual void initialize_serviceability();
45
46 public:
47 static SerialHeap* heap();
48
49 SerialHeap();
50
51 virtual Name kind() const {
52 return CollectedHeap::Serial;
53 }
54
55 virtual const char* name() const {
59 virtual GrowableArray<GCMemoryManager*> memory_managers();
60 virtual GrowableArray<MemoryPool*> memory_pools();
61
62 DefNewGeneration* young_gen() const {
63 assert(_young_gen->kind() == Generation::DefNew, "Wrong generation type");
64 return static_cast<DefNewGeneration*>(_young_gen);
65 }
66
67 TenuredGeneration* old_gen() const {
68 assert(_old_gen->kind() == Generation::MarkSweepCompact, "Wrong generation type");
69 return static_cast<TenuredGeneration*>(_old_gen);
70 }
71
72 // Apply "cur->do_oop" or "older->do_oop" to all the oops in objects
73 // allocated since the last call to save_marks in the young generation.
74 // The "cur" closure is applied to references in the younger generation
75 // at "level", and the "older" closure to older generations.
76 template <typename OopClosureType1, typename OopClosureType2>
77 void oop_since_save_marks_iterate(OopClosureType1* cur,
78 OopClosureType2* older);
79
80 void young_process_roots(StrongRootsScope* scope,
81 OopsInGenClosure* root_closure,
82 OopsInGenClosure* old_gen_closure,
83 CLDClosure* cld_closure);
84 };
85
86 #endif // SHARE_GC_SERIAL_SERIALHEAP_HPP
|