class ZPhantomCleanOopClosure : public OopClosure { public: virtualvoid do_oop(oop* p) { // Read the oop once, to make sure the liveness check // and the later clearing uses the same value. const oop obj = Atomic::load(p); if (ZBarrier::is_alive_barrier_on_phantom_oop(obj)) {
ZBarrier::keep_alive_barrier_on_phantom_oop_field(p);
} else { // The destination could have been modified/reused, in which case // we don't want to clear it. However, no one could write the same // oop here again (the object would be strongly live and we would // not consider clearing such oops), so therefore we don't have an // ABA problem here.
Atomic::cmpxchg(p, obj, oop(NULL));
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.