RFR: 8326692: JVMCI Local.endBci is off-by-one
Gilles Duboscq
gdub at openjdk.org
Fri Mar 1 17:54:01 UTC 2024
In class files, in the local variable table, local variables have a start BCI and a length. The local variable has a value from BCI (inclusive) until BCI + length (exclusive).
On the other end, JVMCI stores that information in `Local` objects with a start BCI and an end BCI (inclusive).
Currently the parser just uses BCI+length to compute the end BCI, leading to an off-by-one error.
A simple test checking that the start and end BCIs are within the method's bytecode is added. It fails without the fix.
-------------
Commit messages:
- Fix JVMCI Local endBCI off-by-one error
- Add javadoc and minimal test for Local.getStart/EndBCI
Changes: https://git.openjdk.org/jdk/pull/18087/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18087&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8326692
Stats: 31 lines in 3 files changed: 27 ins; 1 del; 3 mod
Patch: https://git.openjdk.org/jdk/pull/18087.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18087/head:pull/18087
PR: https://git.openjdk.org/jdk/pull/18087
More information about the hotspot-compiler-dev
mailing list