227 bool supports_inline_contig_alloc() const { return true; }
228 HeapWord** top_addr() const;
229 HeapWord** end_addr() const;
230
231 // Thread-local allocation buffers
232 bool supports_tlab_allocation() const { return true; }
233 size_t tlab_capacity() const;
234 size_t unsafe_max_tlab_alloc() const;
235
236 // Grow the generation by the specified number of bytes.
237 // The size of bytes is assumed to be properly aligned.
238 // Return true if the expansion was successful.
239 bool expand(size_t bytes);
240
241 // DefNewGeneration cannot currently expand except at
242 // a GC.
243 virtual bool is_maximal_no_gc() const { return true; }
244
245 // Iteration
246 void object_iterate(ObjectClosure* blk);
247 void object_iterate_since_last_GC(ObjectClosure* cl);
248
249 void younger_refs_iterate(OopsInGenClosure* cl);
250
251 void space_iterate(SpaceClosure* blk, bool usedOnly = false);
252
253 // Allocation support
254 virtual bool should_allocate(size_t word_size, bool is_tlab) {
255 assert(UseTLAB || !is_tlab, "Should not allocate tlab");
256
257 size_t overflow_limit = (size_t)1 << (BitsPerSize_t - LogHeapWordSize);
258
259 const bool non_zero = word_size > 0;
260 const bool overflows = word_size >= overflow_limit;
261 const bool check_too_big = _pretenure_size_threshold_words > 0;
262 const bool not_too_big = word_size < _pretenure_size_threshold_words;
263 const bool size_ok = is_tlab || !check_too_big || not_too_big;
264
265 bool result = !overflows &&
266 non_zero &&
267 size_ok;
|
227 bool supports_inline_contig_alloc() const { return true; }
228 HeapWord** top_addr() const;
229 HeapWord** end_addr() const;
230
231 // Thread-local allocation buffers
232 bool supports_tlab_allocation() const { return true; }
233 size_t tlab_capacity() const;
234 size_t unsafe_max_tlab_alloc() const;
235
236 // Grow the generation by the specified number of bytes.
237 // The size of bytes is assumed to be properly aligned.
238 // Return true if the expansion was successful.
239 bool expand(size_t bytes);
240
241 // DefNewGeneration cannot currently expand except at
242 // a GC.
243 virtual bool is_maximal_no_gc() const { return true; }
244
245 // Iteration
246 void object_iterate(ObjectClosure* blk);
247
248 void younger_refs_iterate(OopsInGenClosure* cl);
249
250 void space_iterate(SpaceClosure* blk, bool usedOnly = false);
251
252 // Allocation support
253 virtual bool should_allocate(size_t word_size, bool is_tlab) {
254 assert(UseTLAB || !is_tlab, "Should not allocate tlab");
255
256 size_t overflow_limit = (size_t)1 << (BitsPerSize_t - LogHeapWordSize);
257
258 const bool non_zero = word_size > 0;
259 const bool overflows = word_size >= overflow_limit;
260 const bool check_too_big = _pretenure_size_threshold_words > 0;
261 const bool not_too_big = word_size < _pretenure_size_threshold_words;
262 const bool size_ok = is_tlab || !check_too_big || not_too_big;
263
264 bool result = !overflows &&
265 non_zero &&
266 size_ok;
|