292 // min_fill_size() is the smallest region that can be filled.
293 // fill_with_objects() can fill arbitrary-sized regions of the heap using
294 // multiple objects. fill_with_object() is for regions known to be smaller
295 // than the largest array of integers; it uses a single object to fill the
296 // region and has slightly less overhead.
297 static size_t min_fill_size() {
298 return size_t(align_object_size(oopDesc::header_size()));
299 }
300
301 static void fill_with_objects(HeapWord* start, size_t words, bool zap = true);
302
303 static void fill_with_object(HeapWord* start, size_t words, bool zap = true);
304 static void fill_with_object(MemRegion region, bool zap = true) {
305 fill_with_object(region.start(), region.word_size(), zap);
306 }
307 static void fill_with_object(HeapWord* start, HeapWord* end, bool zap = true) {
308 fill_with_object(start, pointer_delta(end, start), zap);
309 }
310
311 virtual void fill_with_dummy_object(HeapWord* start, HeapWord* end, bool zap);
312
313 // Return the address "addr" aligned by "alignment_in_bytes" if such
314 // an address is below "end". Return NULL otherwise.
315 inline static HeapWord* align_allocation_or_fail(HeapWord* addr,
316 HeapWord* end,
317 unsigned short alignment_in_bytes);
318
319 // Some heaps may offer a contiguous region for shared non-blocking
320 // allocation, via inlined code (by exporting the address of the top and
321 // end fields defining the extent of the contiguous allocation region.)
322
323 // This function returns "true" iff the heap supports this kind of
324 // allocation. (Default is "no".)
325 virtual bool supports_inline_contig_alloc() const {
326 return false;
327 }
328 // These functions return the addresses of the fields that define the
329 // boundaries of the contiguous allocation area. (These fields should be
330 // physically near to one another.)
331 virtual HeapWord* volatile* top_addr() const {
|
292 // min_fill_size() is the smallest region that can be filled.
293 // fill_with_objects() can fill arbitrary-sized regions of the heap using
294 // multiple objects. fill_with_object() is for regions known to be smaller
295 // than the largest array of integers; it uses a single object to fill the
296 // region and has slightly less overhead.
297 static size_t min_fill_size() {
298 return size_t(align_object_size(oopDesc::header_size()));
299 }
300
301 static void fill_with_objects(HeapWord* start, size_t words, bool zap = true);
302
303 static void fill_with_object(HeapWord* start, size_t words, bool zap = true);
304 static void fill_with_object(MemRegion region, bool zap = true) {
305 fill_with_object(region.start(), region.word_size(), zap);
306 }
307 static void fill_with_object(HeapWord* start, HeapWord* end, bool zap = true) {
308 fill_with_object(start, pointer_delta(end, start), zap);
309 }
310
311 virtual void fill_with_dummy_object(HeapWord* start, HeapWord* end, bool zap);
312 virtual size_t min_dummy_object_word_size() const;
313 size_t tlab_alloc_reserve() const;
314
315 // Return the address "addr" aligned by "alignment_in_bytes" if such
316 // an address is below "end". Return NULL otherwise.
317 inline static HeapWord* align_allocation_or_fail(HeapWord* addr,
318 HeapWord* end,
319 unsigned short alignment_in_bytes);
320
321 // Some heaps may offer a contiguous region for shared non-blocking
322 // allocation, via inlined code (by exporting the address of the top and
323 // end fields defining the extent of the contiguous allocation region.)
324
325 // This function returns "true" iff the heap supports this kind of
326 // allocation. (Default is "no".)
327 virtual bool supports_inline_contig_alloc() const {
328 return false;
329 }
330 // These functions return the addresses of the fields that define the
331 // boundaries of the contiguous allocation area. (These fields should be
332 // physically near to one another.)
333 virtual HeapWord* volatile* top_addr() const {
|