diff --git a/src/hotspot/share/oops/oop.inline.hpp b/src/hotspot/share/oops/oop.inline.hpp index 1a3ae00674c..ffef9dca222 100644 --- a/src/hotspot/share/oops/oop.inline.hpp +++ b/src/hotspot/share/oops/oop.inline.hpp @@ -298,20 +298,22 @@ oop oopDesc::forwardee() const { // The following method needs to be MT safe. uint oopDesc::age() const { - assert(!mark().is_marked(), "Attempt to read age from forwarded mark"); - if (has_displaced_mark()) { - return displaced_mark().age(); + markWord m = mark(); + assert(!m.is_marked(), "Attempt to read age from forwarded mark"); + if (m.has_displaced_mark_helper()) { + return m.displaced_mark_helper().age(); } else { - return mark().age(); + return m.age(); } } void oopDesc::incr_age() { - assert(!mark().is_marked(), "Attempt to increment age of forwarded mark"); - if (has_displaced_mark()) { - set_displaced_mark(displaced_mark().incr_age()); + markWord m = mark(); + assert(!m.is_marked(), "Attempt to increment age of forwarded mark"); + if (m.has_displaced_mark_helper()) { + m.set_displaced_mark_helper(m.displaced_mark_helper().incr_age()); } else { - set_mark(mark().incr_age()); + set_mark(m.incr_age()); } }