File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
src/hotspot/share/gc/shenandoah Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -316,7 +316,11 @@ void ShenandoahNMethod::assert_alive_and_correct() {
316
316
oop *loc = _oops[c];
317
317
assert (_nm->code_contains ((address) loc) || _nm->oops_contains (loc), " nmethod should contain the oop*" );
318
318
oop o = RawAccess<>::oop_load (loc);
319
- shenandoah_assert_correct_except (loc, o, o == NULL || heap->is_full_gc_move_in_progress ());
319
+ shenandoah_assert_correct_except (loc, o,
320
+ o == NULL ||
321
+ heap->is_full_gc_move_in_progress () ||
322
+ (VMThread::vm_operation () != NULL ) && (VMThread::vm_operation ()->type () == VM_Operation::VMOp_HeapWalkOperation)
323
+ );
320
324
}
321
325
}
322
326
Original file line number Diff line number Diff line change @@ -1225,7 +1225,22 @@ class ObjectIterateScanRootClosure : public BasicOopIterateClosure {
1225
1225
T o = RawAccess<>::oop_load (p);
1226
1226
if (!CompressedOops::is_null (o)) {
1227
1227
oop obj = CompressedOops::decode_not_null (o);
1228
- obj = ShenandoahBarrierSet::resolve_forwarded_not_null (obj);
1228
+ oop fwd = (oop) ShenandoahForwarding::get_forwardee_raw_unchecked (obj);
1229
+ if (fwd == NULL ) {
1230
+ // There is an odd interaction with VM_HeapWalkOperation, see jvmtiTagMap.cpp.
1231
+ //
1232
+ // That operation walks the reachable objects on its own, storing the marking
1233
+ // wavefront in the object marks. When it is done, it calls the CollectedHeap
1234
+ // to iterate over all objects to clean up the mess. When it reaches here,
1235
+ // the Shenandoah fwdptr resolution code encounters the marked objects with
1236
+ // NULL forwardee. Trying to act on that would crash the VM. Or fail the
1237
+ // asserts, should we go for resolve_forwarded_pointer(obj).
1238
+ //
1239
+ // Therefore, we have to dodge it by doing the raw access to forwardee, and
1240
+ // assuming the object had no forwardee, if that thing is NULL.
1241
+ } else {
1242
+ obj = fwd;
1243
+ }
1229
1244
assert (oopDesc::is_oop (obj), " must be a valid oop" );
1230
1245
if (!_bitmap->is_marked ((HeapWord*) obj)) {
1231
1246
_bitmap->mark ((HeapWord*) obj);
You can’t perform that action at this time.
0 commit comments