bootstrap method constant pool entry type question

Kirill Shirokov kirill.shirokov at oracle.com
Sat Jan 29 23:40:19 PST 2011


The invokedynamic instruction requires a MethodHandle constant pool 
entry for a bootstrap method.

This MH CP entry can be one of 9 REF_xxx types.

Questions:

Q1. Which types are valid in the case of bootstrap method?

Q2. What happens if I try to use invalid types?

I could not find answers in the current specification.

I guess that the correct answers would be:

A1. The valid types are: REF_getStatic, REF_invokeStatic (? and maybe 
REF_newInvokeSpecial). All others are invalid for bootstraping.

A2. If the type is invalid, JVM throws an exception (and doesn't try to 
call bootstrap MH taking arguments from Java stack)

Thanks in advance!

Kirill








More information about the mlvm-dev mailing list