larval value type and carrier object

Brian Goetz brian.goetz at oracle.com
Wed Jan 30 15:11:42 UTC 2019


We don’t need any special VM support; we just need a bootstrap that will select a suitably shaped value type as a carrier, and manage the mapping between “logical” and “physical” indexes.  The bootstrap can manage a cache of shapes (two ints and two refs, four ints and no refs, etc), and should be able to handle the vast majority of patterns with a cache of a dozen or so shapes, and then fall back to an array when it misses.  (The “library” carriers can either be hand-written or spun on demand.)  I don’t think there’s any additional deep magic needed.


> On Jan 15, 2019, at 8:55 AM, Remi Forax <forax at univ-mlv.fr> wrote:
> 
> Hi John, hi Mandy,
> For de-constructing a matched pattern, we need a carrier object that will temporarily store the captured values,
> given that jdk.internal.misc.Unsafe has now has the methods uninitializedDefaultValue()/makePrivateBuffer()/finishPrivateBuffer(), i wonder if there is a way to add a method Class<?> createBufferClass(MethodType) that creates a value class with the fields named _0, _1, _2, etc and the types of the fields extracted from the parameter types of the MethodType ?
> 
> With the JIT being able to always returns the same class if the MethodType is constant.
> 
> Rémi
> 



More information about the valhalla-dev mailing list