Are value types supposed to work at all currently?

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue May 19 15:21:57 UTC 2015


Value types are currently not supported - the compiler will swalow them 
and attempt to generate reasonable bytecode - but the VM changes to deal 
with this bytecode are not in the repository.

Maurizio

On 19/05/15 16:15, 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