MVT-based vectors: first stab

Vladimir Ivanov vladimir.x.ivanov at
Mon Jul 3 12:44:42 UTC 2017

>> My near-term plans are: (1) implement missing LF intrinsics and (2) look
>> into box elimination issues on JIT-compiler side.
> The JIT handles value types as tuples of the fields of the value, we
> don't allocate buffers for the value types unless it's striclty needed
> and we shouldn't need escape analysis. When a value is passed around
> through method handle calls, we pass the tuple of fields around (still
> no allocation) but sometimes, the JIT expects an __Value at some point
> in the program (because lamdba forms use __Value) and __Value can only
> be a pointer so we have to allocate a buffer for the value type (mostly
> to keep the type system happy). In that case we rely on escape analysis
> to remove the allocation.

Yes, the value boxes come from __Value usages in lambda forms.

> I suspect the extra allocations you're seeing are from those cases in LF
> where we allocate a buffer to hold a value type and escape analysis
> fails to remove the allocations. I more or less have a plan to take care
> of those allocations. I haven't had time to work on it yet.

Glad to hear that.

Considering MVT will rely on method handles, we have to either provide 
first class support for __Value and optimize it on JIT-compiler side 
well (on par with concrete value types) or avoid value type erasure to 
__Value in lambda forms.

Best regards,
Vladimir Ivanov

More information about the valhalla-dev mailing list