src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java
changeset 58533 46b0b7fe255c
parent 57537 ecc6e394475f
child 58679 9c3209ff7550
child 59095 03fbcd06b4c0
equal deleted inserted replaced
58532:b4f2e13d20ea 58533:46b0b7fe255c
    41  *
    41  *
    42  * This class only depends on the JDK so that it can be used without building Graal.
    42  * This class only depends on the JDK so that it can be used without building Graal.
    43  */
    43  */
    44 public final class JVMCIVersionCheck {
    44 public final class JVMCIVersionCheck {
    45 
    45 
    46     private static final Version JVMCI8_MIN_VERSION = new Version3(19, 2, 1);
    46     private static final Version JVMCI8_MIN_VERSION = new Version3(19, 3, 2);
    47 
    47 
    48     public interface Version {
    48     public interface Version {
    49         boolean isLessThan(Version other);
    49         boolean isLessThan(Version other);
    50 
    50 
    51         static Version parse(String vmVersion) {
    51         static Version parse(String vmVersion) {
   228                     }
   228                     }
   229                 } catch (NumberFormatException e) {
   229                 } catch (NumberFormatException e) {
   230                     failVersionCheck(props, exitOnFailure, "Could not parse the JDK 11 early access build number from java.vm.version property: %s.%n", vmVersion);
   230                     failVersionCheck(props, exitOnFailure, "Could not parse the JDK 11 early access build number from java.vm.version property: %s.%n", vmVersion);
   231                     return;
   231                     return;
   232                 }
   232                 }
       
   233             } else if (vmVersion.contains("-jvmci-")) {
       
   234                 // A "labsjdk"
       
   235                 Version v = Version.parse(vmVersion);
       
   236                 if (v != null) {
       
   237                     if (v.isLessThan(minVersion)) {
       
   238                         failVersionCheck(props, exitOnFailure, "The VM does not support the minimum JVMCI API version required by Graal: %s < %s.%n", v, minVersion);
       
   239                     }
       
   240                     return;
       
   241                 }
       
   242                 failVersionCheck(props, exitOnFailure, "The VM does not support the minimum JVMCI API version required by Graal.%n" +
       
   243                                 "Cannot read JVMCI version from java.vm.version property: %s.%n", vmVersion);
   233             } else {
   244             } else {
   234                 // Graal is compatible with all JDK versions as of 11 GA.
   245                 // Graal is compatible with all JDK versions as of 11 GA.
   235             }
   246             }
   236         }
   247         }
   237     }
   248     }