Question on layer/peeling

Vitaly Davidovich vitalyd at gmail.com
Tue Jan 6 22:35:49 UTC 2015


I'm confused - are we talking about an any-fied hashmap or current hashmap?
If the former, the null comparison will always be false and without having
a default (T)/T.null/whatever, I'd expect a box operation to occur for the
null check.

Sent from my phone
On Jan 6, 2015 5:32 PM, "Brian Goetz" <brian.goetz at oracle.com> wrote:

> But bytecodes are supplemented by the BytecodeMapping attribute, which
> reify the (static) instantiated type (as outlined in the SotS writeup, and
> which you can see by running javap on a class compiled with the valhalla
> compiler.)
>
> On 1/6/2015 5:14 PM, Timo Kinnunen wrote:
>
>> The type in bytecode will be Object, but the type in source code will be
>> V, with V=boxed complex number, for example. The idiom I’m thinking of is
>>
>>
>> Complex complex = numbers.get(nonexistentKey);
>>
>> if(complex == null) return;
>>
>> calculate(complex.re, complex.im);
>>
>>
>>
>>
>>
>>
>> (Complex is a value type, numbers is a Java 5 hash map)
>>
>>
>>


More information about the valhalla-dev mailing list