Review Request JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767
john.r.rose at oracle.com
Wed Dec 13 01:29:41 UTC 2017
On Dec 12, 2017, at 5:24 PM, David Holmes <david.holmes at oracle.com> wrote:
> as per getByteCodeIndex() it needs to be able to store "-1" to indicate no-bci?
Yes, that's the essential requirement, to encode a "none" value.
FWIW, one natural way to do that here would be to make the int field
@Stable and have the accessor return one less than the stored field value.
Then, by the rules of @Stable, the field starts out at the logical value
of -1, and can transition to a valid BCI if patched to a non-zero value
in the range 1..(2^16).
Making it "final" and initialized to -1 is not too terrible either, although
that creates some tech. debt we need to discharge when upgrading
finals to be trustable.
More information about the hotspot-runtime-dev