Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8352528

Move CDS WhiteBox APIs to jdk.internal.test.cds.WhiteBox

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • hotspot

      https://github.com/openjdk/jdk/blob/2bc4f64c56ebc844d494a4ce8ba72a25643d4075/test/lib/jdk/test/whitebox/WhiteBox.java#L729-L743

      CDS regression tests make WhiteBox extensively. There are 175 files that references "WhiteBox" under test/hotspot/jtreg/runtime/cds/.

      However, WhiteBox is cumbersome to use. Many CDS tests end up not using WhiteBox, but use more brute-force method. For example: instead of calling WhiteBox::isSharedClass, many tests run with -Xlog:class+load and grep for "shared objects".

      ==================
      Proposal:

      Move the APIs to jdk.internal.test.cds.WhiteBox so these APIs are available inside java.base. This avoid the need for building WhiteBox.jar and appending it to -Xbootclasspath.

      CDS tests cases can use a single line in their test description to indicate the need for this class:

         @module java.base/jdk.internal.test.cds.WhiteBox

      For Java processes launched by CDS (using jdk.test.lib.cds.CDSTestUtils, etc), when necessary we can add "--add-exports java.base/jdk.internal.test.cds=ALL-UNNAMED" to their command-line.

      Note: this RFE replaces JDK-8352107

            Unassigned Unassigned
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: