RFR: 8349405: redundant and confusing null checks on data from CP::resolved_klasses

Coleen Phillimore coleenp at openjdk.org
Tue Apr 15 14:05:30 UTC 2025


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.

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

Commit messages:
 - Assert in other places that we check if JVM_CONSTANT_Class is null, which it must not be.
 - 8349405: redundant and confusing null checks on data from CP::resolved_klasses

Changes: https://git.openjdk.org/jdk/pull/24665/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24665&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8349405
  Stats: 16 lines in 1 file changed: 1 ins; 9 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/24665.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24665/head:pull/24665

PR: https://git.openjdk.org/jdk/pull/24665


More information about the hotspot-dev mailing list