1 /* |
1 /* |
2 * Copyright (c) 2018, Red Hat, Inc. and/or its affiliates. |
2 * Copyright (c) 2018, 2019, Red Hat, Inc. and/or its affiliates. |
3 * |
3 * |
4 * This code is free software; you can redistribute it and/or modify it |
4 * This code is free software; you can redistribute it and/or modify it |
5 * under the terms of the GNU General Public License version 2 only, as |
5 * under the terms of the GNU General Public License version 2 only, as |
6 * published by the Free Software Foundation. |
6 * published by the Free Software Foundation. |
7 * |
7 * |
29 /* |
29 /* |
30 * @test CriticalNativeStressEpsilon |
30 * @test CriticalNativeStressEpsilon |
31 * @key gc |
31 * @key gc |
32 * @bug 8199868 |
32 * @bug 8199868 |
33 * @library / |
33 * @library / |
34 * @requires (os.arch =="x86_64" | os.arch == "amd64") & vm.gc.Epsilon & !vm.graal.enabled |
34 * @requires (os.arch =="x86_64" | os.arch == "amd64" | os.arch=="x86" | os.arch=="i386") & vm.gc.Epsilon & !vm.graal.enabled |
35 * @summary test argument pinning by nmethod wrapper of critical native method |
35 * @summary test argument pinning by nmethod wrapper of critical native method |
36 * @run main/othervm/native -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xcomp -Xmx1G -XX:+CriticalJNINatives gc.stress.CriticalNativeStress |
36 * @run main/othervm/native -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xcomp -Xmx1G -XX:+CriticalJNINatives gc.stress.CriticalNativeStress |
37 */ |
37 */ |
38 |
38 |
39 /* |
39 /* |
40 * @test CriticalNativeStressShenandoah |
40 * @test CriticalNativeStressShenandoah |
41 * @key gc |
41 * @key gc |
42 * @bug 8199868 |
42 * @bug 8199868 |
43 * @library / |
43 * @library / |
44 * @requires (os.arch =="x86_64" | os.arch == "amd64") & vm.gc.Shenandoah & !vm.graal.enabled |
44 * @requires (os.arch =="x86_64" | os.arch == "amd64" | os.arch=="x86" | os.arch=="i386") & vm.gc.Shenandoah & !vm.graal.enabled |
45 * @summary test argument pinning by nmethod wrapper of critical native method |
45 * @summary test argument pinning by nmethod wrapper of critical native method |
46 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=passive -XX:-ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress |
46 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive -XX:-ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress |
47 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=passive -XX:+ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress |
47 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive -XX:+ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress |
48 * |
48 * |
49 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress |
49 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress |
50 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xcomp -Xmx256M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress |
50 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xcomp -Xmx256M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress |
51 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=traversal -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress |
51 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress |
|
52 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress |
52 */ |
53 */ |
53 public class CriticalNativeStress { |
54 public class CriticalNativeStress { |
54 private static Random rand = new Random(); |
55 private static Random rand = new Random(); |
55 |
56 |
56 // CYCLES and THREAD_PER_CASE are used to tune the tests for different GC settings, |
57 // CYCLES and THREAD_PER_CASE are used to tune the tests for different GC settings, |