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

Improve gc/g1/TestHumongousCodeCacheRoots.java to use jtreg @requires

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9, 11
    • Fix Version/s: 12
    • Component/s: hotspot
    • Subcomponent:
      gc
    • Resolved In Build:
      b06

      Description

      The test in gc/g1/TestHumongousCodeCacheRoots.java makes sure to run with a client and server VM by spawning VMs with -client/-server parameters respectively.

      When a particular type of VM is not supported, the code currently checks on failure whether this was because of unsupported compiler mode and if so, just suppresses the failing result.

      A cleaner way of doing that would be to split the test into two tests, each @require'ing the particular vm flavor. And having a @run tag using -client/-server respectively. Then jtreg would supposedly not even run the test with the non-supported VM, and the setup code for spawning the extra processes could go away.

      E.g.

      // client test:
      @...
      @requires vm.flavor == client
      @run main -client TestHumongousCodeCacheRootsClient

      class TestHumongousCodeCacheRootsClient {
        public static void main(String[] args) {
          TestHumongousCodeCacheRootsHelper.main(args); // put into an
      auxiliary class file...
        }
      }

      // server test:
      @...
      @requires vm.flavor == client
      @run main -client TestHumongousCodeCacheRootsServer

      class TestHumongousCodeCacheRootsServer {
        public static void main(String[] args) {
          TestHumongousCodeCacheRootsHelper.main(args); // put into an
      auxiliary class file...
        }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jcbeyler Jean Christophe Beyler
                Reporter:
                tschatzl Thomas Schatzl
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: