On 04/25/2012 07:23 PM, Fredrik Öhrström wrote:
>>> 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.
> Clearly the C1/C2 compiler needs to be improved. In the meantime
> you have to work around their limitations.
>
>> 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.
> I think System.out and System.err are final, but they are in fact
> set during the start of the jvm. Just so that you take that into
> account, in case any optimizations would happen that early.
> (There are probably more examples of this.)

The exact code is considering all fields of java/lang classes except the 
one from j/l/System.
The other problem with out and err is setOut() and setErr().

>
> The escape analysis in C2 is broken, combining that with
> the limited amount of boxing removal support, and the cache
> of Integer.valueOf, you get a bad optimizations.
>
> At least we have an intern right now in Stockholm who is
> working on porting the JRockit autoboxing removal optimizations
> to C2. Yay!

Yay too !

>
> //Fredrik

Rémi

_______________________________________________
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

Reply via email to