[mvt] RFR - add support for q-types in lambda forms

Paul Sandoz Paul.Sandoz at oracle.com
Mon Jun 5 17:46:28 UTC 2017


Hi Remi,

Yes thanks for clarifying, which simplifies things API-wise and makes sense in hindsight when considering just primitives.

I am still getting to grips with this Q-type stuff, excuse my ignorance. The top value wrapper type (currently __Value) is sort of a box or carrier, but one without identity with immutable contents and the VM can single them out for optimisation. Correct?

Paul.

> On 3 Jun 2017, at 06:56, Maurizio Cimadamore <maurizio.cimadamore at oracle.com> wrote:
> 
> 
> 
> On 03/06/17 12:51, Remi Forax wrote:
>> Hi Paul, Hi Maurizio,
>> bindTo() or insertArguments use the corresponding types from the method type to unbox the argument if necessary,
>> so actually bindTo(3) will insert 3 and not the boxed Integer if the corresponding type is an int.
>> 
>> The same way, a boxed value type can be unboxed if the corresponding type is a Q-type,
>> so there is no need of a bindTo(__Value).
>> 
>> In term of performance, this is not an issue because neither bindTo() nor insertArguments() should be called on a fast path.
> Yeah - thanks for the clarification - this corresponds to my understanding of the model - that is, with BMH, boxing happens 'at the boundaries', when you set up the method handle chain - but I think that in order to get there you need at least to teach BMH about value types (that is, the Species_XYZ classes should have methods to construct bound versions with value types), otherwise the chain will just get boxed to Object internally.
> 
> Maurizio
>> 
>> regards,
>> Rémi
>> 



More information about the valhalla-dev mailing list