RFR JDK-8193325: StackFrameInfo::getByteCodeIndex returns wrong value if bci > 32767

Aleksey Shipilev shade at redhat.com
Mon Aug 12 18:33:57 UTC 2019

On 8/12/19 8:12 PM, Mandy Chung wrote:
> On 8/11/19 9:49 PM, David Holmes wrote:
>> On 11/08/2019 2:50 pm, Mandy Chung wrote:
>>> On 8/10/19 12:30 AM, Aleksey Shipilev wrote:
>>>> I wonder if bci=-1 is meaningful, and should be returned when BCI is not available. After this
>>>> patch, it would be converted to 65536?
>> This is my query as well. It is not obvious to me that the VM will never set a BCI of -1
> Frederic adds an assert to ensure that bci is a valid value [1] in the fix for JDK-8229375.  This
> would help catching the odd case with invalid BCI.

But the initializing value from Java code is still -1, so 65535 would be printed if BCI is not
initialized by VM on some path?

> Alternatively, we can make bci an int (as Alekey suggests) that does not increase the object size:
>    http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.02/

@Stable seems meaningless here, for the reasons Daniel points out. I believe "final int bci" is just
as good and clean.


More information about the core-libs-dev mailing list