Skip to content

Apache Lucene open-source search software

Remove JVMCI checks and update assertions for Java 25 (#16317) (#16498)

CH-Abhinav13796f80e490
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.java
index d5bb8ff57e8..89e1e8abdd1 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
@@ -136,7 +136,7 @@ public abstract class VectorizationProvider {
// visible for tests
static VectorizationProvider lookup(boolean testMode) {
final int runtimeVersion = Runtime.version().feature();
- assert runtimeVersion >= 21;
+ assert runtimeVersion >= 25;
if (runtimeVersion <= UPPER_JAVA_FEATURE_VERSION) {
// only use vector module with Hotspot VM
if (!Constants.IS_HOTSPOT_VM) {
@@ -144,12 +144,6 @@ 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 && Runtime.version().feature() < 25) {
- 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.java
index 99eb2208efe..ac923bdd021 100644
--- a/lucene/core/src/java/org/apache/lucene/util/Constants.java
+++ b/lucene/core/src/java/org/apache/lucene/util/Constants.java
@@ -67,10 +67,6 @@ 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 = (ValueLayout.ADDRESS.byteSize() == Long.BYTES);