248 // memory that the vm could make available for storing 'normal' java objects.
249 // This is based on the reserved address space, but should not include space
250 // that the vm uses internally for bookkeeping or temporary storage
251 // (e.g., in the case of the young gen, one of the survivor
252 // spaces).
253 virtual size_t max_capacity() const = 0;
254
255 // Returns "TRUE" iff "p" points into the committed areas of the heap.
256 // This method can be expensive so avoid using it in performance critical
257 // code.
258 virtual bool is_in(const void* p) const = 0;
259
260 DEBUG_ONLY(bool is_in_or_null(const void* p) const { return p == NULL || is_in(p); })
261
262 virtual uint32_t hash_oop(oop obj) const;
263
264 void set_gc_cause(GCCause::Cause v);
265 GCCause::Cause gc_cause() { return _gc_cause; }
266
267 oop obj_allocate(Klass* klass, size_t size, TRAPS);
268 virtual oop array_allocate(Klass* klass, size_t size, int length, bool do_zero, TRAPS);
269 oop class_allocate(Klass* klass, size_t size, TRAPS);
270
271 // Utilities for turning raw memory into filler objects.
272 //
273 // min_fill_size() is the smallest region that can be filled.
274 // fill_with_objects() can fill arbitrary-sized regions of the heap using
275 // multiple objects. fill_with_object() is for regions known to be smaller
276 // than the largest array of integers; it uses a single object to fill the
277 // region and has slightly less overhead.
278 static size_t min_fill_size() {
279 return size_t(align_object_size(oopDesc::header_size()));
280 }
281
282 static void fill_with_objects(HeapWord* start, size_t words, bool zap = true);
283
284 static void fill_with_object(HeapWord* start, size_t words, bool zap = true);
285 static void fill_with_object(MemRegion region, bool zap = true) {
286 fill_with_object(region.start(), region.word_size(), zap);
287 }
|
248 // memory that the vm could make available for storing 'normal' java objects.
249 // This is based on the reserved address space, but should not include space
250 // that the vm uses internally for bookkeeping or temporary storage
251 // (e.g., in the case of the young gen, one of the survivor
252 // spaces).
253 virtual size_t max_capacity() const = 0;
254
255 // Returns "TRUE" iff "p" points into the committed areas of the heap.
256 // This method can be expensive so avoid using it in performance critical
257 // code.
258 virtual bool is_in(const void* p) const = 0;
259
260 DEBUG_ONLY(bool is_in_or_null(const void* p) const { return p == NULL || is_in(p); })
261
262 virtual uint32_t hash_oop(oop obj) const;
263
264 void set_gc_cause(GCCause::Cause v);
265 GCCause::Cause gc_cause() { return _gc_cause; }
266
267 oop obj_allocate(Klass* klass, size_t size, TRAPS);
268 oop obj_buffer_allocate(Klass* klass, size_t size, TRAPS); // doesn't clear memory
269 virtual oop array_allocate(Klass* klass, size_t size, int length, bool do_zero, TRAPS);
270 oop class_allocate(Klass* klass, size_t size, TRAPS);
271
272 // Utilities for turning raw memory into filler objects.
273 //
274 // min_fill_size() is the smallest region that can be filled.
275 // fill_with_objects() can fill arbitrary-sized regions of the heap using
276 // multiple objects. fill_with_object() is for regions known to be smaller
277 // than the largest array of integers; it uses a single object to fill the
278 // region and has slightly less overhead.
279 static size_t min_fill_size() {
280 return size_t(align_object_size(oopDesc::header_size()));
281 }
282
283 static void fill_with_objects(HeapWord* start, size_t words, bool zap = true);
284
285 static void fill_with_object(HeapWord* start, size_t words, bool zap = true);
286 static void fill_with_object(MemRegion region, bool zap = true) {
287 fill_with_object(region.start(), region.word_size(), zap);
288 }
|