Using a Condy instead of a Constant_Utf8

forax at univ-mlv.fr forax at univ-mlv.fr
Thu Dec 3 09:41:03 UTC 2020


----- Mail original -----
> De: "daniel smith" <daniel.smith at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "valhalla-spec-experts" <valhalla-spec-experts at openjdk.java.net>
> Envoyé: Mercredi 2 Décembre 2020 16:35:06
> Objet: Re: Using a Condy instead of a Constant_Utf8

>> On Dec 2, 2020, at 3:53 AM, Remi Forax <forax at univ-mlv.fr> wrote:
>> 
>> Using a condy that returns a String instead of a method descriptor in the
>> bytecode ?
>> I'm currently trying to remove the uses of Unsafe.defineAnonymousClass to use
>> Lookup.defineHiddenClass instead.
>> There is one case where i dynamically patch a method descriptor so I can select
>> how many arguments will be sent to a closure,
>> i.e. in the bytecode i put all arguments on the stack but because i've patched
>> the callee descriptor, only some of them will be used.
>> 
>> I see defineAnonymousClass has a way to push data to a template class file and
>> defineHiddenClass has a way to pull the data from the template class file.
>> But i can not currently pull data that will be used by a NameAndType info
>> because the descriptor_index has to be a Constant_Utf8 index and can not be a
>> condy with a String as descriptor.
> 
> The trouble I see with changing NameAndType is that verification needs a static
> string. At that stage, it's too early to be resolving condys.

yes, thanks,
I think the other Dan (Hedinga) already said that but i've a hard time to remember it.

> 
>> This is related to Lazy static final field [1] and also to class templating in
>> general because it equivalent to seeing all the template holes as condy even if
>> it"s less efficient because you need to duplicate the whole constant pool.
> 
> Lazy static fields, if I understand the proposal correctly, use a condy to
> determine the _value_ of the field, but not its _type_. Linkage behavior is
> unchanged.
> 
> Similarly, our preferred story for templating right now is to use normal Utf8
> strings for descriptors, and give each species different side-channel type
> information, computed via condy. This side information is needed fairly early,
> but verification is entirely descriptor-string-based.

good to know.

Rémi


More information about the valhalla-spec-observers mailing list