Are value types supposed to work at all currently?

Brian Goetz brian.goetz at oracle.com
Tue May 19 15:18:34 UTC 2015


No, our primary focus in the compiler has been on generics.  The support 
in the compiler for value types has almost certainly decayed (but there 
was not much there to start with.)

Cheers,
-Brian

On 5/19/2015 11:15 AM, Simon Ochsenreither wrote:
> Hi,
>
> I'm currently working on my talk about value types for tomorrow, and it seems
> that currently even the most basic value types are broken:
>
> public final __ByValue class Cell {
>    public Cell(int value) {
>      this.value = value;
>    }
>    public final int value;
> }
>
> /home/soc/Development/valhalla/build/linux-x86_64-normal-server-release/images/jdk/bin/java
>   Cell
> Error: A JNI error has occurred, please check your installation and try again
> Exception in thread "main" java.lang.VerifyError: Bad instruction: cb
> Exception Details:
>    Location:
>      Cell.<init>(I)V @0: fast_agetfield
>    Reason:
>      Error exists in the bytecode
>    Bytecode:
>      0000000: cb00 b700 01cb 001b b500 02b1
>
>      at java.lang.Class.getDeclaredMethods0(Native Method)
>      at java.lang.Class.privateGetDeclaredMethods(Class.java:2747)
>      at java.lang.Class.privateGetMethodRecursive(Class.java:3092)
>      at java.lang.Class.getMethod0(Class.java:3062)
>      at java.lang.Class.getMethod(Class.java:1830)
>      at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:567)
>      at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:534)
>
> Is this expected? Is there some working branch/revision somewhere which is
> usable for a demo?
>
> Thanks!
>
> Simon
>
> PS: What's the suggested way to inspect the "bytecode" of specialized classes
> (the one after the generic type is instantiated)?
>



More information about the valhalla-dev mailing list