On Tue, 10 Sep 2024 08:41:16 GMT, Roman Kennke <rken...@openjdk.org> wrote:
>> src/hotspot/share/oops/objArrayKlass.inline.hpp line 74: >> >>> 72: void ObjArrayKlass::oop_oop_iterate(oop obj, OopClosureType* closure) { >>> 73: // In this assert, we cannot safely access the Klass* with compact >>> headers. >>> 74: assert (UseCompactObjectHeaders || obj->is_array(), "obj must be >>> array"); >> >> If we can't safely access the `Klass*` here, why is the call to >> `obj->klass()` below safe? > > Good question. This comment and assert can probably be removed (same for the > similar comment/assert in TypeArrayKlass::oop_oop_iterate_impl(). Could be a > left-over from a time when we had to deal with OM and/or stack-locks in the > header. FWIW, I've been running tests with this assert restored (and the one in TypeArrayKlass) without hitting any problems. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1751656595