RFR: 8308088: Improve class check in CollectedHeap::is_oop [v2]

Aleksey Shipilev shade at openjdk.org
Mon May 15 20:17:43 UTC 2023


On Mon, 15 May 2023 20:04:50 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

> Wait, you are calling `k->is_klass()` here, you do need `acquire` here.

Oh. `is_klass` is v-call, okay. Good catch! Actually, let's just avoid checking for `is_klass` here, instead of making this method carry additional memory order semantics. This would make the method lighter (= more performance for debug builds), and would prevent `assert(is_oop(...))` hiding memory ordering bugs in debug mode accidentally.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/13982#issuecomment-1548513639


More information about the hotspot-gc-dev mailing list