RFR (XXL): 8223347: Integration of Vector API (Incubator): General HotSpot changes

forax at univ-mlv.fr forax at univ-mlv.fr
Sat Apr 4 12:18:34 UTC 2020


----- Mail original -----
> De: "Vladimir Ivanov" <vladimir.x.ivanov at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "hotspot-dev" <hotspot-dev at openjdk.java.net>, "hotspot compiler" <hotspot-compiler-dev at openjdk.java.net>,
> "panama-dev at openjdk.java.net'" <panama-dev at openjdk.java.net>
> Envoyé: Samedi 4 Avril 2020 01:52:03
> Objet: Re: RFR (XXL): 8223347: Integration of Vector API (Incubator): General HotSpot changes

>> Typo, it's --add-modules
> 
> Good catch, Remi. Thanks for the correction.
> 
>> 
>>> When user does that, JVM automatically enables Vector API support.
>>> It improves usability (user doesn't need to separately "open" the API
>>> and enable JVM support) while minimizing risks of destabilitzation from
>>> new code when the API is not used.
>> 
>> Question, what if i declare a module-info that requires "jdk.incubator.vector",
>> because in that case, i don't have to add --add-modules jdk.incubator.vector on
>> the command line, but does the VM will enable the Vector API support ?
> 
> Good point. JEP 11: "Incubator Modules" [1] states the following:
> 
> "Applications on the class path must use the --add-modules command-line
> option to request that an incubator module be resolved. Applications
> developed as modules can specify requires or requires transitive
> dependences upon an incubator module directly."
> 
> Current implementation doesn't distinguish whether the module is
> resolved for an application on the class path or by another module, so
> JVM support will be enabled by default in both cases. Do you see any
> problems with that?

So the VM supports is enabled either because there is an explicit --add-modules or because the module is transitively reachable from the root modules.
It means that it doesn't work if the module jdk.incubator.vector is loaded using a ModuleLayer. Users has to use XX:+EnableVectorSupport in that case.

regards,
Rémi

> 
> Best regards,
> Vladimir Ivanov
> 
> [1] https://openjdk.java.net/jeps/11
> 
>>> That's it! Will be happy to answer any questions.
>>>
>>> And thanks in advance for any feedback!
>> 
>> regards,
>> Rémi
>> 
>>>
>>> Best regards,
>>> Vladimir Ivanov
>>>
>>> [0]
>>> https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-March/065345.html
>>>
>>> [1]
>>> https://mail.openjdk.java.net/pipermail/hotspot-dev/2020-April/041228.html
>>>
>>> [2] https://openjdk.java.net/jeps/338
>>>
>>> [3] https://openjdk.java.net/projects/panama/
>>>
>>> [4]
>>> http://cr.openjdk.java.net/~vlivanov/panama/vector/jep338/hotspot.shared/webrev.00/01.intrinsics/src/java.base/share/classes/jdk/internal/vm/vector/VectorSupport.java.html
>>>
>>> [5] http://cr.openjdk.java.net/~vlivanov/talks/2018_JVMLS_VectorAPI.pdf
>>>
>>> [6] http://hg.openjdk.java.net/panama/dev/shortlog/92bbd44386e9
>>>
> >>       $ hg clone http://hg.openjdk.java.net/panama/dev/ -b vector-unstable


More information about the panama-dev mailing list