< prev index next >

test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java

Print this page




  21  *
  22  */
  23 
  24 /* @test TestWrongBarrierDisable
  25  * @summary Test that disabling wrong barriers fails early
  26  * @key gc
  27  * @requires vm.gc.Shenandoah
  28  * @library /test/lib
  29  * @run main/othervm TestWrongBarrierDisable
  30  */
  31 
  32 import java.util.*;
  33 
  34 import jdk.test.lib.process.ProcessTools;
  35 import jdk.test.lib.process.OutputAnalyzer;
  36 
  37 public class TestWrongBarrierDisable {
  38 
  39     public static void main(String[] args) throws Exception {
  40         String[] concurrent = {
  41                 "ShenandoahReadBarrier",
  42                 "ShenandoahWriteBarrier",
  43                 "ShenandoahCASBarrier",
  44                 "ShenandoahAcmpBarrier",
  45                 "ShenandoahCloneBarrier",
  46                 "ShenandoahSATBBarrier",
  47                 "ShenandoahKeepAliveBarrier",
  48                 "ShenandoahStoreValReadBarrier",
  49         };
  50 
  51         String[] traversal = {
  52                 "ShenandoahReadBarrier",
  53                 "ShenandoahWriteBarrier",
  54                 "ShenandoahCASBarrier",
  55                 "ShenandoahAcmpBarrier",
  56                 "ShenandoahCloneBarrier",
  57         };
  58 
  59         shouldFailAll("adaptive",   concurrent);
  60         shouldFailAll("static",     concurrent);
  61         shouldFailAll("compact",    concurrent);
  62         shouldFailAll("aggressive", concurrent);
  63         shouldFailAll("traversal",  traversal);
  64         shouldPassAll("passive",    concurrent);
  65         shouldPassAll("passive",    traversal);
  66     }
  67 
  68     private static void shouldFailAll(String h, String[] barriers) throws Exception {
  69         for (String b : barriers) {
  70             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  71                     "-XX:+UnlockDiagnosticVMOptions",
  72                     "-XX:+UnlockExperimentalVMOptions",
  73                     "-XX:+UseShenandoahGC",
  74                     "-XX:ShenandoahGCHeuristics=" + h,
  75                     "-XX:-" + b,




  21  *
  22  */
  23 
  24 /* @test TestWrongBarrierDisable
  25  * @summary Test that disabling wrong barriers fails early
  26  * @key gc
  27  * @requires vm.gc.Shenandoah
  28  * @library /test/lib
  29  * @run main/othervm TestWrongBarrierDisable
  30  */
  31 
  32 import java.util.*;
  33 
  34 import jdk.test.lib.process.ProcessTools;
  35 import jdk.test.lib.process.OutputAnalyzer;
  36 
  37 public class TestWrongBarrierDisable {
  38 
  39     public static void main(String[] args) throws Exception {
  40         String[] concurrent = {
  41                 "ShenandoahLoadRefBarrier",

  42                 "ShenandoahCASBarrier",

  43                 "ShenandoahCloneBarrier",
  44                 "ShenandoahSATBBarrier",
  45                 "ShenandoahKeepAliveBarrier",

  46         };
  47 
  48         String[] traversal = {
  49                 "ShenandoahLoadRefBarrier",

  50                 "ShenandoahCASBarrier",

  51                 "ShenandoahCloneBarrier",
  52         };
  53 
  54         shouldFailAll("adaptive",   concurrent);
  55         shouldFailAll("static",     concurrent);
  56         shouldFailAll("compact",    concurrent);
  57         shouldFailAll("aggressive", concurrent);
  58         shouldFailAll("traversal",  traversal);
  59         shouldPassAll("passive",    concurrent);
  60         shouldPassAll("passive",    traversal);
  61     }
  62 
  63     private static void shouldFailAll(String h, String[] barriers) throws Exception {
  64         for (String b : barriers) {
  65             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  66                     "-XX:+UnlockDiagnosticVMOptions",
  67                     "-XX:+UnlockExperimentalVMOptions",
  68                     "-XX:+UseShenandoahGC",
  69                     "-XX:ShenandoahGCHeuristics=" + h,
  70                     "-XX:-" + b,


< prev index next >