--- old/src/share/vm/runtime/stubRoutines.cpp 2015-03-20 12:08:45.159997379 +0100 +++ new/src/share/vm/runtime/stubRoutines.cpp 2015-03-20 12:08:45.100998280 +0100 @@ -211,6 +211,7 @@ } } +#ifndef ZERO // simple test for SafeFetch32 static void test_safefetch32() { int dummy = 17; @@ -240,6 +241,7 @@ assert(result_valid == v1, "SafeFetchN error"); } #endif +#endif // ZERO void StubRoutines::initialize2() { if (_code2 == NULL) { @@ -330,7 +332,7 @@ // test safefetch routines // Not on Windows 32bit until 8074860 is fixed -#if ! (defined(_WIN32) && defined(_M_IX86)) +#if ! (defined(_WIN32) && defined(_M_IX86) ) && ! defined(ZERO) test_safefetch32(); test_safefetchN(); #endif --- old/src/share/vm/runtime/stubRoutines.hpp 2015-03-20 12:08:46.638974780 +0100 +++ new/src/share/vm/runtime/stubRoutines.hpp 2015-03-20 12:08:46.582975636 +0100 @@ -449,8 +449,21 @@ } -// returns true if SafeFetch32 and SafeFetchN can be used safely (stubroutines are already generated) -inline bool CanUseSafeFetch32() { return StubRoutines::SafeFetch32_stub() ? true : false; } -inline bool CanUseSafeFetchN() { return StubRoutines::SafeFetchN_stub() ? true : false; } +// returns true if SafeFetch32 and SafeFetchN can be used safely +// (stubroutines are already generated and we are not Zero) +inline bool CanUseSafeFetch32() { +#ifndef ZERO + return StubRoutines::SafeFetch32_stub() ? true : false; +#else + return false; +#endif +} +inline bool CanUseSafeFetchN() { +#ifndef ZERO + return StubRoutines::SafeFetchN_stub() ? true : false; +#else + return false; +#endif +} #endif // SHARE_VM_RUNTIME_STUBROUTINES_HPP --- old/test/compiler/startup/NumCompilerThreadsCheck.java 2015-03-20 12:08:48.344948714 +0100 +++ new/test/compiler/startup/NumCompilerThreadsCheck.java 2015-03-20 12:08:48.286949600 +0100 @@ -38,20 +38,10 @@ String expectedOutput = "CICompilerCount of -1 is invalid"; out.shouldContain(expectedOutput); - if (isZeroVm()) { + if (Platform.isZero()) { String expectedLowWaterMarkText = "must be at least 0"; out.shouldContain(expectedLowWaterMarkText); } } - private static boolean isZeroVm() { - String vmName = System.getProperty("java.vm.name"); - if (vmName == null) { - throw new RuntimeException("No VM name"); - } - if (vmName.toLowerCase().contains("zero")) { - return true; - } - return false; - } } --- old/test/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java 2015-03-20 12:08:49.505930974 +0100 +++ new/test/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java 2015-03-20 12:08:49.448931845 +0100 @@ -21,7 +21,7 @@ public static void main(String[] args) throws Exception { - if (!Platform.isDebugBuild()) { + if (!Platform.isDebugBuild() || Platform.isZero()) { return; } --- old/test/testlibrary/com/oracle/java/testlibrary/Platform.java 2015-03-20 12:08:50.733912211 +0100 +++ new/test/testlibrary/com/oracle/java/testlibrary/Platform.java 2015-03-20 12:08:50.677913067 +0100 @@ -47,6 +47,10 @@ public static boolean isGraal() { return vmName.endsWith(" Graal VM"); } + + public static boolean isZero() { + return vmName.endsWith(" Zero VM"); + } public static boolean isMinimal() { return vmName.endsWith(" Minimal VM");