RFR: 8349405: Redundant and confusing null checks on data from CP::resolved_klasses
David Holmes
dholmes at openjdk.org
Wed Apr 16 04:56:45 UTC 2025
On Tue, 15 Apr 2025 13:59:30 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
> This small cleanup asserts that when we have JVM_CONSTANT_Class tag in the constant pool, the resolved_klasses() contains a non-null Klass. There were some null checks left over and access to resolved_klasses() should go through resolved_klass_at() whenever possible to hide the CPSlot code.
> Tested with tier1-8.
It sounds reasonable that any entry tagged `JVM_CONSTANT_Class` is guaranteed non-null (at least now you fixed the place that set null before changing the tag). But I can't find the primary place where we install a `klass*` into the `resolved_klasses` and tag it as `JVM_CONSTANT_Class`.
-------------
PR Review: https://git.openjdk.org/jdk/pull/24665#pullrequestreview-2770748181
More information about the hotspot-dev
mailing list