203 virtual void post_heap_initialize() = 0;
204 };
205
206 class ClearedAllSoftRefs : public StackObj {
207 bool _clear_all_soft_refs;
208 CollectorPolicy* _collector_policy;
209 public:
210 ClearedAllSoftRefs(bool clear_all_soft_refs,
211 CollectorPolicy* collector_policy) :
212 _clear_all_soft_refs(clear_all_soft_refs),
213 _collector_policy(collector_policy) {}
214
215 ~ClearedAllSoftRefs() {
216 if (_clear_all_soft_refs) {
217 _collector_policy->cleared_all_soft_refs();
218 }
219 }
220 };
221
222 class GenCollectorPolicy : public CollectorPolicy {
223 protected:
224 size_t _min_gen0_size;
225 size_t _initial_gen0_size;
226 size_t _max_gen0_size;
227
228 // _gen_alignment and _space_alignment will have the same value most of the
229 // time. When using large pages they can differ.
230 size_t _gen_alignment;
231
232 GenerationSpec **_generations;
233
234 // Return true if an allocation should be attempted in the older generation
235 // if it fails in the younger generation. Return false, otherwise.
236 virtual bool should_try_older_generation_allocation(size_t word_size) const;
237
238 void initialize_flags();
239 void initialize_size_info();
240
241 DEBUG_ONLY(void assert_flags();)
242 DEBUG_ONLY(void assert_size_info();)
|
203 virtual void post_heap_initialize() = 0;
204 };
205
206 class ClearedAllSoftRefs : public StackObj {
207 bool _clear_all_soft_refs;
208 CollectorPolicy* _collector_policy;
209 public:
210 ClearedAllSoftRefs(bool clear_all_soft_refs,
211 CollectorPolicy* collector_policy) :
212 _clear_all_soft_refs(clear_all_soft_refs),
213 _collector_policy(collector_policy) {}
214
215 ~ClearedAllSoftRefs() {
216 if (_clear_all_soft_refs) {
217 _collector_policy->cleared_all_soft_refs();
218 }
219 }
220 };
221
222 class GenCollectorPolicy : public CollectorPolicy {
223 friend class TestGenCollectorPolicy;
224 protected:
225 size_t _min_gen0_size;
226 size_t _initial_gen0_size;
227 size_t _max_gen0_size;
228
229 // _gen_alignment and _space_alignment will have the same value most of the
230 // time. When using large pages they can differ.
231 size_t _gen_alignment;
232
233 GenerationSpec **_generations;
234
235 // Return true if an allocation should be attempted in the older generation
236 // if it fails in the younger generation. Return false, otherwise.
237 virtual bool should_try_older_generation_allocation(size_t word_size) const;
238
239 void initialize_flags();
240 void initialize_size_info();
241
242 DEBUG_ONLY(void assert_flags();)
243 DEBUG_ONLY(void assert_size_info();)
|