Why JVM can not type infer type params but javac can do?

Ali Ebrahimi ali.ebrahimi1781 at gmail.com
Thu Jan 8 12:32:14 UTC 2015


I mean we can do better job than today by some hints and already unused
info by VM.
One first step: disallowing raw types by java9/10.
And some form of http://www.google.com/patents/US7810077

On Thu, Jan 8, 2015 at 3:49 PM, Remi Forax <forax at univ-mlv.fr> wrote:

> Do you really want to enhance a simple VM checkcast to check subtyping
> relationship between wildcards at runtime ?
>
> Rémi
>
>
> On 01/08/2015 09:54 AM, Ali Ebrahimi wrote:
>
>> Hi, maybe this is stupid question, but want to ask and what is
>> requirements
>> for this?
>>
>> Array instantiation sample:
>> public <any T> T[] newArray(int){
>>          return new T[0];
>> }
>>
>> even for non-any T:
>> public <T> T[] newArray(int){
>>          return new T[0];
>> }
>>
>> With thousands number of optimization and inlining mechanics equipped in
>> jvm, What is the reasoning behind not allowing to jvm to be aware of
>> generics info emitted in classfilles?
>>
>> Why jvm should not able do following inlining?
>>
>> String[] strs =  newArray(int) => String[] strs = new String[0];
>> I mean even in jitted code.
>>
>> I think some time ago I read some papers in similar area.
>>
>
>


-- 

Best Regards,
Ali Ebrahimi



More information about the valhalla-dev mailing list