< prev index next >

test/hotspot/jtreg/runtime/cds/appcds/aotFlags/AOTFlags.java

Print this page
*** 49,10 ***
--- 49,16 ---
          positiveTests();
          negativeTests();
      }
  
      static void positiveTests() throws Exception {
+         String hasTrainingDataPattern = "MethodTrainingData *= *[1-9]";
+         String noTrainingDataPattern = "MethodTrainingData *= *0";
+         String hasAOTCodePattern = "Shared file region .ac. .: *[1-9]";
+         String noAOTCodePattern = "Shared file region .ac. .: *0";
+         String hasMappedAOTCodePattern = "Mapped [0-9]+ bytes at address 0x[0-9a-f]+ from AOT Code Cache";
+ 
          //----------------------------------------------------------------------
          printTestCase("Training Run");
          ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
              "-XX:AOTMode=record",
              "-XX:AOTConfiguration=" + aotConfigFile,

*** 60,10 ***
--- 66,12 ---
              "-cp", appJar, helloClass);
  
          OutputAnalyzer out = CDSTestUtils.executeAndLog(pb, "train");
          out.shouldContain("Hello World");
          out.shouldContain("AOTConfiguration recorded: " + aotConfigFile);
+         out.shouldMatch(hasTrainingDataPattern);
+         out.shouldMatch(noAOTCodePattern);
          out.shouldHaveExitValue(0);
  
          //----------------------------------------------------------------------
          printTestCase("Assembly Phase (AOTClassLinking unspecified -> should be enabled by default)");
          pb = ProcessTools.createLimitedTestJavaProcessBuilder(

*** 73,22 ***
--- 81,26 ---
              "-Xlog:aot",
              "-cp", appJar);
          out = CDSTestUtils.executeAndLog(pb, "asm");
          out.shouldContain("AOTCache creation is complete");
          out.shouldMatch("hello[.]aot");
+         out.shouldMatch(hasTrainingDataPattern);
+         out.shouldMatch(hasAOTCodePattern);
          out.shouldHaveExitValue(0);
  
          //----------------------------------------------------------------------
          printTestCase("Production Run with AOTCache");
          pb = ProcessTools.createLimitedTestJavaProcessBuilder(
              "-XX:AOTCache=" + aotCacheFile,
              "-Xlog:aot",
+             "-Xlog:aot+codecache*",
              "-cp", appJar, helloClass);
          out = CDSTestUtils.executeAndLog(pb, "prod");
          out.shouldContain("Using AOT-linked classes: true (static archive: has aot-linked classes)");
          out.shouldContain("Opened AOT cache hello.aot.");
          out.shouldContain("Hello World");
+         out.shouldMatch(hasMappedAOTCodePattern);
          out.shouldHaveExitValue(0);
  
          //----------------------------------------------------------------------
          printTestCase("AOTMode=off");
          pb = ProcessTools.createLimitedTestJavaProcessBuilder(

*** 136,27 ***
          pb = ProcessTools.createLimitedTestJavaProcessBuilder(
              "-XX:AOTMode=create",
              "-XX:-AOTClassLinking",
              "-XX:AOTConfiguration=" + aotConfigFile,
              "-XX:AOTCache=" + aotCacheFile,
!             "-Xlog:aot",
              "-cp", appJar);
          out = CDSTestUtils.executeAndLog(pb, "asm");
          out.shouldContain("AOTCache creation is complete");
          out.shouldMatch("hello[.]aot");
          out.shouldHaveExitValue(0);
  
          //----------------------------------------------------------------------
          printTestCase("Production Run with AOTCache, which was created with -XX:-AOTClassLinking");
          pb = ProcessTools.createLimitedTestJavaProcessBuilder(
              "-XX:AOTCache=" + aotCacheFile,
              "-Xlog:aot",
              "-cp", appJar, helloClass);
          out = CDSTestUtils.executeAndLog(pb, "prod");
          out.shouldContain("Using AOT-linked classes: false (static archive: no aot-linked classes)");
          out.shouldContain("Opened AOT cache hello.aot.");
          out.shouldContain("Hello World");
          out.shouldHaveExitValue(0);
  
          //----------------------------------------------------------------------
          printTestCase("Training run with -XX:-AOTClassLinking, but assembly run with -XX:+AOTClassLinking");
          pb = ProcessTools.createLimitedTestJavaProcessBuilder(
--- 148,31 ---
          pb = ProcessTools.createLimitedTestJavaProcessBuilder(
              "-XX:AOTMode=create",
              "-XX:-AOTClassLinking",
              "-XX:AOTConfiguration=" + aotConfigFile,
              "-XX:AOTCache=" + aotCacheFile,
!             "-Xlog:aot=debug",
              "-cp", appJar);
          out = CDSTestUtils.executeAndLog(pb, "asm");
          out.shouldContain("AOTCache creation is complete");
          out.shouldMatch("hello[.]aot");
+         out.shouldMatch(noTrainingDataPattern);
+         out.shouldMatch(noAOTCodePattern);
          out.shouldHaveExitValue(0);
  
          //----------------------------------------------------------------------
          printTestCase("Production Run with AOTCache, which was created with -XX:-AOTClassLinking");
          pb = ProcessTools.createLimitedTestJavaProcessBuilder(
              "-XX:AOTCache=" + aotCacheFile,
              "-Xlog:aot",
+             "-Xlog:aot+codecache*",
              "-cp", appJar, helloClass);
          out = CDSTestUtils.executeAndLog(pb, "prod");
          out.shouldContain("Using AOT-linked classes: false (static archive: no aot-linked classes)");
          out.shouldContain("Opened AOT cache hello.aot.");
          out.shouldContain("Hello World");
+         out.shouldNotMatch(hasMappedAOTCodePattern);
          out.shouldHaveExitValue(0);
  
          //----------------------------------------------------------------------
          printTestCase("Training run with -XX:-AOTClassLinking, but assembly run with -XX:+AOTClassLinking");
          pb = ProcessTools.createLimitedTestJavaProcessBuilder(

*** 176,12 ***
              "-XX:AOTConfiguration=" + aotConfigFile,
              "-XX:AOTCache=" + aotCacheFile,
              "-Xlog:aot=debug",
              "-cp", appJar);
          out = CDSTestUtils.executeAndLog(pb, "asm");
!         out.shouldContain("Writing AOTCache file:");
!         out.shouldMatch("aot.*hello[.]aot");
          out.shouldHaveExitValue(0);
  
          //----------------------------------------------------------------------
          printTestCase("One step training run (JEP-514");
  
--- 192,12 ---
              "-XX:AOTConfiguration=" + aotConfigFile,
              "-XX:AOTCache=" + aotCacheFile,
              "-Xlog:aot=debug",
              "-cp", appJar);
          out = CDSTestUtils.executeAndLog(pb, "asm");
!         out.shouldContain("AOTCache creation is complete");
!         out.shouldMatch("hello[.]aot");
          out.shouldHaveExitValue(0);
  
          //----------------------------------------------------------------------
          printTestCase("One step training run (JEP-514");
  

*** 208,23 ***
          out.shouldContain("Hello World");
          out.shouldContain("AOTConfiguration recorded: " + aotConfigFile);
          out.shouldContain("AOTCache creation is complete: hello.aot");
          out.shouldHaveExitValue(0);
  
-         // Set AOTCacheOutput/AOTConfiguration/AOTMode=auto; Ergo changes: AOTMode=record
-         pb = ProcessTools.createLimitedTestJavaProcessBuilder(
-             "-XX:AOTMode=auto",
-             "-XX:AOTCacheOutput=" + aotCacheFile,
-             "-XX:AOTConfiguration=" + aotConfigFile,
-             "-Xlog:aot=debug",
-             "-cp", appJar, helloClass);
-         out = CDSTestUtils.executeAndLog(pb, "ontstep-train");
-         out.shouldContain("Hello World");
-         out.shouldContain("AOTConfiguration recorded: " + aotConfigFile);
-         out.shouldContain("AOTCache creation is complete: hello.aot");
-         out.shouldHaveExitValue(0);
- 
          // Set AOTCacheOutput only; Ergo for: AOTMode=record, AOTConfiguration=<temp>
          pb = ProcessTools.createLimitedTestJavaProcessBuilder(
              "-XX:AOTCacheOutput=" + aotCacheFile,
              "-Xlog:aot=debug",
              "-cp", appJar, helloClass);
--- 224,10 ---

*** 232,22 ***
          out.shouldContain("Hello World");
          out.shouldContain("Temporary AOTConfiguration recorded: " + aotCacheFile + ".config");
          out.shouldContain("AOTCache creation is complete: hello.aot");
          out.shouldHaveExitValue(0);
  
-         // Set AOTCacheOutput/AOTMode=auto only; Ergo for: AOTMode=record, AOTConfiguration=<temp>
-         pb = ProcessTools.createLimitedTestJavaProcessBuilder(
-             "-XX:AOTMode=auto",
-             "-XX:AOTCacheOutput=" + aotCacheFile,
-             "-Xlog:aot=debug",
-             "-cp", appJar, helloClass);
-         out = CDSTestUtils.executeAndLog(pb, "ontstep-train");
-         out.shouldContain("Hello World");
-         out.shouldContain("Temporary AOTConfiguration recorded: " + aotCacheFile + ".config");
-         out.shouldContain("AOTCache creation is complete: hello.aot");
-         out.shouldHaveExitValue(0);
- 
          // Quoating of space characters in child JVM process
          pb = ProcessTools.createLimitedTestJavaProcessBuilder(
              "-XX:AOTCacheOutput=" + aotCacheFile,
              "-Dmy.prop=My string -Xshare:off here", // -Xshare:off should not be treated as a single VM opt for the child JVM
              "-Xlog:aot=debug",
--- 235,10 ---
< prev index next >