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

Mandy Chung mandy.chung at oracle.com
Tue Aug 13 01:33:34 UTC 2019

On 8/12/19 5:13 PM, Frederic Parain wrote:
> This looks good to me, with two comments:
> I don’t like the static final RETAIN_CLASS_REF for the same
> reasons as Aleksey, but I can live with that.

I didn't see Aleksey's comment about RETAIN_CLASS_REF (what is it?).  
Now that it draws my attention.   Since there is no other flag at the 
moment, we can simplify it and rename the flags field to a boolean 
retainClassRef field.

> The protocol between the JVM and the Java class is well explained
> on the JVM side (javaClasses.cpp:4227). I think it would be valuable
> to provide the same description on the Java side, the comment in
> StackFrameInfo.java:42 describes only part of the protocol.

Good suggestion.  Added:

96 // VM adds 1 to the code index to StackFrameInfo::bci field such that
97 // zero (and negative values) indicates invalid BCI. So substract 1.



> No need for another review from me.
> Regards,
> Fred
>> On Aug 12, 2019, at 16:24, Mandy Chung <mandy.chung at oracle.com> wrote:
>> Having a second thought, I'm keeping @Stable bci field while zero indicates an invalid BCI that makes it obvious that this field will be updated.  VM will set StackFrameInfo::bci to value+1.
>> http://cr.openjdk.java.net/~mchung/jdk14/8193325/webrev.03/
>> Mandy

More information about the core-libs-dev mailing list