Thanks a lot for the answers. Now I get it.
On 27 December 2017 at 15:27, Remi Forax <[email protected]> wrote: > Hi Henry, > > ------------------------------ > > *De: *"Henri Tremblay" <[email protected]> > *À: *"mechanical-sympathy" <[email protected]> > *Envoyé: *Mercredi 27 Décembre 2017 19:47:56 > *Objet: *Re: Minimal Value Type > > > First, there are actually two specs for value types, the minimal value > type which is the one implemented in the early access binaries and "real" > value type which will be close (closer) to the value type that will be > integrated in Java. > > The idea of the minimal value type prototype was to see what we need in > the VM to support value types without thinking too much about how reference > and value type will co-exist, so you declare a value capable class which is > an immutable normal Java class and the VM is able to derive a value type > from it, the value capable class is the box and the derived value type is > the plain value type. > > Since October, we are moving to a new specs, where java.lang.Object (and > any interfaces) are types that hold either a value type or reference type, > but currently, there is no real implementation of this spec. > > Thanks. It raises a lot of interesting question. > - Will I finally be able to add a primitive type in a generic (since it's > a value type)? > > > that's the plan, but this is not implemented in the minimal value type > prototype. I'm currently developing a prototype of the generics part, but > it's not clean enough to share (yet!). > > - Why not considering everything an universal type (but then how to box > unbox it)? > > > java.lang.Object (and any interfaces) can play the role of that universal > type, and we now know how to box a value type on stack (or in an arena that > move like the stack), we call that buffering and not boxing because the > value type is seen as a reference but not a reference on the heap. > > - And do I tell a value type is a value type? > > > With the current prototype, you put the annotation > @jdk.incubator.mvt.ValueCapableClass > on an immutable class. > In the future, javac will have a language support for that (if you take a > look to the source, there is already a proto version of that support for > testing). > > Rémi > > > > On 27 December 2017 at 12:13, Jay Askren <[email protected]> wrote: > >> https://www.infoq.com/news/2017/11/ValueTypesNov10 >> >> >> On Wednesday, December 27, 2017 at 7:54:11 AM UTC-7, Henri Tremblay wrote: >>> >>> Hi Rémi, >>> Highly interesting. >>> >>> For those like me who are too lazy to read an annotated JVM spec, are >>> you aware of a quick summary of how it works somewhere? (over (how to >>> specify in Java code and API changes) and under (JVM instructions) the >>> hood). >>> >>> Thanks, >>> Henri >>> >>> On 27 December 2017 at 07:30, Remi Forax <[email protected]> wrote: >>> >>>> Hi all, >>>> seeing the mail from Peter on how to avoid pointer chasing, instead of >>>> using off-heap data structure, use value types. >>>> >>>> Currently, there is a prototype, named the Minimal Value Type, that >>>> allows people to test value types inside the VM. >>>> >>>> The spec is here: >>>> http://cr.openjdk.java.net/~dlsmith/values.html >>>> >>>> There are an early access build for Linux and MacOs >>>> http://jdk.java.net/valhalla/ >>>> >>>> The version of ASM that let you generate the new bytecodes is here: >>>> https://gitlab.ow2.org/asm/asm/tree/MINIMAL_VALUE_TYPE >>>> and you can also get compiled version here: >>>> https://github.com/forax/valuetypify/tree/master/deps >>>> >>>> You can use the valuetypifier, that transform Java 8 code to code with >>>> value types >>>> https://github.com/forax/valuetypify >>>> >>>> regards, >>>> Rémi >>>> >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "mechanical-sympathy" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "mechanical-sympathy" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "mechanical-sympathy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "mechanical-sympathy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
