Apache Lucene open-source search software
disable vectors (and don't warn to add incubator module) for jvmci/graal (#12766)
Robert Muireab3e502bbed
diff --git a/lucene/core/src/java/org/apache/lucene/internal/vectorization/VectorizationProvider.java b/lucene/core/src/java/org/apache/lucene/internal/vectorization/VectorizationProvider.javaindex 35a485243d5..73f1f918091 100644--- a/lucene/core/src/java/org/apache/lucene/internal/vectorization/VectorizationProvider.java+++ b/lucene/core/src/java/org/apache/lucene/internal/vectorization/VectorizationProvider.java@@ -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();diff --git a/lucene/core/src/java/org/apache/lucene/util/Constants.java b/lucene/core/src/java/org/apache/lucene/util/Constants.javaindex 01ead03fc04..97728f585da 100644--- a/lucene/core/src/java/org/apache/lucene/util/Constants.java+++ b/lucene/core/src/java/org/apache/lucene/util/Constants.java@@ -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();