233 oop fwd2 = oop(ShenandoahForwarding::get_forwardee_raw_unchecked(fwd));
234 if (!oopDesc::equals_raw(fwd, fwd2)) {
235 print_failure(_safe_all, obj, interior_loc, NULL, "Shenandoah assert_correct failed",
236 "Multiple forwardings",
237 file, line);
238 }
239 }
240 }
241
242 void ShenandoahAsserts::assert_in_correct_region(void* interior_loc, oop obj, const char* file, int line) {
243 assert_correct(interior_loc, obj, file, line);
244
245 ShenandoahHeap* heap = ShenandoahHeap::heap_no_check();
246 ShenandoahHeapRegion* r = heap->heap_region_containing(obj);
247 if (!r->is_active()) {
248 print_failure(_safe_unknown, obj, interior_loc, NULL, "Shenandoah assert_in_correct_region failed",
249 "Object must reside in active region",
250 file, line);
251 }
252
253 size_t alloc_size = obj->size() + ShenandoahForwarding::word_size();
254 if (alloc_size > ShenandoahHeapRegion::humongous_threshold_words()) {
255 size_t idx = r->region_number();
256 size_t num_regions = ShenandoahHeapRegion::required_regions(alloc_size * HeapWordSize);
257 for (size_t i = idx; i < idx + num_regions; i++) {
258 ShenandoahHeapRegion* chain_reg = heap->get_region(i);
259 if (i == idx && !chain_reg->is_humongous_start()) {
260 print_failure(_safe_unknown, obj, interior_loc, NULL, "Shenandoah assert_in_correct_region failed",
261 "Object must reside in humongous start",
262 file, line);
263 }
264 if (i != idx && !chain_reg->is_humongous_continuation()) {
265 print_failure(_safe_oop, obj, interior_loc, NULL, "Shenandoah assert_in_correct_region failed",
266 "Humongous continuation should be of proper size",
267 file, line);
268 }
269 }
270 }
271 }
272
273 void ShenandoahAsserts::assert_forwarded(void* interior_loc, oop obj, const char* file, int line) {
|
233 oop fwd2 = oop(ShenandoahForwarding::get_forwardee_raw_unchecked(fwd));
234 if (!oopDesc::equals_raw(fwd, fwd2)) {
235 print_failure(_safe_all, obj, interior_loc, NULL, "Shenandoah assert_correct failed",
236 "Multiple forwardings",
237 file, line);
238 }
239 }
240 }
241
242 void ShenandoahAsserts::assert_in_correct_region(void* interior_loc, oop obj, const char* file, int line) {
243 assert_correct(interior_loc, obj, file, line);
244
245 ShenandoahHeap* heap = ShenandoahHeap::heap_no_check();
246 ShenandoahHeapRegion* r = heap->heap_region_containing(obj);
247 if (!r->is_active()) {
248 print_failure(_safe_unknown, obj, interior_loc, NULL, "Shenandoah assert_in_correct_region failed",
249 "Object must reside in active region",
250 file, line);
251 }
252
253 size_t alloc_size = obj->size();
254 if (alloc_size > ShenandoahHeapRegion::humongous_threshold_words()) {
255 size_t idx = r->region_number();
256 size_t num_regions = ShenandoahHeapRegion::required_regions(alloc_size * HeapWordSize);
257 for (size_t i = idx; i < idx + num_regions; i++) {
258 ShenandoahHeapRegion* chain_reg = heap->get_region(i);
259 if (i == idx && !chain_reg->is_humongous_start()) {
260 print_failure(_safe_unknown, obj, interior_loc, NULL, "Shenandoah assert_in_correct_region failed",
261 "Object must reside in humongous start",
262 file, line);
263 }
264 if (i != idx && !chain_reg->is_humongous_continuation()) {
265 print_failure(_safe_oop, obj, interior_loc, NULL, "Shenandoah assert_in_correct_region failed",
266 "Humongous continuation should be of proper size",
267 file, line);
268 }
269 }
270 }
271 }
272
273 void ShenandoahAsserts::assert_forwarded(void* interior_loc, oop obj, const char* file, int line) {
|