Path: blob/master/test/hotspot/jtreg/gc/CriticalNativeArgs.java
40930 views
/*1* Copyright (c) 2018, 2019, Red Hat, Inc. and/or its affiliates.2* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.3* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4*5* This code is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License version 2 only, as7* published by the Free Software Foundation.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*23*/2425package gc;2627/*28* @test CriticalNativeStressEpsilon29* @bug 819986830* @library /31* @requires os.arch =="x86_64" | os.arch == "amd64" | os.arch=="x86" | os.arch=="i386"32* @requires vm.gc.Epsilon33* @summary test argument unpacking nmethod wrapper of critical native method34* @run main/othervm/native -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xcomp -Xmx256M35* -XX:-CriticalJNINatives36* gc.CriticalNativeArgs37* @run main/othervm/native -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xcomp -Xmx256M38* -XX:+CriticalJNINatives39* gc.CriticalNativeArgs40*/4142/*43* @test CriticalNativeStressShenandoah44* @bug 819986845* @library /46* @requires os.arch =="x86_64" | os.arch == "amd64" | os.arch=="x86" | os.arch=="i386"47* @requires vm.gc.Shenandoah48* @summary test argument unpacking nmethod wrapper of critical native method49*50* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xcomp -Xmx512M51* -XX:+UseShenandoahGC52* -XX:-CriticalJNINatives53* gc.CriticalNativeArgs54* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xcomp -Xmx512M55* -XX:+UseShenandoahGC56* -XX:+CriticalJNINatives57* gc.CriticalNativeArgs58*59* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xcomp -Xmx512M60* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive -XX:+ShenandoahDegeneratedGC61* -XX:+CriticalJNINatives62* gc.CriticalNativeArgs63* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xcomp -Xmx512M64* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive -XX:-ShenandoahDegeneratedGC65* -XX:+CriticalJNINatives66* gc.CriticalNativeArgs67*68* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xcomp -Xmx512M69* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive70* -XX:+CriticalJNINatives71* gc.CriticalNativeArgs72*73* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xcomp -Xmx512M74* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu75* -XX:+CriticalJNINatives76* gc.CriticalNativeArgs77* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xcomp -Xmx512M78* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive79* -XX:+CriticalJNINatives80* gc.CriticalNativeArgs81*/8283/*84* @test CriticalNativeStress85* @bug 8199868 823334386* @library /87* @requires os.arch =="x86_64" | os.arch == "amd64" | os.arch=="x86" | os.arch=="i386" | os.arch=="ppc64" | os.arch=="ppc64le" | os.arch=="s390x"88* @summary test argument unpacking nmethod wrapper of critical native method89* @run main/othervm/native -Xcomp -Xmx512M90* -XX:-CriticalJNINatives91* gc.CriticalNativeArgs92* @run main/othervm/native -Xcomp -Xmx512M93* -XX:+CriticalJNINatives94* gc.CriticalNativeArgs95*/96public class CriticalNativeArgs {97public static void main(String[] args) {98int[] arr = new int[2];99100if (CriticalNative.isNull(arr)) {101throw new RuntimeException("Should not be null");102}103104if (!CriticalNative.isNull(null)) {105throw new RuntimeException("Should be null");106}107}108}109110111