disable vectors (and don't warn to add incubator module) for jvmci/graal (#12766)

This commit is contained in:
Robert Muir 2023-11-06 15:28:22 -05:00 committed by GitHub
parent 0e9c23785e
commit eab3e502bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -117,6 +117,12 @@ public abstract class VectorizationProvider {
"Java runtime is not using Hotspot VM; Java vector incubator API can't be enabled.");
return new DefaultVectorizationProvider();
}
// don't use vector module with JVMCI (it does not work)
if (Constants.IS_JVMCI_VM) {
LOG.warning(
"Java runtime is using JVMCI Compiler; Java vector incubator API can't be enabled.");
return new DefaultVectorizationProvider();
}
// is the incubator module present and readable (JVM providers may to exclude them or it is
// build with jlink)
final var vectorMod = lookupVectorModule();

View File

@ -66,6 +66,10 @@ public final class Constants {
/** True iff the Java VM is based on Hotspot and has the Hotspot MX bean readable by Lucene. */
public static final boolean IS_HOTSPOT_VM = HotspotVMOptions.IS_HOTSPOT_VM;
/** True if jvmci is enabled (e.g. graalvm) */
public static final boolean IS_JVMCI_VM =
HotspotVMOptions.get("UseJVMCICompiler").map(Boolean::valueOf).orElse(false);
/** True iff running on a 64bit JVM */
public static final boolean JRE_IS_64BIT = is64Bit();