< prev index next >

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

Print this page
*** 51,10 ***
--- 51,13 ---
  
      }
  
      // CDS off, small heap, ccs size default (1G)
      // A small heap should allow us to place the ccs within the lower 32G and thus allow zero based encoding.
+     /* Lilliput: cannot work due to drastically reduced narrow klass pointer range (atm 2g and that may get
+        smaller still). There is an argument for improving CDS/CCS reservation and make it more likely to run
+        zero-based, but that logic has to be rethought.
      public static void smallHeapTest() throws Exception {
          ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
              "-XX:+UnlockDiagnosticVMOptions",
              "-XX:SharedBaseAddress=8g",
              "-Xmx128m",

*** 65,13 ***
--- 68,15 ---
          if (testNarrowKlassBase()) {
              output.shouldContain("Narrow klass base: 0x0000000000000000");
          }
          output.shouldHaveExitValue(0);
      }
+      */
  
      // CDS off, small heap, ccs size explicitely set to 1G
      // A small heap should allow us to place the ccs within the lower 32G and thus allow zero based encoding.
+     /* Lilliput: See comment above.
      public static void smallHeapTestWith1G() throws Exception {
          ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
              "-XX:+UnlockDiagnosticVMOptions",
              "-XX:CompressedClassSpaceSize=1g",
              "-Xmx128m",

*** 82,14 ***
--- 87,17 ---
          if (testNarrowKlassBase()) {
              output.shouldContain("Narrow klass base: 0x0000000000000000, Narrow klass shift: 3");
          }
          output.shouldHaveExitValue(0);
      }
+     */
  
      // CDS off, a very large heap, ccs size left to 1G default.
      // We expect the ccs to be mapped somewhere far beyond the heap, such that it is not possible
      // to use zero based encoding.
+     /* Lilliput: I am not sure what the point of this test CCS reservation is independent from
+        heap. See below the desparate attempts to predict heap reservation on PPC. Why do we even care?
      public static void largeHeapTest() throws Exception {
          ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
              "-XX:+UnlockDiagnosticVMOptions",
              "-XX:+UnlockExperimentalVMOptions",
              "-Xmx30g",

*** 106,15 ***
--- 114,17 ---
              output.shouldNotContain("Narrow klass base: 0x0000000000000000");
              output.shouldContain("Narrow klass shift: 0");
          }
          output.shouldHaveExitValue(0);
      }
+      */
  
      // Settings as in largeHeapTest() except for max heap size. We make max heap
      // size even larger such that it cannot fit into lower 32G but not too large
      // for compressed oops.
      // We expect a zerobased ccs.
+     /* Lilliput: narrow klass pointer range drastically reduced. See comments under smallHeapTest().
      public static void largeHeapAbove32GTest() throws Exception {
          ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
              "-XX:+UnlockDiagnosticVMOptions",
              "-XX:+UnlockExperimentalVMOptions",
              "-Xmx31g",

*** 130,12 ***
--- 140,17 ---
                  }
              }
          }
          output.shouldHaveExitValue(0);
      }
+     */
  
      // Using large paged heap, metaspace uses small pages.
+     /* Lilliput: not sure what the point of this test is. The ability to have a class space if heap uses
+        large pages? Why would that be a problem? Kept alive for now since it makes no problems even with
+        smaller class pointers.
+      */
      public static void largePagesForHeapTest() throws Exception {
          ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
                  "-XX:+UnlockDiagnosticVMOptions",
                  "-Xmx128m",
                  "-XX:+UseLargePages",

*** 192,10 ***
--- 207,11 ---
            output.shouldContain("Unable to use shared archive");
            output.shouldHaveExitValue(1);
          }
      }
  
+     /* Lilliput: narrow klass pointer range drastically reduced. See comments under smallHeapTest().
      public static void smallHeapTestNoCoop() throws Exception {
          ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
              "-XX:-UseCompressedOops",
              "-XX:+UseCompressedClassPointers",
              "-XX:+UnlockDiagnosticVMOptions",

*** 207,11 ***
--- 223,13 ---
              "-XX:+VerifyBeforeGC", "-version");
          OutputAnalyzer output = new OutputAnalyzer(pb.start());
          output.shouldContain("Narrow klass base: 0x0000000000000000");
          output.shouldHaveExitValue(0);
      }
+     */
  
+     /* Lilliput: narrow klass pointer range drastically reduced. See comments under smallHeapTest().
      public static void smallHeapTestWith1GNoCoop() throws Exception {
          ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
              "-XX:-UseCompressedOops",
              "-XX:+UseCompressedClassPointers",
              "-XX:+UnlockDiagnosticVMOptions",

*** 227,11 ***
--- 245,13 ---
              // Currently relax this test for Aarch64 and ppc.
              output.shouldContain("Narrow klass shift: 0");
          }
          output.shouldHaveExitValue(0);
      }
+     */
  
+     /* Lilliput: narrow klass pointer range drastically reduced. See comments under smallHeapTest().
      public static void largeHeapTestNoCoop() throws Exception {
          ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
              "-XX:-UseCompressedOops",
              "-XX:+UseCompressedClassPointers",
              "-XX:+UnlockDiagnosticVMOptions",

*** 247,10 ***
--- 267,11 ---
              // Currently relax this test for Aarch64 and ppc.
              output.shouldContain("Narrow klass shift: 0");
          }
          output.shouldHaveExitValue(0);
      }
+     */
  
      public static void largePagesTestNoCoop() throws Exception {
          ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
              "-XX:-UseCompressedOops",
              "-XX:+UseCompressedClassPointers",

*** 315,14 ***
            output.shouldHaveExitValue(1);
          }
      }
  
      public static void main(String[] args) throws Exception {
!         smallHeapTest();
!         smallHeapTestWith1G();
!         largeHeapTest();
!         largeHeapAbove32GTest();
          largePagesForHeapTest();
          heapBaseMinAddressTest();
          sharingTest();
  
          if (!Platform.isOSX()) {
--- 336,14 ---
            output.shouldHaveExitValue(1);
          }
      }
  
      public static void main(String[] args) throws Exception {
!         // smallHeapTest();
!         // smallHeapTestWith1G();
!         // largeHeapTest();
!         // largeHeapAbove32GTest();
          largePagesForHeapTest();
          heapBaseMinAddressTest();
          sharingTest();
  
          if (!Platform.isOSX()) {

*** 330,13 ***
              // This is only possible if the platform supports it. Notably,
              // on macOS, when compressed oops is disabled and the heap is
              // given an arbitrary address, that address occasionally collides
              // with where we would ideally have placed the compressed class
              // space. Therefore, macOS is omitted for now.
!             smallHeapTestNoCoop();
!             smallHeapTestWith1GNoCoop();
!             largeHeapTestNoCoop();
              largePagesTestNoCoop();
              heapBaseMinAddressTestNoCoop();
              sharingTestNoCoop();
          }
      }
--- 351,13 ---
              // This is only possible if the platform supports it. Notably,
              // on macOS, when compressed oops is disabled and the heap is
              // given an arbitrary address, that address occasionally collides
              // with where we would ideally have placed the compressed class
              // space. Therefore, macOS is omitted for now.
!             // smallHeapTestNoCoop();
!             // smallHeapTestWith1GNoCoop();
!             // largeHeapTestNoCoop();
              largePagesTestNoCoop();
              heapBaseMinAddressTestNoCoop();
              sharingTestNoCoop();
          }
      }
< prev index next >