Special ASM branches named valhalla

Remi Forax forax at univ-mlv.fr
Thu Jul 24 22:23:13 UTC 2014


On 07/24/2014 10:51 PM, John Rose wrote:
> On Jul 24, 2014, at 10:05 AM, Remi Forax <forax at univ-mlv.fr> wrote:
>
>> I've started to hack a version of ASM in order to be able to do the specialization at runtime.
>> http://websvn.ow2.org/listing.php?repname=asm&path=%2Fbranches%2FVALHALLA%2F
>>
>> Currently, it only supports the TypeVariableMap attribute (reader and writer)
>> and is fully backward compatible with ASM5 :)
> Here's a big cut I think we need in ASM:  Structured names (CONSTANT_Signature?).
> The use of String to encode class names and method descriptors will not scale to unerased types.

I disagree with you that String will not scale because inside a class 
file, unerased types are just String
inside a side table and by example if I want to change the name of a method,
I should not need to fold and unfold an unerased type.

I think, we should represent unerased class and unerased descriptor,
as one unerased signature, the concatenation of the type argument of the 
class and the unerased descriptor.

by example,
class Foo<any T> {
   T t;

   void m() {
      this.t
   }
}

here this.t is translated to getfield Foo t Ljava/lang/Object;
with an unerased signature <T>T
(<T> because this is typed Foo<T> and T because the unerased type of t is T)

> I suggest amending or repurposing asm.Type to carry tuples of constants (plus template string as "(L#;I)Q#;" to control top-level structure).
> The hardest part will be deprecating String as a carrier for descriptors and type names in the visitor APIs.

I think adding a supplementary String being either the unerased 
signature or null
with a way to fold/unfold that signature should be enough.

>
> — John  :-}

Rémi :)



More information about the valhalla-dev mailing list