Usage feedback rewriting jdk.internal.foreign.abi.BindingSpecializer
Jorn Vernee
jorn.vernee at oracle.com
Tue Mar 14 17:37:15 UTC 2023
Exactly. I liken it to the behavior produced by MethodHandles::zero [1],
which "... returns the default value for that type ...".
Jorn
[1]:
https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/lang/invoke/MethodHandles.html#zero(java.lang.Class)
On 14/03/2023 18:06, Brian Goetz wrote:
>
>>> Not sure what you are asking for here. There's no constant pool form
>>> for "short constant". There's bipush/sipush, though. What bytecode
>>> are you hoping to get out?
>> I'd expect this:
>>
>> cb.constantZero(ShortType)
>>
>> to result in iconst_0 being emitted. Where 'cb' is an instance of
>> `CodeBuilder`. (except, 'ShortType' would not be statically know, but
>> derived from a Class<?> value that is fed in to the generation code).
>
> Oh, I get it now -- you want the default field value for a given type
> kind. Yes, that makes sense, something like
>
> cb.loadDefault(typeKind)
>
>
More information about the classfile-api-dev
mailing list