Robert Field raised the following possible bug in the API of MethodHandleDesc.

A Constant_MethodHandle_info has the following contents:
  refKind
  reference to MethodRef or InterfaceMethodRef
  reference to NameAndType

Most of these map directly; we extract refKind from Kind, we extract name from name, we extract type descriptor from type. But, it doesn't seem like there's a way to express both (refkind=invokespecial, Constant_MethodRef_info) and (refkind=invokevirtual, Constant_InterfaceMethodRef_info).

One of the inputs to a MHDesc is a Kind enum constant.  Currently, they map 1:1 with refKind, but it seems to me we need to differentiate between INTERFACE_VIRTUAL and INTERFACE_SPECIAL, where in the latter case, refKind=special but we use an InterfaceMethodRef?

On 4/27/2018 1:31 PM, Vicente Romero wrote:
Hi all,

Please review the current proposal of the constants API, which are nominal descriptor types defined in pkg java.lang.invoke.constant. The code can be found at [1]. This API is being developed in the context of JEP 303: Intrinsics for the LDC and INVOKEDYNAMIC Instructions [2]

Thanks in advance for your comments,
Vicente

[1] http://cr.openjdk.java.net/~vromero/constant.api/webrev.00
[2] http://openjdk.java.net/jeps/303

Reply via email to