RFR: 8296956: [JVMCI] HotSpotResolvedJavaFieldImpl.getIndex returns wrong value

Doug Simon dnsimon at openjdk.org
Mon Nov 14 20:13:39 UTC 2022


This PR fixes a bug related to `HotSpotResolvedJavaFieldImpl.index`. Its value is passed into the `HotSpotResolvedJavaFieldImpl` constructor as an `int`, and is returned by `getIndex()` as an `int` but it was stored as a `short`. This meant that unsigned 16-bit values were not handled correctly.

Also included are some related JVMCI cleanups:
* added and fixed doc related to `ResolvedJavaField.getOffset()`
* replaced assertions with always-enabled checks

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

Commit messages:
 - fixed HotSpotResolvedJavaFieldImpl.getIndex
 - replaced assertions with always-enabled checks
 - added and fixed doc related to ResolvedJavaField.getOffset()

Changes: https://git.openjdk.org/jdk/pull/11142/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=11142&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8296956
  Stats: 180 lines in 7 files changed: 137 ins; 5 del; 38 mod
  Patch: https://git.openjdk.org/jdk/pull/11142.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11142/head:pull/11142

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


More information about the hotspot-dev mailing list