JVMTI invokedynamic bytecode parsing

Chris Plummer chris.plummer at oracle.com
Tue Aug 16 22:37:43 UTC 2022


I'm no expert in this area, especially regarding invokedynamic and 
bootstrap methods attributes. I see from the JVM spec that you are 
referring to the constant pool BootstrapMethods attribute. Also from the 
JVM spec I see that there are other attributes that JVMTI does not 
provide any special access to. Some you can get with various JVMTI APIs, 
like GetLocalVariableTable, which gives you the part of the 
LocalVariableTable attribute that is relevant to the specified method. 
But there are attributes that don't have any special APIs to access, 
such as NestHost, NestMembers, Record, or PermittedSubclasses,

What might work for you is to just to fetch the constant pool using 
GetConstantPool, and get the BootstrapMethods attribute from it.

Chris

On 8/13/22 3:20 PM, Ada wrote:
> Hi,
> I'm writing a JVMTI tool that needs to parse bytecode. To parse
> invokedynamic, you need to read from the parent class' bootstrap
> methods attribute, there is no current function in the JVMTI spec to
> get this information, not having this information isn't the end of the
> world but it seems odd. Am I missing something in regards to this, if
> not, are there any plans for adding this functionality in the future?


More information about the serviceability-dev mailing list