Value Types - Meet some issues during execution

Remi Forax forax at univ-mlv.fr
Mon Oct 24 16:28:06 UTC 2016


Hi Maurizio,
it seems the verifier has not been updated yet to cope with value type,
in the example provided by Tobias, he is using -noverify to bypass the verifier,
but it crashes we starting to run the interpreter.

Maybe, there is a shiboleet [1] option to pass to the VM ?

Rémi
[1] https://xkcd.com/806/

----- Mail original -----
> De: "Maurizio Cimadamore" <maurizio.cimadamore at oracle.com>
> À: "GIACHERIO Fabien" <f.giacherio at gmail.com>, "Tobias Hartmann" <tobias.hartmann at oracle.com>,
> valhalla-dev at openjdk.java.net
> Envoyé: Lundi 24 Octobre 2016 16:16:36
> Objet: Re: Value Types - Meet some issues during execution

> I too get this:
> 
> Error: A JNI error has occurred, please check your installation and try
> again
> Exception in thread "main" java.lang.ClassFormatError: Method "<vminit>"
> in class Point has illegal signature "(II)QPoint;"
>     at java.lang.ClassLoader.defineClass1(Native Method)
>     at java.lang.ClassLoader.defineClass(ClassLoader.java:761)
>     at java.lang.ClassLoader.defineClass(ClassLoader.java:837)
>     at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:184)
>     at java.net.URLClassLoader.defineClass(URLClassLoader.java:531)
>     at java.net.URLClassLoader.access$200(URLClassLoader.java:84)
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:413)
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:395)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:394)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:262)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
>     at
> sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:504)
> 
> 
> I don't think this has to do with the JIT. Making the constructor public
> didn't change the outcome.
> 
> Maurizio
> 
> 
> 
> On 24/10/16 14:56, GIACHERIO Fabien wrote:
>> I tried to add the -Xint argument in order to disable compilation but it
>> does not resolve the issue and the execution is still bugged.
>>
>> In the 'Minimal Value Types' document, It is say that : "Any use of any
>> part of any feature of this prototype must originate from a class in a
>> value-capable module".
>> I guess my issue come from that. How can I add my class in a value-capable
>> module ?
>>
>> Best regards,
>> Fabien GIACHERIO.
>>
>> 2016-10-21 14:58 GMT+02:00 Tobias Hartmann <tobias.hartmann at oracle.com>:
>>
>>> Hi Fabien,
>>>
>>> the current value types prototype has still very limited JIT support (C2
>>> only) and does not support all of the new vbytecodes and functionality yet.
>>> For an example of what already works, please have a look at these tests:
>>> http://hg.openjdk.java.net/valhalla/valhalla/hotspot/
>>> file/tip/test/compiler/valhalla/valuetypes/ValueTypeTestBench.java
>>> Especially calls on value types are not yet working.
>>>
>>> If you are experimenting with value types, it's best to disable
>>> compilation for now (-Xint).
>>>
>>> I'm actively working on this and will constantly update the tests if new
>>> functionality is added. I also plan to send a summary of the implementation
>>> at some point.
>>>
>>> Best regards,
>>> Tobias
>>>
>>> On 21.10.2016 14:48, GIACHERIO Fabien wrote:
>>>> Hi everyone,
>>>>
>>>> I am currently working on value types and I am trying to execute an
>>> example.
>>>> I can compile the class below but I meet some issues when I try to
>>> execute
>>>> it even if I add these arguments :
>>>> -noverify
>>>> -XX:-TieredCompilation
>>>> -XX:-BackgroundCompilation
>>>> -XX:-UseOnStackReplacement
>>>> -XX:CompileCommand=compileonly,Point::*
>>>> -XX:+PrintCompilation
>>>>
>>>> Do you have any solution ? If so, would you tell me please.
>>>>
>>>> Here is my code :
>>>> __ByValue final class Point{
>>>>      final int x;
>>>>      final int y;
>>>>
>>>>      private Point(int x, int y) {
>>>>          this.x = x;
>>>>          this.y = y;
>>>>      }
>>>>
>>>>      public static void hello() {
>>>>          Point origin = __Make Point(1,2);
>>>>      }
>>>>
>>>>      public static void main(String[] args) {
>>>>          hello();
>>>>      }
>>>> }
>>>>
>>>> Best Regards,
>>>> Fabien GIACHERIO.


More information about the valhalla-dev mailing list