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