--- old/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp 2017-11-22 17:37:59.109760276 +0300 +++ new/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp 2017-11-22 17:37:58.905756129 +0300 @@ -1664,7 +1664,7 @@ // critical natives they are offset down. GrowableArray arg_order(2 * total_in_args); VMRegPair tmp_vmreg; - tmp_vmreg.set1(r19->as_VMReg()); + tmp_vmreg.set2(r19->as_VMReg()); if (!is_critical_native) { for (int i = total_in_args - 1, c_arg = total_c_args - 1; i >= 0; i--, c_arg--) { --- old/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp 2017-11-22 17:37:59.725772799 +0300 +++ new/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp 2017-11-22 17:37:59.521768651 +0300 @@ -384,4 +384,6 @@ g.generate_getPsrInfo()); get_processor_features(); + + FLAG_SET_DEFAULT(CriticalJNINatives, false); } --- old/test/hotspot/jtreg/compiler/runtime/criticalnatives/argumentcorruption/CheckLongArgs.java 2017-11-22 17:38:00.193782311 +0300 +++ new/test/hotspot/jtreg/compiler/runtime/criticalnatives/argumentcorruption/CheckLongArgs.java 2017-11-22 17:38:00.001778409 +0300 @@ -24,10 +24,16 @@ /* @test * @bug 8167409 - * @run main/othervm/native -Xcomp compiler.runtime.criticalnatives.argumentcorruption.CheckLongArgs + * @library /test/lib + * @build sun.hotspot.WhiteBox + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm/native -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp compiler.runtime.criticalnatives.argumentcorruption.CheckLongArgs */ package compiler.runtime.criticalnatives.argumentcorruption; +import sun.hotspot.WhiteBox; public class CheckLongArgs { + private static final boolean CRITICAL_JNI_ON = WhiteBox.getWhiteBox().getBooleanVMFlag("CriticalJNINatives"); static { System.loadLibrary("CNCheckLongArgs"); } @@ -50,6 +56,7 @@ check(result[0]); } private static void check(byte result) throws Exception { + if (!CRITICAL_JNI_ON) return; // just check that VM doesn't crash if (result != 2) { if (result == 1) { throw new Exception("critical native arguments mismatch"); --- old/test/hotspot/jtreg/compiler/runtime/criticalnatives/lookup/LookUp.java 2017-11-22 17:38:00.673792069 +0300 +++ new/test/hotspot/jtreg/compiler/runtime/criticalnatives/lookup/LookUp.java 2017-11-22 17:38:00.477788085 +0300 @@ -24,10 +24,16 @@ /* @test * @bug 8167408 - * @run main/othervm/native -Xcomp compiler.runtime.criticalnatives.lookup.LookUp + * @library /test/lib + * @build sun.hotspot.WhiteBox + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm/native -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp compiler.runtime.criticalnatives.lookup.LookUp */ package compiler.runtime.criticalnatives.lookup; +import sun.hotspot.WhiteBox; public class LookUp { + private static final boolean CRITICAL_JNI_ON = WhiteBox.getWhiteBox().getBooleanVMFlag("CriticalJNINatives"); static { System.loadLibrary("CNLookUp"); } @@ -49,6 +55,7 @@ check(result[0]); } private static void check(byte result) throws Exception { + if (!CRITICAL_JNI_ON) return; // just check that VM doesn't crash if (result != 2) { if (result == 1) { throw new Exception("critical native arguments mismatch");