Boxed types and constat propagation

Rémi Forax forax at univ-mlv.fr
Mon Apr 23 16:29:41 PDT 2012


On 04/24/2012 12:57 AM, Kohsuke Kawaguchi wrote:
> On 04/23/2012 11:18 AM, Rémi Forax wrote:
>>>  So again, I don't see how shifting from method handle tree to byte
>>>  code generation would somehow make this non-issue.
>>
>> In fact, it's easy to know that a.foo() is a boolean because
>> &&  can be only applied on booleans so the invokedynamic call
>> corresponding to a.foo() should return a boolean.
>>   From the compiler perspective, you have to back-propagate
>> the excepted type from the root to the leaf.
>
> Charles was alluding to the same thing, so I was thinking about this, 
> and I think I understand it now.
>
> That's a lot of optimization that I otherwise wouldn't have to do, if 
> only boxed types and constant propagation worked well, but yeah, I see 
> how it can work now.
>
> Thanks for all the insights.

BTW, I've patched the JIT to consider all final fields of a class of 
java/lang as truly final
but that not enough for having the escape analysis to work with integers.
It seems that because of the cache used in Integer.valueOf(), the JIT 
considers
that the Integers are not escapable.

Rémi



More information about the mlvm-dev mailing list