116 HeapWord* obj, size_t size, |
119 HeapWord* obj, size_t size, |
117 int length); |
120 int length); |
118 |
121 |
119 // Clears an allocated object. |
122 // Clears an allocated object. |
120 inline static void init_obj(HeapWord* obj, size_t size); |
123 inline static void init_obj(HeapWord* obj, size_t size); |
|
124 |
|
125 // Filler object utilities. |
|
126 static inline size_t filler_array_hdr_size(); |
|
127 static inline size_t filler_array_min_size(); |
|
128 static inline size_t filler_array_max_size(); |
|
129 |
|
130 DEBUG_ONLY(static void fill_args_check(HeapWord* start, size_t words);) |
|
131 DEBUG_ONLY(static void zap_filler_array(HeapWord* start, size_t words);) |
|
132 |
|
133 // Fill with a single array; caller must ensure filler_array_min_size() <= |
|
134 // words <= filler_array_max_size(). |
|
135 static inline void fill_with_array(HeapWord* start, size_t words); |
|
136 |
|
137 // Fill with a single object (either an int array or a java.lang.Object). |
|
138 static inline void fill_with_object_impl(HeapWord* start, size_t words); |
121 |
139 |
122 // Verification functions |
140 // Verification functions |
123 virtual void check_for_bad_heap_word_value(HeapWord* addr, size_t size) |
141 virtual void check_for_bad_heap_word_value(HeapWord* addr, size_t size) |
124 PRODUCT_RETURN; |
142 PRODUCT_RETURN; |
125 virtual void check_for_non_bad_heap_word_value(HeapWord* addr, size_t size) |
143 virtual void check_for_non_bad_heap_word_value(HeapWord* addr, size_t size) |
292 virtual HeapWord* permanent_mem_allocate(size_t size) = 0; |
310 virtual HeapWord* permanent_mem_allocate(size_t size) = 0; |
293 |
311 |
294 // The boundary between a "large" and "small" array of primitives, in words. |
312 // The boundary between a "large" and "small" array of primitives, in words. |
295 virtual size_t large_typearray_limit() = 0; |
313 virtual size_t large_typearray_limit() = 0; |
296 |
314 |
|
315 // Utilities for turning raw memory into filler objects. |
|
316 // |
|
317 // min_fill_size() is the smallest region that can be filled. |
|
318 // fill_with_objects() can fill arbitrary-sized regions of the heap using |
|
319 // multiple objects. fill_with_object() is for regions known to be smaller |
|
320 // than the largest array of integers; it uses a single object to fill the |
|
321 // region and has slightly less overhead. |
|
322 static size_t min_fill_size() { |
|
323 return size_t(align_object_size(oopDesc::header_size())); |
|
324 } |
|
325 |
|
326 static void fill_with_objects(HeapWord* start, size_t words); |
|
327 |
|
328 static void fill_with_object(HeapWord* start, size_t words); |
|
329 static void fill_with_object(MemRegion region) { |
|
330 fill_with_object(region.start(), region.word_size()); |
|
331 } |
|
332 static void fill_with_object(HeapWord* start, HeapWord* end) { |
|
333 fill_with_object(start, pointer_delta(end, start)); |
|
334 } |
|
335 |
297 // Some heaps may offer a contiguous region for shared non-blocking |
336 // Some heaps may offer a contiguous region for shared non-blocking |
298 // allocation, via inlined code (by exporting the address of the top and |
337 // allocation, via inlined code (by exporting the address of the top and |
299 // end fields defining the extent of the contiguous allocation region.) |
338 // end fields defining the extent of the contiguous allocation region.) |
300 |
339 |
301 // This function returns "true" iff the heap supports this kind of |
340 // This function returns "true" iff the heap supports this kind of |