< prev index next >

test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java

Print this page




  44 
  45     public static void main(String[] args) throws Exception {
  46         testCompressedOopsModesGCs();
  47         testCompressedOopsModesGCs("-XX:+UseLargePages");
  48     }
  49 
  50     public static void testCompressedOopsModesGCs(String... flags) throws Exception {
  51         ArrayList<String> args = new ArrayList<>();
  52         Collections.addAll(args, flags);
  53 
  54         // Test default.
  55         testCompressedOopsModes(args);
  56         // Test GCs.
  57         testCompressedOopsModes(args, "-XX:+UseG1GC");
  58         if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
  59             testCompressedOopsModes(args, "-XX:+UseConcMarkSweepGC");
  60         }
  61         testCompressedOopsModes(args, "-XX:+UseSerialGC");
  62         testCompressedOopsModes(args, "-XX:+UseParallelGC");
  63         testCompressedOopsModes(args, "-XX:+UseParallelOldGC");

  64     }
  65 
  66     public static void testCompressedOopsModes(ArrayList<String> flags1, String... flags2) throws Exception {
  67         ArrayList<String> args = new ArrayList<>();
  68         args.addAll(flags1);
  69         Collections.addAll(args, flags2);
  70 
  71         if (Platform.is64bit()) {
  72             // Explicitly turn of compressed oops
  73             testCompressedOops(args, "-XX:-UseCompressedOops", "-Xmx32m")
  74                 .shouldNotContain("Compressed Oops")
  75                 .shouldHaveExitValue(0);
  76 
  77             // Compressed oops should be on by default
  78             testCompressedOops(args, "-Xmx32m")
  79                 .shouldContain("Compressed Oops mode")
  80                 .shouldHaveExitValue(0);
  81 
  82             // Explicly enabling compressed oops
  83             testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx32m")




  44 
  45     public static void main(String[] args) throws Exception {
  46         testCompressedOopsModesGCs();
  47         testCompressedOopsModesGCs("-XX:+UseLargePages");
  48     }
  49 
  50     public static void testCompressedOopsModesGCs(String... flags) throws Exception {
  51         ArrayList<String> args = new ArrayList<>();
  52         Collections.addAll(args, flags);
  53 
  54         // Test default.
  55         testCompressedOopsModes(args);
  56         // Test GCs.
  57         testCompressedOopsModes(args, "-XX:+UseG1GC");
  58         if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
  59             testCompressedOopsModes(args, "-XX:+UseConcMarkSweepGC");
  60         }
  61         testCompressedOopsModes(args, "-XX:+UseSerialGC");
  62         testCompressedOopsModes(args, "-XX:+UseParallelGC");
  63         testCompressedOopsModes(args, "-XX:+UseParallelOldGC");
  64         testCompressedOopsModes(args, "-XX:+UseShenandoahGC");
  65     }
  66 
  67     public static void testCompressedOopsModes(ArrayList<String> flags1, String... flags2) throws Exception {
  68         ArrayList<String> args = new ArrayList<>();
  69         args.addAll(flags1);
  70         Collections.addAll(args, flags2);
  71 
  72         if (Platform.is64bit()) {
  73             // Explicitly turn of compressed oops
  74             testCompressedOops(args, "-XX:-UseCompressedOops", "-Xmx32m")
  75                 .shouldNotContain("Compressed Oops")
  76                 .shouldHaveExitValue(0);
  77 
  78             // Compressed oops should be on by default
  79             testCompressedOops(args, "-Xmx32m")
  80                 .shouldContain("Compressed Oops mode")
  81                 .shouldHaveExitValue(0);
  82 
  83             // Explicly enabling compressed oops
  84             testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx32m")


< prev index next >