--- old/test/hotspot/jtreg/TEST.ROOT 2018-11-26 21:27:43.001343997 +0100 +++ new/test/hotspot/jtreg/TEST.ROOT 2018-11-26 21:27:42.846345364 +0100 @@ -46,6 +46,7 @@ vm.gc.Serial \ vm.gc.Parallel \ vm.gc.ConcMarkSweep \ + vm.gc.Shenandoah \ vm.gc.Epsilon \ vm.gc.Z \ vm.jvmci \ --- old/test/hotspot/jtreg/TEST.groups 2018-11-26 21:27:43.215342109 +0100 +++ new/test/hotspot/jtreg/TEST.groups 2018-11-26 21:27:43.063343450 +0100 @@ -168,26 +168,33 @@ :tier1_gc_1 \ :tier1_gc_2 \ :tier1_gc_gcold \ - :tier1_gc_gcbasher + :tier1_gc_gcbasher \ + :tier1_gc_shenandoah hotspot_not_fast_gc = \ :hotspot_gc \ -:tier1_gc tier1_gc_1 = \ - gc/epsilon/ \ + :gc_epsilon \ gc/g1/ \ -gc/g1/ihop/TestIHOPErgo.java tier1_gc_2 = \ gc/ \ - -gc/epsilon/ \ + -:gc_epsilon \ -gc/g1/ \ -gc/logging/TestUnifiedLoggingSwitchStress.java \ -gc/stress \ -gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java \ -gc/cms/TestMBeanCMS.java \ - -gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java + -gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java \ + -gc/shenandoah + +gc_epsilon = \ + gc/epsilon/ \ + gc/CriticalNativeArgs.java \ + gc/stress/CriticalNativeStress.java tier1_gc_gcold = \ gc/stress/gcold/TestGCOldWithG1.java \ @@ -200,6 +207,50 @@ gc/stress/gcbasher/TestGCBasherWithCMS.java \ gc/stress/gcbasher/TestGCBasherWithSerial.java \ gc/stress/gcbasher/TestGCBasherWithParallel.java + +tier1_gc_shenandoah = \ + gc/shenandoah/options/ \ + gc/shenandoah/compiler/ \ + gc/shenandoah/mxbeans/ \ + gc/shenandoah/TestSmallHeap.java \ + gc/shenandoah/oom/ \ + gc/CriticalNativeArgs.java + +tier2_gc_shenandoah = \ + :tier1_gc_shenandoah \ + runtime/MemberName/MemberNameLeak.java \ + runtime/CompressedOops/UseCompressedOops.java \ + gc/TestHumongousReferenceObject.java \ + gc/TestSystemGC.java \ + gc/arguments/TestDisableDefaultGC.java \ + gc/arguments/TestUseCompressedOopsErgo.java \ + gc/arguments/TestAlignmentToUseLargePages.java \ + gc/class_unloading/TestClassUnloadingDisabled.java \ + gc/ergonomics/TestInitialGCThreadLogging.java \ + gc/ergonomics/TestDynamicNumberOfGCThreads.java \ + gc/logging/TestGCId.java \ + gc/metaspace/TestMetaspacePerfCounters.java \ + gc/metaspace/TestMetaspacePerfCounters.java \ + gc/startup_warnings/TestShenandoah.java \ + gc/TestFullGCALot.java \ + gc/logging/TestUnifiedLoggingSwitchStress.java \ + runtime/Metaspace/DefineClass.java \ + gc/shenandoah/ \ + serviceability/sa/TestHeapDumpForInvokeDynamic.java \ + -gc/shenandoah/ShenandoahStrDedupStress.java \ + -gc/stress/CriticalNativeStress.java + +shenandoah_stress = \ + gc/stress/gcold/TestGCOldWithShenandoah.java \ + gc/stress/gcbasher/TestGCBasherWithShenandoah.java \ + gc/stress/gclocker/TestGCLockerWithShenandoah.java \ + gc/stress/systemgc/TestSystemGCWithShenandoah.java \ + gc/shenandoah/ShenandoahStrDedupStress.java \ + gc/stress/CriticalNativeStress.java + +tier3_gc_shenandoah = \ + :tier2_gc_shenandoah \ + :shenandoah_stress tier1_runtime = \ runtime/ \ --- old/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java 2018-11-26 21:27:43.438340141 +0100 +++ new/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java 2018-11-26 21:27:43.280341535 +0100 @@ -39,7 +39,9 @@ * CMS, * CMSCondMark, * Serial, - * Parallel} + * Parallel, + * Shenandoah, + * ShenandoahTraversal} */ @@ -100,6 +102,19 @@ procArgs[argcount - 3] = "-XX:+UseConcMarkSweepGC"; procArgs[argcount - 2] = "-XX:+UseCondCardMark"; break; + case "Shenandoah": + argcount = 10; + procArgs = new String[argcount]; + procArgs[argcount - 3] = "-XX:+UnlockExperimentalVMOptions"; + procArgs[argcount - 2] = "-XX:+UseShenandoahGC"; + break; + case "ShenandoahTraversal": + argcount = 11; + procArgs = new String[argcount]; + procArgs[argcount - 4] = "-XX:+UnlockExperimentalVMOptions"; + procArgs[argcount - 3] = "-XX:+UseShenandoahGC"; + procArgs[argcount - 2] = "-XX:ShenandoahGCHeuristics=traversal"; + break; default: throw new RuntimeException("unexpected test type " + testType); } @@ -355,6 +370,17 @@ "ret" }; break; + case "Shenandoah": + case "ShenandoahTraversal": + // Shenandoah generates normal object graphs for + // volatile stores + matches = new String[] { + "membar_release \\(elided\\)", + useCompressedOops ? "stlrw?" : "stlr", + "membar_volatile \\(elided\\)", + "ret" + }; + break; } } else { switch (testType) { @@ -418,6 +444,20 @@ "ret" }; break; + + case "Shenandoah": + case "ShenandoahTraversal": + // Shenandoah generates normal object graphs for + // volatile stores + matches = new String[] { + "membar_release", + "dmb ish", + useCompressedOops ? "strw?" : "str", + "membar_volatile", + "dmb ish", + "ret" + }; + break; } } @@ -520,6 +560,17 @@ "ret" }; break; + case "Shenandoah": + case "ShenandoahTraversal": + // For volatile CAS, Shenanodoah generates normal + // graphs with a shenandoah-specific cmpxchg + matches = new String[] { + "membar_release \\(elided\\)", + useCompressedOops ? "cmpxchgw?_acq_shenandoah" : "cmpxchg_acq_shenandoah", + "membar_acquire \\(elided\\)", + "ret" + }; + break; } } else { switch (testType) { @@ -583,6 +634,19 @@ "ret" }; break; + case "Shenandoah": + case "ShenandoahTraversal": + // For volatile CAS, Shenanodoah generates normal + // graphs with a shenandoah-specific cmpxchg + matches = new String[] { + "membar_release", + "dmb ish", + useCompressedOops ? "cmpxchgw?_shenandoah" : "cmpxchg_shenandoah", + "membar_acquire", + "dmb ish", + "ret" + }; + break; } } @@ -701,6 +765,17 @@ "ret" }; break; + case "Shenandoah": + case "ShenandoahTraversal": + // For volatile CAS, Shenanodoah generates normal + // graphs with a shenandoah-specific cmpxchg + matches = new String[] { + "membar_release \\(elided\\)", + useCompressedOops ? "cmpxchgw?_acq_shenandoah" : "cmpxchg_acq_shenandoah", + "membar_acquire \\(elided\\)", + "ret" + }; + break; } } else { switch (testType) { @@ -764,6 +839,19 @@ "ret" }; break; + case "Shenandoah": + case "ShenandoahTraversal": + // For volatile CAS, Shenanodoah generates normal + // graphs with a shenandoah-specific cmpxchg + matches = new String[] { + "membar_release", + "dmb ish", + useCompressedOops ? "cmpxchgw?_shenandoah" : "cmpxchg_shenandoah", + "membar_acquire", + "dmb ish", + "ret" + }; + break; } } @@ -862,6 +950,15 @@ "ret" }; break; + case "Shenandoah": + case "ShenandoahTraversal": + matches = new String[] { + "membar_release \\(elided\\)", + useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq", + "membar_acquire \\(elided\\)", + "ret" + }; + break; } } else { switch (testType) { @@ -923,6 +1020,17 @@ "membar_acquire", "dmb ish", "ret" + }; + break; + case "Shenandoah": + case "ShenandoahTraversal": + matches = new String[] { + "membar_release", + "dmb ish", + useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ", + "membar_acquire", + "dmb ish", + "ret" }; break; } --- /dev/null 2018-11-26 11:49:18.255023023 +0100 +++ new/test/hotspot/jtreg/gc/CriticalNativeArgs.java 2018-11-26 21:27:43.516339453 +0100 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. and/or its affiliates. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + + +/* + * @test CriticalNativeStress + * @key gc + * @bug 8199868 + * @requires (os.arch =="x86_64" | os.arch == "amd64") & (vm.bits == "64") & vm.gc.Epsilon & !vm.graal.enabled + * @requires (os.arch =="x86_64" | os.arch == "amd64") & (vm.bits == "64") & vm.gc.Shenandoah & !vm.graal.enabled + * @summary test argument unpacking nmethod wrapper of critical native method + * @run main/othervm/native -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xcomp -Xmx256M -XX:+CriticalJNINatives CriticalNativeArgs + * + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=passive -XX:+ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives CriticalNativeArgs + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=passive -XX:-ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives CriticalNativeArgs + * + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives CriticalNativeArgs + * + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xcomp -Xmx256M -XX:+CriticalJNINatives CriticalNativeArgs + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCHeuristics=traversal -Xcomp -Xmx512M -XX:+CriticalJNINatives CriticalNativeArgs + */ +public class CriticalNativeArgs { + static { + System.loadLibrary("CriticalNative"); + } + + static native boolean isNull(int[] a); + + public static void main(String[] args) { + int[] arr = new int[2]; + + if (isNull(arr)) { + throw new RuntimeException("Should not be null"); + } + + if (!isNull(null)) { + throw new RuntimeException("Should be null"); + } + } +} + --- old/test/hotspot/jtreg/gc/TestFullGCCount.java 2018-11-26 21:27:43.908335994 +0100 +++ new/test/hotspot/jtreg/gc/TestFullGCCount.java 2018-11-26 21:27:43.756337335 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ * @bug 7072527 * @summary CMS: JMM GC counters overcount in some cases * @requires !(vm.gc.ConcMarkSweep & vm.opt.ExplicitGCInvokesConcurrent == true) + * @requires !(vm.gc == "Shenandoah" & !(vm.opt.ExplicitGCInvokesConcurrent == false)) * @modules java.management * @run main/othervm -Xlog:gc TestFullGCCount */ --- old/test/hotspot/jtreg/gc/TestHumongousReferenceObject.java 2018-11-26 21:27:44.131334026 +0100 +++ new/test/hotspot/jtreg/gc/TestHumongousReferenceObject.java 2018-11-26 21:27:43.973335420 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,8 @@ * @run main/othervm -XX:+EnableContended -XX:-RestrictContended -Xmx128m -XX:+UseG1GC -XX:G1HeapRegionSize=2M -XX:ContendedPaddingWidth=8192 TestHumongousReferenceObject * @run main/othervm -XX:+EnableContended -XX:-RestrictContended -Xmx128m -XX:+UseG1GC -XX:G1HeapRegionSize=4M -XX:ContendedPaddingWidth=8192 TestHumongousReferenceObject * @run main/othervm -XX:+EnableContended -XX:-RestrictContended -Xmx128m -XX:+UseG1GC -XX:G1HeapRegionSize=8M -XX:ContendedPaddingWidth=8192 TestHumongousReferenceObject + * @run main/othervm -XX:+EnableContended -XX:-RestrictContended -Xmx128m -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahHeapRegionSize=8M -XX:ContendedPaddingWidth=8192 TestHumongousReferenceObject + * @run main/othervm -XX:+EnableContended -XX:-RestrictContended -Xmx128m -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahHeapRegionSize=8M -XX:ContendedPaddingWidth=8192 -XX:+UnlockDiagnosticVMOptions -XX:+ShenandoahVerify TestHumongousReferenceObject */ public class TestHumongousReferenceObject { --- old/test/hotspot/jtreg/gc/TestSystemGC.java 2018-11-26 21:27:44.353332067 +0100 +++ new/test/hotspot/jtreg/gc/TestSystemGC.java 2018-11-26 21:27:44.200333417 +0100 @@ -34,6 +34,8 @@ * @run main/othervm -XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent TestSystemGC * @run main/othervm -XX:+UseLargePages TestSystemGC * @run main/othervm -XX:+UseLargePages -XX:+UseLargePagesInMetaspace TestSystemGC + * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC TestSystemGC + * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+ExplicitGCInvokesConcurrent TestSystemGC */ /* --- old/test/hotspot/jtreg/gc/arguments/TestAlignmentToUseLargePages.java 2018-11-26 21:27:44.572330134 +0100 +++ new/test/hotspot/jtreg/gc/arguments/TestAlignmentToUseLargePages.java 2018-11-26 21:27:44.416331511 +0100 @@ -48,6 +48,16 @@ * @run main/othervm -Xms71M -Xmx91M -XX:+UseConcMarkSweepGC -XX:-UseLargePages TestAlignmentToUseLargePages */ +/** + * @test TestAlignmentToUseLargePagesShenandoah + * @key gc + * @bug 8024396 + * @comment Graal does not support Shenandoah + * @requires vm.gc=="null" & !vm.graal.enabled + * @run main/othervm -Xms71M -Xmx91M -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseLargePages TestAlignmentToUseLargePages + * @run main/othervm -Xms71M -Xmx91M -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:-UseLargePages TestAlignmentToUseLargePages + */ + public class TestAlignmentToUseLargePages { public static void main(String args[]) throws Exception { // nothing to do --- old/test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java 2018-11-26 21:27:44.794328175 +0100 +++ new/test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java 2018-11-26 21:27:44.638329552 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,6 +44,7 @@ "-XX:-UseG1GC", "-XX:-UseConcMarkSweepGC", "-XX:+UnlockExperimentalVMOptions", + "-XX:-UseShenandoahGC", "-XX:-UseZGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); --- old/test/hotspot/jtreg/gc/arguments/TestMaxMinHeapFreeRatioFlags.java 2018-11-26 21:27:45.015326225 +0100 +++ new/test/hotspot/jtreg/gc/arguments/TestMaxMinHeapFreeRatioFlags.java 2018-11-26 21:27:44.858327611 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ * @test TestMaxMinHeapFreeRatioFlags * @key gc * @summary Verify that heap size changes according to max and min heap free ratios. - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @library /test/lib * @modules java.base/jdk.internal.misc * java.management --- old/test/hotspot/jtreg/gc/arguments/TestNewRatioFlag.java 2018-11-26 21:27:45.237324266 +0100 +++ new/test/hotspot/jtreg/gc/arguments/TestNewRatioFlag.java 2018-11-26 21:27:45.083325625 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @key gc * @bug 8025166 * @summary Verify that heap devided among generations according to NewRatio - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @library /test/lib * @modules java.base/jdk.internal.misc * java.management --- old/test/hotspot/jtreg/gc/arguments/TestNewSizeFlags.java 2018-11-26 21:27:45.453322360 +0100 +++ new/test/hotspot/jtreg/gc/arguments/TestNewSizeFlags.java 2018-11-26 21:27:45.299323719 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @key gc * @bug 8025166 * @summary Verify that young gen size conforms values specified by NewSize, MaxNewSize and Xmn options - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @library /test/lib * @modules java.base/jdk.internal.misc * java.management --- old/test/hotspot/jtreg/gc/arguments/TestShrinkHeapInSteps.java 2018-11-26 21:27:45.678320375 +0100 +++ new/test/hotspot/jtreg/gc/arguments/TestShrinkHeapInSteps.java 2018-11-26 21:27:45.521321760 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ * @test TestShrinkHeapInSteps * @key gc * @summary Verify that -XX:-ShrinkHeapInSteps works properly. - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @library /test/lib * @modules java.base/jdk.internal.misc * java.management --- old/test/hotspot/jtreg/gc/arguments/TestSurvivorRatioFlag.java 2018-11-26 21:27:45.890318504 +0100 +++ new/test/hotspot/jtreg/gc/arguments/TestSurvivorRatioFlag.java 2018-11-26 21:27:45.740319828 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ * @test TestSurvivorRatioFlag * @key gc * @summary Verify that actual survivor ratio is equal to specified SurvivorRatio value - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @library /test/lib * @modules java.base/jdk.internal.misc * java.management --- old/test/hotspot/jtreg/gc/arguments/TestTargetSurvivorRatioFlag.java 2018-11-26 21:27:46.114316528 +0100 +++ new/test/hotspot/jtreg/gc/arguments/TestTargetSurvivorRatioFlag.java 2018-11-26 21:27:45.955317931 +0100 @@ -27,7 +27,7 @@ * @summary Verify that option TargetSurvivorRatio affects survivor space occupancy after minor GC. * @requires vm.opt.ExplicitGCInvokesConcurrent != true * @requires vm.opt.UseJVMCICompiler != true - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @library /test/lib * @modules java.base/jdk.internal.misc * java.management --- old/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsErgo.java 2018-11-26 21:27:46.337314560 +0100 +++ new/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsErgo.java 2018-11-26 21:27:46.182315928 +0100 @@ -54,6 +54,21 @@ * @run main/othervm TestUseCompressedOopsErgo -XX:+UseConcMarkSweepGC */ +/* + * @test TestUseCompressedOopsErgoShenandoah + * @key gc + * @bug 8010722 + * @comment Graal does not support Shenandoah + * @requires vm.gc=="null" & !vm.graal.enabled + * @library /test/lib + * @modules java.base/jdk.internal.misc + * java.management/sun.management + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm TestUseCompressedOopsErgo -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC + */ + public class TestUseCompressedOopsErgo { public static void main(String args[]) throws Exception { --- old/test/hotspot/jtreg/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java 2018-11-26 21:27:46.556312628 +0100 +++ new/test/hotspot/jtreg/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java 2018-11-26 21:27:46.401313995 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,7 @@ * @summary Runs an simple application (GarbageProducer) with various combinations of -XX:{+|-}Verify{After|Before}GC flags and checks that output contain or doesn't contain expected patterns - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @modules java.base/jdk.internal.misc * @modules java.management * @library /test/lib --- old/test/hotspot/jtreg/gc/class_unloading/TestClassUnloadingDisabled.java 2018-11-26 21:27:46.773310713 +0100 +++ new/test/hotspot/jtreg/gc/class_unloading/TestClassUnloadingDisabled.java 2018-11-26 21:27:46.624312028 +0100 @@ -64,6 +64,24 @@ * -XX:-ClassUnloading -XX:+UseConcMarkSweepGC TestClassUnloadingDisabled */ +/* + * @test + * @key gc + * @bug 8114823 + * @comment Graal does not support Shenandoah + * @requires vm.gc=="null" & !vm.graal.enabled + * @requires vm.opt.ExplicitGCInvokesConcurrent != true + * @requires vm.opt.ClassUnloading != true + * @library /test/lib + * @modules java.base/jdk.internal.misc + * java.management + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:-ClassUnloading -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC TestClassUnloadingDisabled + */ + import java.io.File; import java.io.IOException; import java.nio.file.Files; --- old/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java 2018-11-26 21:27:46.991308789 +0100 +++ new/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java 2018-11-26 21:27:46.839310130 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,6 +42,8 @@ testDynamicNumberOfGCThreads("UseG1GC"); testDynamicNumberOfGCThreads("UseParallelGC"); + + testDynamicNumberOfGCThreads("UseShenandoahGC"); } private static void verifyDynamicNumberOfGCThreads(OutputAnalyzer output) { @@ -51,7 +53,7 @@ private static void testDynamicNumberOfGCThreads(String gcFlag) throws Exception { // UseDynamicNumberOfGCThreads and TraceDynamicGCThreads enabled - String[] baseArgs = {"-XX:+" + gcFlag, "-Xmx10M", "-XX:+UseDynamicNumberOfGCThreads", "-Xlog:gc+task=trace", GCTest.class.getName()}; + String[] baseArgs = {"-XX:+UnlockExperimentalVMOptions", "-XX:+" + gcFlag, "-Xmx10M", "-XX:+UseDynamicNumberOfGCThreads", "-Xlog:gc+task=trace", GCTest.class.getName()}; // Base test with gc and +UseDynamicNumberOfGCThreads: ProcessBuilder pb_enabled = ProcessTools.createJavaProcessBuilder(baseArgs); --- old/test/hotspot/jtreg/gc/ergonomics/TestInitialGCThreadLogging.java 2018-11-26 21:27:47.210306857 +0100 +++ new/test/hotspot/jtreg/gc/ergonomics/TestInitialGCThreadLogging.java 2018-11-26 21:27:47.057308207 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,6 +42,8 @@ testInitialGCThreadLogging("UseG1GC", "GC Thread"); testInitialGCThreadLogging("UseParallelGC", "ParGC Thread"); + + testInitialGCThreadLogging("UseShenandoahGC", "Shenandoah GC Thread"); } private static void verifyDynamicNumberOfGCThreads(OutputAnalyzer output, String threadName) { @@ -51,7 +53,7 @@ private static void testInitialGCThreadLogging(String gcFlag, String threadName) throws Exception { // UseDynamicNumberOfGCThreads and TraceDynamicGCThreads enabled - String[] baseArgs = {"-XX:+" + gcFlag, "-Xmx10M", "-XX:+UseDynamicNumberOfGCThreads", "-Xlog:gc+task=trace", "-version"}; + String[] baseArgs = {"-XX:+UnlockExperimentalVMOptions", "-XX:+" + gcFlag, "-Xmx10M", "-XX:+UseDynamicNumberOfGCThreads", "-Xlog:gc+task=trace", "-version"}; // Base test with gc and +UseDynamicNumberOfGCThreads: ProcessBuilder pb_enabled = ProcessTools.createJavaProcessBuilder(baseArgs); --- /dev/null 2018-11-26 11:49:18.255023023 +0100 +++ new/test/hotspot/jtreg/gc/libCriticalNative.c 2018-11-26 21:27:47.275306283 +0100 @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. and/or its affiliates. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "jni.h" + +JNIEXPORT jlong JNICALL JavaCritical_CriticalNativeStress_sum1 + (jint length, jlong* a) { + jlong sum = 0; + jint index; + for (index = 0; index < length; index ++) { + sum += a[index]; + } + + return sum; +} + +JNIEXPORT jlong JNICALL JavaCritical_CriticalNativeStress_sum2 + (jlong a1, jint a2_length, jint* a2, jint a4_length, jint* a4, jint a6_length, jlong* a6, jint a8_length, jint* a8) { + jlong sum = a1; + jint index; + for (index = 0; index < a2_length; index ++) { + sum += a2[index]; + } + + for (index = 0; index < a4_length; index ++) { + sum += a4[index]; + } + + for (index = 0; index < a6_length; index ++) { + sum += a6[index]; + } + + for (index = 0; index < a8_length; index ++) { + sum += a8[index]; + } + return sum; +} + +JNIEXPORT jlong JNICALL Java_CriticalNativeStress_sum1 + (JNIEnv *env, jclass jclazz, jlongArray a) { + jlong sum = 0; + jsize len = (*env)->GetArrayLength(env, a); + jsize index; + jlong* arr = (jlong*)(*env)->GetPrimitiveArrayCritical(env, a, 0); + for (index = 0; index < len; index ++) { + sum += arr[index]; + } + + (*env)->ReleasePrimitiveArrayCritical(env, a, arr, 0); + return sum; +} + +JNIEXPORT jlong JNICALL Java_CriticalNativeStress_sum2 + (JNIEnv *env, jclass jclazz, jlong a1, jintArray a2, jintArray a3, jlongArray a4, jintArray a5) { + jlong sum = a1; + jsize index; + jsize len; + jint* a2_arr; + jint* a3_arr; + jlong* a4_arr; + jint* a5_arr; + + len = (*env)->GetArrayLength(env, a2); + a2_arr = (jint*)(*env)->GetPrimitiveArrayCritical(env, a2, 0); + for (index = 0; index < len; index ++) { + sum += a2_arr[index]; + } + (*env)->ReleasePrimitiveArrayCritical(env, a2, a2_arr, 0); + + len = (*env)->GetArrayLength(env, a3); + a3_arr = (jint*)(*env)->GetPrimitiveArrayCritical(env, a3, 0); + for (index = 0; index < len; index ++) { + sum += a3_arr[index]; + } + (*env)->ReleasePrimitiveArrayCritical(env, a3, a3_arr, 0); + + len = (*env)->GetArrayLength(env, a4); + a4_arr = (jlong*)(*env)->GetPrimitiveArrayCritical(env, a4, 0); + for (index = 0; index < len; index ++) { + sum += a4_arr[index]; + } + (*env)->ReleasePrimitiveArrayCritical(env, a4, a4_arr, 0); + + len = (*env)->GetArrayLength(env, a5); + a5_arr = (jint*)(*env)->GetPrimitiveArrayCritical(env, a5, 0); + for (index = 0; index < len; index ++) { + sum += a5_arr[index]; + } + (*env)->ReleasePrimitiveArrayCritical(env, a5, a5_arr, 0); + + return sum; +} + + +JNIEXPORT jboolean JNICALL JavaCritical_CriticalNativeArgs_isNull + (jint length, jint* a) { + return (a == NULL) && (length == 0); +} + +JNIEXPORT jboolean JNICALL Java_CriticalNativeArgs_isNull + (JNIEnv *env, jclass jclazz, jintArray a) { + jboolean is_null; + jsize len = (*env)->GetArrayLength(env, a); + jint* arr = (jint*)(*env)->GetPrimitiveArrayCritical(env, a, 0); + is_null = (arr == NULL) && (len == 0); + (*env)->ReleasePrimitiveArrayCritical(env, a, arr, 0); + return is_null; +} + --- old/test/hotspot/jtreg/gc/logging/TestGCId.java 2018-11-26 21:27:47.667302824 +0100 +++ new/test/hotspot/jtreg/gc/logging/TestGCId.java 2018-11-26 21:27:47.515304165 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,6 +41,7 @@ testGCId("UseG1GC"); testGCId("UseConcMarkSweepGC"); testGCId("UseSerialGC"); + testGCId("UseShenandoahGC"); } private static void verifyContainsGCIDs(OutputAnalyzer output) { @@ -51,7 +52,7 @@ private static void testGCId(String gcFlag) throws Exception { ProcessBuilder pb_default = - ProcessTools.createJavaProcessBuilder("-XX:+" + gcFlag, "-Xlog:gc", "-Xmx10M", GCTest.class.getName()); + ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+" + gcFlag, "-Xlog:gc", "-Xmx10M", GCTest.class.getName()); verifyContainsGCIDs(new OutputAnalyzer(pb_default.start())); } --- old/test/hotspot/jtreg/gc/metaspace/TestMetaspacePerfCounters.java 2018-11-26 21:27:47.883300918 +0100 +++ new/test/hotspot/jtreg/gc/metaspace/TestMetaspacePerfCounters.java 2018-11-26 21:27:47.731302259 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,10 +48,12 @@ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseSerialGC TestMetaspacePerfCounters * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseParallelGC -XX:+UseParallelOldGC TestMetaspacePerfCounters * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseG1GC TestMetaspacePerfCounters + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC TestMetaspacePerfCounters * * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseSerialGC TestMetaspacePerfCounters * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseParallelGC -XX:+UseParallelOldGC TestMetaspacePerfCounters * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseG1GC TestMetaspacePerfCounters + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC TestMetaspacePerfCounters */ public class TestMetaspacePerfCounters { public static Class fooClass = null; --- /dev/null 2018-11-26 11:49:18.255023023 +0100 +++ new/test/hotspot/jtreg/gc/stress/CriticalNativeStress.java 2018-11-26 21:27:47.951300318 +0100 @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. and/or its affiliates. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +import java.util.Random; + +/* + * @test CriticalNativeStress + * @key gc + * @bug 8199868 + * @requires (os.arch =="x86_64" | os.arch == "amd64") & (vm.bits == "64") & vm.gc.Epsilon & !vm.graal.enabled + * @requires (os.arch =="x86_64" | os.arch == "amd64") & (vm.bits == "64") & vm.gc.Shenandoah & !vm.graal.enabled + * @summary test argument pinning by nmethod wrapper of critical native method + * @run main/othervm/native -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xcomp -Xmx1G -XX:+CriticalJNINatives CriticalNativeStress + * + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=passive -XX:+ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives CriticalNativeStress + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=passive -XX:-ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives CriticalNativeStress + * + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives CriticalNativeStress + * + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xcomp -Xmx256M -XX:+CriticalJNINatives CriticalNativeStress + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=traversal -Xcomp -Xmx512M -XX:+CriticalJNINatives CriticalNativeStress + */ +public class CriticalNativeStress { + private static Random rand = new Random(); + static { + System.loadLibrary("CriticalNative"); + } + + // CYCLES and THREAD_PER_CASE are used to tune the tests for different GC settings, + // so that they can execrise enough GC cycles and not OOM + private static int CYCLES = Integer.getInteger("cycles", 3); + private static int THREAD_PER_CASE = Integer.getInteger("threadPerCase", 1); + + static native long sum1(long[] a); + + // More than 6 parameters + static native long sum2(long a1, int[] a2, int[] a3, long[] a4, int[] a5); + + static long sum(long[] a) { + long sum = 0; + for (int index = 0; index < a.length; index ++) { + sum += a[index]; + } + return sum; + } + + static long sum(int[] a) { + long sum = 0; + for (int index = 0; index < a.length; index ++) { + sum += a[index]; + } + return sum; + } + + private static volatile String garbage_array[]; + + // GC potentially moves arrays passed to critical native methods + // if they are not pinned correctly. + // Create enough garbages to exercise GC cycles, verify + // the arrays are pinned correctly. + static void create_garbage(int len) { + len = Math.max(len, 1024); + String array[] = new String[len]; + for (int index = 0; index < len; index ++) { + array[index] = "String " + index; + } + garbage_array = array; + } + + // Two test cases with different method signatures: + // Tests generate arbitrary length of arrays with + // arbitrary values, then calcuate sum of the array + // elements with critical native JNI methods and java + // methods, and compare the results for correctness. + static void run_test_case1() { + // Create testing arary with arbitrary length and + // values + int length = rand.nextInt(50) + 1; + long[] arr = new long[length]; + for (int index = 0; index < length; index ++) { + arr[index] = rand.nextLong() % 1002; + } + + // Generate garbages to trigger GCs + for (int index = 0; index < length; index ++) { + create_garbage(index); + } + + // Compare results for correctness. + long native_sum = sum1(arr); + long java_sum = sum(arr); + if (native_sum != java_sum) { + StringBuffer sb = new StringBuffer("Sums do not match: native = ") + .append(native_sum).append(" java = ").append(java_sum); + + throw new RuntimeException(sb.toString()); + } + } + + static void run_test_case2() { + // Create testing arary with arbitrary length and + // values + int index; + long a1 = rand.nextLong() % 1025; + + int a2_length = rand.nextInt(50) + 1; + int[] a2 = new int[a2_length]; + for (index = 0; index < a2_length; index ++) { + a2[index] = rand.nextInt(106); + } + + int a3_length = rand.nextInt(150) + 1; + int[] a3 = new int[a3_length]; + for (index = 0; index < a3_length; index ++) { + a3[index] = rand.nextInt(3333); + } + + int a4_length = rand.nextInt(200) + 1; + long[] a4 = new long[a4_length]; + for (index = 0; index < a4_length; index ++) { + a4[index] = rand.nextLong() % 122; + } + + int a5_length = rand.nextInt(350) + 1; + int[] a5 = new int[a5_length]; + for (index = 0; index < a5_length; index ++) { + a5[index] = rand.nextInt(333); + } + + // Generate garbages to trigger GCs + for (index = 0; index < a1; index ++) { + create_garbage(index); + } + + // Compare results for correctness. + long native_sum = sum2(a1, a2, a3, a4, a5); + long java_sum = a1 + sum(a2) + sum(a3) + sum(a4) + sum(a5); + if (native_sum != java_sum) { + StringBuffer sb = new StringBuffer("Sums do not match: native = ") + .append(native_sum).append(" java = ").append(java_sum); + + throw new RuntimeException(sb.toString()); + } + } + + static class Case1Runner extends Thread { + public Case1Runner() { + start(); + } + + public void run() { + for (int index = 0; index < CYCLES; index ++) { + run_test_case1(); + } + } + } + + static class Case2Runner extends Thread { + public Case2Runner() { + start(); + } + + public void run() { + for (int index = 0; index < CYCLES; index ++) { + run_test_case2(); + } + } + } + + public static void main(String[] args) { + Thread[] thrs = new Thread[THREAD_PER_CASE * 2]; + for (int index = 0; index < thrs.length; index = index + 2) { + thrs[index] = new Case1Runner(); + thrs[index + 1] = new Case2Runner(); + } + + for (int index = 0; index < thrs.length; index ++) { + try { + thrs[index].join(); + } catch (Exception e) { + e.printStackTrace(); + } + } + } +} + --- old/test/hotspot/jtreg/gc/survivorAlignment/TestAllocationInEden.java 2018-11-26 21:27:48.347296824 +0100 +++ new/test/hotspot/jtreg/gc/survivorAlignment/TestAllocationInEden.java 2018-11-26 21:27:48.195298165 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @bug 8031323 * @summary Verify that object's alignment in eden space is not affected by * SurvivorAlignmentInBytes option. - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @library /test/lib * @modules java.base/jdk.internal.misc * java.management --- old/test/hotspot/jtreg/gc/survivorAlignment/TestPromotionFromEdenToTenured.java 2018-11-26 21:27:48.562294926 +0100 +++ new/test/hotspot/jtreg/gc/survivorAlignment/TestPromotionFromEdenToTenured.java 2018-11-26 21:27:48.410296267 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @bug 8031323 * @summary Verify that objects promoted from eden space to tenured space during * full GC are not aligned to SurvivorAlignmentInBytes value. - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @library /test/lib * @modules java.base/jdk.internal.misc * java.management --- old/test/hotspot/jtreg/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java 2018-11-26 21:27:48.785292958 +0100 +++ new/test/hotspot/jtreg/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java 2018-11-26 21:27:48.629294335 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @bug 8031323 * @summary Verify that objects promoted from survivor space to tenured space * during full GC are not aligned to SurvivorAlignmentInBytes value. - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @library /test/lib * @modules java.base/jdk.internal.misc * java.management --- old/test/hotspot/jtreg/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java 2018-11-26 21:27:48.999291070 +0100 +++ new/test/hotspot/jtreg/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java 2018-11-26 21:27:48.849292394 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,7 @@ * @summary Verify that objects promoted from survivor space to tenured space * when their age exceeded tenuring threshold are not aligned to * SurvivorAlignmentInBytes value. - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @library /test/lib * @modules java.base/jdk.internal.misc * java.management --- old/test/hotspot/jtreg/gc/survivorAlignment/TestPromotionToSurvivor.java 2018-11-26 21:27:49.219289129 +0100 +++ new/test/hotspot/jtreg/gc/survivorAlignment/TestPromotionToSurvivor.java 2018-11-26 21:27:49.064290496 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @bug 8031323 * @summary Verify that objects promoted from eden space to survivor space after * minor GC are aligned to SurvivorAlignmentInBytes. - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @library /test/lib * @modules java.base/jdk.internal.misc * java.management --- old/test/hotspot/jtreg/gc/whitebox/TestWBGC.java 2018-11-26 21:27:49.439287188 +0100 +++ new/test/hotspot/jtreg/gc/whitebox/TestWBGC.java 2018-11-26 21:27:49.284288555 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ * @test TestWBGC * @bug 8055098 * @summary Test verify that WB methods isObjectInOldGen and youngGC works correctly. - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @library /test/lib * @modules java.base/jdk.internal.misc * java.management --- old/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java 2018-11-26 21:27:49.657285264 +0100 +++ new/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java 2018-11-26 21:27:49.504286614 +0100 @@ -61,6 +61,7 @@ testCompressedOopsModes(args, "-XX:+UseSerialGC"); testCompressedOopsModes(args, "-XX:+UseParallelGC"); testCompressedOopsModes(args, "-XX:+UseParallelOldGC"); + testCompressedOopsModes(args, "-XX:+UseShenandoahGC"); } public static void testCompressedOopsModes(ArrayList flags1, String... flags2) throws Exception { --- old/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java 2018-11-26 21:27:49.877283323 +0100 +++ new/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java 2018-11-26 21:27:49.724284673 +0100 @@ -76,6 +76,7 @@ // Run this Leak class with logging ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-Xlog:membername+table=trace", + "-XX:+UnlockExperimentalVMOptions", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-Xbootclasspath/a:.", @@ -99,6 +100,8 @@ if (!Compiler.isGraalEnabled()) { // Graal does not support CMS test("-XX:+UseConcMarkSweepGC", false); test("-XX:+UseConcMarkSweepGC", true); + test("-XX:+UseShenandoahGC", true); + test("-XX:+UseShenandoahGC", false); } } } --- old/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCapacityTest.java 2018-11-26 21:27:50.095281399 +0100 +++ new/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCapacityTest.java 2018-11-26 21:27:49.942282749 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,7 @@ * @test * @summary Test checks the consistency of the output * displayed with jstat -gccapacity. - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @modules java.base/jdk.internal.misc * @library /test/lib * @library ../share --- old/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCauseTest01.java 2018-11-26 21:27:50.314279467 +0100 +++ new/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCauseTest01.java 2018-11-26 21:27:50.159280834 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ * @library /test/lib * @library ../share * @requires vm.opt.ExplicitGCInvokesConcurrent != true - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @run main/othervm -XX:+UsePerfData -Xmx128M GcCauseTest01 */ import utils.*; --- old/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCauseTest02.java 2018-11-26 21:27:50.535277516 +0100 +++ new/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCauseTest02.java 2018-11-26 21:27:50.378278902 +0100 @@ -28,7 +28,7 @@ * test forces debuggee application eat ~70% of heap and runs jstat. * jstat should show actual usage of old gen (OC/OU ~= old gen usage). * @requires vm.opt.ExplicitGCInvokesConcurrent != true - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @modules java.base/jdk.internal.misc * @library /test/lib * @library ../share --- old/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCauseTest03.java 2018-11-26 21:27:50.750275619 +0100 +++ new/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCauseTest03.java 2018-11-26 21:27:50.597276969 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,7 @@ * Test scenario: * test forces debuggee application call System.gc(), runs jstat and checks that * cause of last garbage collection displayed by jstat (LGCC) is 'System.gc()'. - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @modules java.base/jdk.internal.misc * @library /test/lib * @library ../share --- old/test/hotspot/jtreg/serviceability/tmtools/jstat/GcNewTest.java 2018-11-26 21:27:50.964273731 +0100 +++ new/test/hotspot/jtreg/serviceability/tmtools/jstat/GcNewTest.java 2018-11-26 21:27:50.813275063 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ * test several times provokes garbage collection in the debuggee application and after each garbage * collection runs jstat. jstat should show that after garbage collection number of GC events and garbage * collection time increase. - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @modules java.base/jdk.internal.misc * @library /test/lib * @library ../share --- old/test/hotspot/jtreg/serviceability/tmtools/jstat/GcTest01.java 2018-11-26 21:27:51.185271781 +0100 +++ new/test/hotspot/jtreg/serviceability/tmtools/jstat/GcTest01.java 2018-11-26 21:27:51.028273166 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,7 @@ * @library /test/lib * @library ../share * @requires vm.opt.ExplicitGCInvokesConcurrent != true - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @run main/othervm -XX:+UsePerfData -Xmx128M GcTest01 */ import utils.*; --- old/test/hotspot/jtreg/serviceability/tmtools/jstat/GcTest02.java 2018-11-26 21:27:51.406269830 +0100 +++ new/test/hotspot/jtreg/serviceability/tmtools/jstat/GcTest02.java 2018-11-26 21:27:51.248271224 +0100 @@ -28,7 +28,7 @@ * test forces debuggee application eat ~70% of heap and runs jstat. * jstat should show actual usage of old gen (OC/OU ~= old gen usage). * @requires vm.opt.ExplicitGCInvokesConcurrent != true - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @modules java.base/jdk.internal.misc * @library /test/lib * @library ../share --- old/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/general_functions/GF08/gf08t001/TestDriver.java 2018-11-26 21:27:51.632267836 +0100 +++ new/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/general_functions/GF08/gf08t001/TestDriver.java 2018-11-26 21:27:51.477269204 +0100 @@ -72,15 +72,16 @@ Boolean isUseG1GCon = wb.getBooleanVMFlag("UseG1GC"); Boolean isUseConcMarkSweepGCon = wb.getBooleanVMFlag("UseConcMarkSweepGC"); Boolean isUseZGCon = wb.getBooleanVMFlag("UseZGC"); + Boolean isShenandoahGCon = wb.getBooleanVMFlag("UseShenandoahGC"); Boolean isUseEpsilonGCon = wb.getBooleanVMFlag("UseEpsilonGC"); if (Compiler.isGraalEnabled() && - (isUseConcMarkSweepGCon || isUseZGCon || isUseEpsilonGCon)) { + (isUseConcMarkSweepGCon || isUseZGCon || isUseEpsilonGCon || isShenandoahGCon)) { return; // Graal does not support these GCs } String keyPhrase; - if ((isExplicitGCInvokesConcurrentOn && (isUseG1GCon || isUseConcMarkSweepGCon)) || isUseZGCon) { + if ((isExplicitGCInvokesConcurrentOn && (isUseG1GCon || isUseConcMarkSweepGCon)) || isUseZGCon || isShenandoahGCon) { keyPhrase = "GC"; } else { keyPhrase = "Pause Full"; --- old/test/lib/sun/hotspot/gc/GC.java 2018-11-26 21:27:51.858265842 +0100 +++ new/test/lib/sun/hotspot/gc/GC.java 2018-11-26 21:27:51.699267245 +0100 @@ -38,7 +38,8 @@ ConcMarkSweep(3), G1(4), Epsilon(5), - Z(6); + Z(6), + Shenandoah(7); private static final WhiteBox WB = WhiteBox.getWhiteBox();