Any::isNull check

Rémi Forax forax at univ-mlv.fr
Wed Dec 16 16:35:37 UTC 2015


The question is whenever you have several .class for one generic class or if there is only one fat .class and multiple classes (or something lighter) at runtime.

If you have one .class, the compiler can not do something for you.

regards,
Remi

Le 16 décembre 2015 16:45:25 CET, Paul Benedict <pbenedict at apache.org> a écrit :
>Yes, HotSpot is really good at that. I agree. However, my point is
>there's
>no reason in even carrying around the dead bytecode in the class file.
>With
>lots of these if() checks, the class file can surely shrink if the
>compiler
>gets some additional smarts.
>
>Cheers,
>Paul
>
>On Wed, Dec 16, 2015 at 9:42 AM, Brian Goetz <brian.goetz at oracle.com>
>wrote:
>
>> HotSpot is *really* good at eliminating dead code based on type
>profiles.
>>
>>
>> On 12/16/2015 10:38 AM, Paul Benedict wrote:
>>
>>> When a method is specialized for values, Any::isNull can only return
>>> "false", which means if(Any.isNull(o)) can only ever have one
>outcome --
>>> the other code branch can be discarded by the compiler. I know it's
>too
>>> early to talk about optimizations :-) but will javac be smart enough
>to
>>> recognize this optimization? Is it on your list for the future?
>>>
>>> Cheers,
>>> Paul
>>>
>>
>>




More information about the valhalla-dev mailing list