JDK-8066599 : Add methods to check VM mode to c.o.j.t.Platform
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2014-12-03
  • Updated: 2016-06-12
  • Resolved: 2016-01-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b105Fixed
Related Reports
Blocks :  
Relates :  
Description
At the moment several existing tests as well as some tests on segmented code cache that will be added soon check VM mode by looking at the "java.vm.info" content.

Following methods should be added to com.oracle.java.testlibrary.Platform to simplify task of VM's mode checking:

isComp()
isMixed()
isInt()
Comments
Review thread: http://mail.openjdk.java.net/pipermail/hotspot-dev/2015-December/021270.html
22-12-2015

Something like: diff -r 1266b02f32fe test/testlibrary/com/oracle/java/testlibrary/Platform.java --- a/test/testlibrary/com/oracle/java/testlibrary/Platform.java Tue Dec 02 12:24:31 2014 -0800 +++ b/test/testlibrary/com/oracle/java/testlibrary/Platform.java Wed Dec 03 19:37:11 2014 +0400 @@ -32,6 +32,7 @@ private static final String javaVersion = System.getProperty("java.version"); private static final String osArch = System.getProperty("os.arch"); private static final String vmName = System.getProperty("java.vm.name"); + private static final String vmInfo = System.getProperty("java.vm.info"); public static boolean isClient() { return vmName.endsWith(" Client VM"); @@ -53,6 +54,18 @@ return vmName.contains("Embedded"); } + public static boolean isInt() { + return vmInfo.contains("interpreted"); + } + + public static boolean isMixed() { + return vmInfo.contains("mixed"); + } + + public static boolean isComp() { + return vmInfo.contains("compiled"); + } + public static boolean is32bit() { return dataModel.equals("32"); } diff -r 1266b02f32fe test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java --- a/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java Tue Dec 02 12:24:31 2014 -0800 +++ b/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java Wed Dec 03 19:37:11 2014 +0400 @@ -47,6 +47,7 @@ BITNESS("is32bit", "is64bit"), OS("isLinux", "isSolaris", "isWindows", "isOSX"), VM_TYPE("isClient", "isServer", "isGraal", "isMinimal"), + VM_MODE("isInt", "isMixed", "isComp"), IGNORED("isEmbedded", "isDebugBuild"); public final List<String> methodNames;
03-12-2014