34
34
#include " gc/serial/defNewGeneration.hpp"
35
35
#include " gc/serial/genMarkSweep.hpp"
36
36
#include " gc/serial/markSweep.hpp"
37
+ #include " gc/serial/tenuredGeneration.hpp"
37
38
#include " gc/shared/cardTableBarrierSet.hpp"
38
39
#include " gc/shared/collectedHeap.inline.hpp"
39
40
#include " gc/shared/collectorCounters.hpp"
47
48
#include " gc/shared/gcVMOperations.hpp"
48
49
#include " gc/shared/genArguments.hpp"
49
50
#include " gc/shared/genCollectedHeap.hpp"
50
- #include " gc/shared/generationSpec.hpp"
51
51
#include " gc/shared/locationPrinter.inline.hpp"
52
52
#include " gc/shared/oopStorage.inline.hpp"
53
53
#include " gc/shared/oopStorageParState.inline.hpp"
@@ -85,14 +85,6 @@ GenCollectedHeap::GenCollectedHeap(Generation::Name young,
85
85
CollectedHeap(),
86
86
_young_gen(nullptr ),
87
87
_old_gen(nullptr ),
88
- _young_gen_spec(new GenerationSpec(young,
89
- NewSize,
90
- MaxNewSize,
91
- GenAlignment)),
92
- _old_gen_spec(new GenerationSpec(old,
93
- OldSize,
94
- MaxOldSize,
95
- GenAlignment)),
96
88
_rem_set(nullptr ),
97
89
_soft_ref_policy(),
98
90
_gc_policy_counters(new GCPolicyCounters(policy_counters_name, 2 , 2 )),
@@ -115,8 +107,8 @@ jint GenCollectedHeap::initialize() {
115
107
116
108
initialize_reserved_region (heap_rs);
117
109
118
- ReservedSpace young_rs = heap_rs.first_part (_young_gen_spec-> max_size () );
119
- ReservedSpace old_rs = heap_rs.last_part (_young_gen_spec-> max_size () );
110
+ ReservedSpace young_rs = heap_rs.first_part (MaxNewSize );
111
+ ReservedSpace old_rs = heap_rs.last_part (MaxNewSize );
120
112
121
113
_rem_set = create_rem_set (heap_rs.region ());
122
114
_rem_set->initialize (young_rs.base (), old_rs.base ());
@@ -125,8 +117,8 @@ jint GenCollectedHeap::initialize() {
125
117
bs->initialize ();
126
118
BarrierSet::set_barrier_set (bs);
127
119
128
- _young_gen = _young_gen_spec-> init (young_rs, rem_set () );
129
- _old_gen = _old_gen_spec-> init (old_rs, rem_set ());
120
+ _young_gen = new DefNewGeneration (young_rs, NewSize, MinNewSize, MaxNewSize );
121
+ _old_gen = new TenuredGeneration (old_rs, OldSize, MinOldSize, MaxOldSize , rem_set ());
130
122
131
123
GCInitLogger::print ();
132
124
@@ -143,8 +135,8 @@ ReservedHeapSpace GenCollectedHeap::allocate(size_t alignment) {
143
135
assert (alignment % pageSize == 0 , " Must be" );
144
136
145
137
// Check for overflow.
146
- size_t total_reserved = _young_gen_spec-> max_size () + _old_gen_spec-> max_size () ;
147
- if (total_reserved < _young_gen_spec-> max_size () ) {
138
+ size_t total_reserved = MaxNewSize + MaxOldSize ;
139
+ if (total_reserved < MaxNewSize ) {
148
140
vm_exit_during_initialization (" The size of the object heap + VM data exceeds "
149
141
" the maximum representable size" );
150
142
}
@@ -199,14 +191,6 @@ PreGenGCValues GenCollectedHeap::get_pre_gc_values() const {
199
191
old_gen ()->capacity ());
200
192
}
201
193
202
- GenerationSpec* GenCollectedHeap::young_gen_spec () const {
203
- return _young_gen_spec;
204
- }
205
-
206
- GenerationSpec* GenCollectedHeap::old_gen_spec () const {
207
- return _old_gen_spec;
208
- }
209
-
210
194
size_t GenCollectedHeap::capacity () const {
211
195
return _young_gen->capacity () + _old_gen->capacity ();
212
196
}
0 commit comments