< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp

Print this page




1235     T o = RawAccess<>::oop_load(p);
1236     if (!CompressedOops::is_null(o)) {
1237       oop obj = CompressedOops::decode_not_null(o);
1238       oop fwd = (oop) ShenandoahForwarding::get_forwardee_raw_unchecked(obj);
1239       if (fwd == NULL) {
1240         // There is an odd interaction with VM_HeapWalkOperation, see jvmtiTagMap.cpp.
1241         //
1242         // That operation walks the reachable objects on its own, storing the marking
1243         // wavefront in the object marks. When it is done, it calls the CollectedHeap
1244         // to iterate over all objects to clean up the mess. When it reaches here,
1245         // the Shenandoah fwdptr resolution code encounters the marked objects with
1246         // NULL forwardee. Trying to act on that would crash the VM. Or fail the
1247         // asserts, should we go for resolve_forwarded_pointer(obj).
1248         //
1249         // Therefore, we have to dodge it by doing the raw access to forwardee, and
1250         // assuming the object had no forwardee, if that thing is NULL.
1251       } else {
1252         obj = fwd;
1253       }
1254       assert(oopDesc::is_oop(obj), "must be a valid oop");
1255       if (!_bitmap->is_marked(obj)) {
1256         _bitmap->mark(obj);
1257         _oop_stack->push(obj);
1258       }
1259     }
1260   }
1261 public:
1262   ObjectIterateScanRootClosure(MarkBitMap* bitmap, Stack<oop,mtGC>* oop_stack) :
1263     _bitmap(bitmap), _oop_stack(oop_stack) {}
1264   void do_oop(oop* p)       { do_oop_work(p); }
1265   void do_oop(narrowOop* p) { do_oop_work(p); }
1266 };
1267 
1268 /*
1269  * This is public API, used in preparation of object_iterate().
1270  * Since we don't do linear scan of heap in object_iterate() (see comment below), we don't
1271  * need to make the heap parsable. For Shenandoah-internal linear heap scans that we can
1272  * control, we call SH::make_tlabs_parsable().
1273  */
1274 void ShenandoahHeap::ensure_parsability(bool retire_tlabs) {
1275   // No-op.
1276 }




1235     T o = RawAccess<>::oop_load(p);
1236     if (!CompressedOops::is_null(o)) {
1237       oop obj = CompressedOops::decode_not_null(o);
1238       oop fwd = (oop) ShenandoahForwarding::get_forwardee_raw_unchecked(obj);
1239       if (fwd == NULL) {
1240         // There is an odd interaction with VM_HeapWalkOperation, see jvmtiTagMap.cpp.
1241         //
1242         // That operation walks the reachable objects on its own, storing the marking
1243         // wavefront in the object marks. When it is done, it calls the CollectedHeap
1244         // to iterate over all objects to clean up the mess. When it reaches here,
1245         // the Shenandoah fwdptr resolution code encounters the marked objects with
1246         // NULL forwardee. Trying to act on that would crash the VM. Or fail the
1247         // asserts, should we go for resolve_forwarded_pointer(obj).
1248         //
1249         // Therefore, we have to dodge it by doing the raw access to forwardee, and
1250         // assuming the object had no forwardee, if that thing is NULL.
1251       } else {
1252         obj = fwd;
1253       }
1254       assert(oopDesc::is_oop(obj), "must be a valid oop");
1255       if (!_bitmap->is_marked((HeapWord*) obj)) {
1256         _bitmap->mark((HeapWord*) obj);
1257         _oop_stack->push(obj);
1258       }
1259     }
1260   }
1261 public:
1262   ObjectIterateScanRootClosure(MarkBitMap* bitmap, Stack<oop,mtGC>* oop_stack) :
1263     _bitmap(bitmap), _oop_stack(oop_stack) {}
1264   void do_oop(oop* p)       { do_oop_work(p); }
1265   void do_oop(narrowOop* p) { do_oop_work(p); }
1266 };
1267 
1268 /*
1269  * This is public API, used in preparation of object_iterate().
1270  * Since we don't do linear scan of heap in object_iterate() (see comment below), we don't
1271  * need to make the heap parsable. For Shenandoah-internal linear heap scans that we can
1272  * control, we call SH::make_tlabs_parsable().
1273  */
1274 void ShenandoahHeap::ensure_parsability(bool retire_tlabs) {
1275   // No-op.
1276 }


< prev index next >