Special ASM branches named valhalla
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Thu Jul 24 23:48:28 UTC 2014
On 24/07/14 23:43, Remi Forax wrote:
>
> On 07/25/2014 12:28 AM, John Rose wrote:
>> On Jul 24, 2014, at 3:23 PM, Remi Forax <forax at univ-mlv.fr
>> <mailto:forax at univ-mlv.fr>> wrote:
>>
>>> I want to change the name of a method,
>>> I should not need to fold and unfold an unerased type.
>>
>> I agree, which is why I think we should replace CONSTANT_Utf8 and/or
>> CONSTANT_Class constants by structured CONSTANT_Signature constants.
>> They can remain opaque and "all folded up" to most visitors.
>
> Ok, got it, you don't want any side table for the unerased signature,
> in that case I think that only the descriptor should be a
> CONSTANT_Signature.
>
>> The net impact on constant pool parsing is probably positive, since
>> the overall byte-size of the CP will go down due to structure sharing.
>
> yes.
+1
When I worked on my reified JVM prototype, I used custom attributes to
map unerased signatures in a structural way (see section 4.2.1 in [1]).
The reuse is very good indeed - think of multiple instantiation of same
generic type i.e. List<String>, List<Integer> - here you have that base
type for List can be reused and both String and Integer are probably in
the CP already, so that encoding both could, in most cases be done
through in two very small entries consisting of 2 CP indexes each (one
for the base type, one for the type parameter). If you then need
List<List<String>> and the likes, savings start be pile up considerably
- i.e. only two indexes for that one too (given that both base type List
and type-argument List<String> already exist).
[1] - http://amsdottorato.unibo.it/2476/
Maurizio
>
>>
>> — John
>
> Rémi
>
More information about the valhalla-dev
mailing list