229 // Returns "TRUE" iff "p" points into the committed areas of the heap.
230 // This method can be expensive so avoid using it in performance critical
231 // code.
232 virtual bool is_in(const void* p) const = 0;
233
234 DEBUG_ONLY(bool is_in_or_null(const void* p) const { return p == NULL || is_in(p); })
235
236 virtual uint32_t hash_oop(oop obj) const;
237
238 void set_gc_cause(GCCause::Cause v) {
239 if (UsePerfData) {
240 _gc_lastcause = _gc_cause;
241 _perf_gc_lastcause->set_value(GCCause::to_string(_gc_lastcause));
242 _perf_gc_cause->set_value(GCCause::to_string(v));
243 }
244 _gc_cause = v;
245 }
246 GCCause::Cause gc_cause() { return _gc_cause; }
247
248 oop obj_allocate(Klass* klass, int size, TRAPS);
249 virtual oop array_allocate(Klass* klass, int size, int length, bool do_zero, TRAPS);
250 oop class_allocate(Klass* klass, int size, TRAPS);
251
252 // Utilities for turning raw memory into filler objects.
253 //
254 // min_fill_size() is the smallest region that can be filled.
255 // fill_with_objects() can fill arbitrary-sized regions of the heap using
256 // multiple objects. fill_with_object() is for regions known to be smaller
257 // than the largest array of integers; it uses a single object to fill the
258 // region and has slightly less overhead.
259 static size_t min_fill_size() {
260 return size_t(align_object_size(oopDesc::header_size()));
261 }
262
263 static void fill_with_objects(HeapWord* start, size_t words, bool zap = true);
264
265 static void fill_with_object(HeapWord* start, size_t words, bool zap = true);
266 static void fill_with_object(MemRegion region, bool zap = true) {
267 fill_with_object(region.start(), region.word_size(), zap);
268 }
|
229 // Returns "TRUE" iff "p" points into the committed areas of the heap.
230 // This method can be expensive so avoid using it in performance critical
231 // code.
232 virtual bool is_in(const void* p) const = 0;
233
234 DEBUG_ONLY(bool is_in_or_null(const void* p) const { return p == NULL || is_in(p); })
235
236 virtual uint32_t hash_oop(oop obj) const;
237
238 void set_gc_cause(GCCause::Cause v) {
239 if (UsePerfData) {
240 _gc_lastcause = _gc_cause;
241 _perf_gc_lastcause->set_value(GCCause::to_string(_gc_lastcause));
242 _perf_gc_cause->set_value(GCCause::to_string(v));
243 }
244 _gc_cause = v;
245 }
246 GCCause::Cause gc_cause() { return _gc_cause; }
247
248 oop obj_allocate(Klass* klass, int size, TRAPS);
249 oop obj_buffer_allocate(Klass* klass, int size, TRAPS); // doesn't clear memory
250 virtual oop array_allocate(Klass* klass, int size, int length, bool do_zero, TRAPS);
251 oop class_allocate(Klass* klass, int size, TRAPS);
252
253 // Utilities for turning raw memory into filler objects.
254 //
255 // min_fill_size() is the smallest region that can be filled.
256 // fill_with_objects() can fill arbitrary-sized regions of the heap using
257 // multiple objects. fill_with_object() is for regions known to be smaller
258 // than the largest array of integers; it uses a single object to fill the
259 // region and has slightly less overhead.
260 static size_t min_fill_size() {
261 return size_t(align_object_size(oopDesc::header_size()));
262 }
263
264 static void fill_with_objects(HeapWord* start, size_t words, bool zap = true);
265
266 static void fill_with_object(HeapWord* start, size_t words, bool zap = true);
267 static void fill_with_object(MemRegion region, bool zap = true) {
268 fill_with_object(region.start(), region.word_size(), zap);
269 }
|