@@ -37,7 +37,7 @@ void print_raw_memory(ShenandoahMessageBuffer &msg, void* loc) {
3737 // should be in heap, in known committed region, within that region.
3838
3939 ShenandoahHeap* heap = ShenandoahHeap::heap ();
40- if (!heap->is_in (loc)) return ;
40+ if (!heap->is_in_reserved (loc)) return ;
4141
4242 ShenandoahHeapRegion* r = heap->heap_region_containing (loc);
4343 if (r != nullptr && r->is_committed ()) {
@@ -77,7 +77,7 @@ void ShenandoahAsserts::print_obj(ShenandoahMessageBuffer& msg, oop obj) {
7777
7878void ShenandoahAsserts::print_non_obj (ShenandoahMessageBuffer& msg, void * loc) {
7979 ShenandoahHeap* heap = ShenandoahHeap::heap ();
80- if (heap->is_in (loc)) {
80+ if (heap->is_in_reserved (loc)) {
8181 msg.append (" inside Java heap\n " );
8282 ShenandoahHeapRegion *r = heap->heap_region_containing (loc);
8383 stringStream ss;
@@ -96,7 +96,7 @@ void ShenandoahAsserts::print_non_obj(ShenandoahMessageBuffer& msg, void* loc) {
9696void ShenandoahAsserts::print_obj_safe (ShenandoahMessageBuffer& msg, void * loc) {
9797 ShenandoahHeap* heap = ShenandoahHeap::heap ();
9898 msg.append (" " PTR_FORMAT " - safe print, no details\n " , p2i (loc));
99- if (heap->is_in (loc)) {
99+ if (heap->is_in_reserved (loc)) {
100100 ShenandoahHeapRegion* r = heap->heap_region_containing (loc);
101101 if (r != nullptr ) {
102102 stringStream ss;
@@ -113,7 +113,7 @@ void ShenandoahAsserts::print_failure(SafeLevel level, oop obj, void* interior_l
113113 ShenandoahHeap* heap = ShenandoahHeap::heap ();
114114 ResourceMark rm;
115115
116- bool loc_in_heap = (loc != nullptr && heap->is_in (loc));
116+ bool loc_in_heap = (loc != nullptr && heap->is_in_reserved (loc));
117117
118118 ShenandoahMessageBuffer msg (" %s; %s\n\n " , phase, label);
119119
@@ -166,22 +166,22 @@ void ShenandoahAsserts::print_failure(SafeLevel level, oop obj, void* interior_l
166166 report_vm_error (file, line, msg.buffer ());
167167}
168168
169- void ShenandoahAsserts::assert_in_heap (void * interior_loc, oop obj, const char *file, int line) {
169+ void ShenandoahAsserts::assert_in_heap_bounds (void * interior_loc, oop obj, const char *file, int line) {
170170 ShenandoahHeap* heap = ShenandoahHeap::heap ();
171171
172- if (!heap->is_in (obj)) {
173- print_failure (_safe_unknown, obj, interior_loc, nullptr , " Shenandoah assert_in_heap failed" ,
174- " oop must point to a heap address " ,
172+ if (!heap->is_in_reserved (obj)) {
173+ print_failure (_safe_unknown, obj, interior_loc, nullptr , " Shenandoah assert_in_heap_bounds failed" ,
174+ " oop must be in heap bounds " ,
175175 file, line);
176176 }
177177}
178178
179- void ShenandoahAsserts::assert_in_heap_or_null (void * interior_loc, oop obj, const char *file, int line) {
179+ void ShenandoahAsserts::assert_in_heap_bounds_or_null (void * interior_loc, oop obj, const char *file, int line) {
180180 ShenandoahHeap* heap = ShenandoahHeap::heap ();
181181
182- if (obj != nullptr && !heap->is_in (obj)) {
183- print_failure (_safe_unknown, obj, interior_loc, nullptr , " Shenandoah assert_in_heap_or_null failed" ,
184- " oop must point to a heap address " ,
182+ if (obj != nullptr && !heap->is_in_reserved (obj)) {
183+ print_failure (_safe_unknown, obj, interior_loc, nullptr , " Shenandoah assert_in_heap_bounds_or_null failed" ,
184+ " oop must be in heap bounds " ,
185185 file, line);
186186 }
187187}
@@ -191,9 +191,9 @@ void ShenandoahAsserts::assert_correct(void* interior_loc, oop obj, const char*
191191
192192 // Step 1. Check that obj is correct.
193193 // After this step, it is safe to call heap_region_containing().
194- if (!heap->is_in (obj)) {
194+ if (!heap->is_in_reserved (obj)) {
195195 print_failure (_safe_unknown, obj, interior_loc, nullptr , " Shenandoah assert_correct failed" ,
196- " oop must point to a heap address " ,
196+ " oop must be in heap bounds " ,
197197 file, line);
198198 }
199199
@@ -210,6 +210,12 @@ void ShenandoahAsserts::assert_correct(void* interior_loc, oop obj, const char*
210210 file,line);
211211 }
212212
213+ if (!heap->is_in (obj)) {
214+ print_failure (_safe_unknown, obj, interior_loc, nullptr , " Shenandoah assert_correct failed" ,
215+ " Object should be in active region area" ,
216+ file, line);
217+ }
218+
213219 oop fwd = ShenandoahForwarding::get_forwardee_raw_unchecked (obj);
214220
215221 if (obj != fwd) {
@@ -223,9 +229,9 @@ void ShenandoahAsserts::assert_correct(void* interior_loc, oop obj, const char*
223229 }
224230
225231 // Step 2. Check that forwardee is correct
226- if (!heap->is_in (fwd)) {
232+ if (!heap->is_in_reserved (fwd)) {
227233 print_failure (_safe_oop, obj, interior_loc, nullptr , " Shenandoah assert_correct failed" ,
228- " Forwardee must point to a heap address " ,
234+ " Forwardee must be in heap bounds " ,
229235 file, line);
230236 }
231237
@@ -236,9 +242,15 @@ void ShenandoahAsserts::assert_correct(void* interior_loc, oop obj, const char*
236242 }
237243
238244 // Step 3. Check that forwardee points to correct region
245+ if (!heap->is_in (fwd)) {
246+ print_failure (_safe_oop, obj, interior_loc, nullptr , " Shenandoah assert_correct failed" ,
247+ " Forwardee should be in active region area" ,
248+ file, line);
249+ }
250+
239251 if (heap->heap_region_index_containing (fwd) == heap->heap_region_index_containing (obj)) {
240252 print_failure (_safe_all, obj, interior_loc, nullptr , " Shenandoah assert_correct failed" ,
241- " Non-trivial forwardee should in another region" ,
253+ " Non-trivial forwardee should be in another region" ,
242254 file, line);
243255 }
244256
0 commit comments