diff a/test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeFlags.java b/test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeFlags.java
--- a/test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeFlags.java
+++ b/test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeFlags.java
@@ -48,12 +48,12 @@
 import jdk.test.lib.process.OutputAnalyzer;
 
 public class AOTCodeFlags {
     public static void main(String... args) throws Exception {
         Tester t = new Tester();
-        // Run only 2 modes (0 - no AOT code, 1 - AOT adapters) until JDK-8357398 is fixed
-        for (int mode = 0; mode < 2; mode++) {
+        for (int mode = 0; mode < 4; mode++) {
+            if (mode == 2) continue; // Skip stubs until JDK-8357398 is fixed
             t.setTestMode(mode);
             t.run(new String[] {"AOT", "--two-step-training"});
         }
     }
     static class Tester extends CDSAppTester {
@@ -63,15 +63,19 @@
             super("AOTCodeFlags");
             testMode = 0;
         }
 
         boolean isAdapterCachingOn() {
-            return (testMode & 0x1) != 0;
+            return (testMode == 1);
         }
 
         boolean isStubCachingOn() {
-            return (testMode & 0x2) != 0;
+            return (testMode == 2);
+        }
+
+        boolean isCodeCachingOn() {
+            return (testMode == 3);
         }
 
         public void setTestMode(int mode) {
             testMode = mode;
         }
@@ -79,10 +83,11 @@
         public List<String> getVMArgsForTestMode() {
             List<String> list = new ArrayList<String>();
             list.add("-XX:+UnlockDiagnosticVMOptions");
             list.add(isAdapterCachingOn() ? "-XX:+AOTAdapterCaching" : "-XX:-AOTAdapterCaching");
             list.add(isStubCachingOn() ? "-XX:+AOTStubCaching" : "-XX:-AOTStubCaching");
+            list.add(isCodeCachingOn() ? "-XX:+AOTCodeCaching" : "-XX:-AOTCodeCaching");
             return list;
         }
 
         @Override
         public String classpath(RunMode runMode) {
@@ -110,56 +115,77 @@
             };
         }
 
         @Override
         public void checkExecution(OutputAnalyzer out, RunMode runMode) throws Exception {
-            if (!isAdapterCachingOn() && !isStubCachingOn()) { // this is equivalent to completely disable AOT code cache
+            if (!isAdapterCachingOn() && !isStubCachingOn()  && !isCodeCachingOn()) { // this is equivalent to completely disable AOT code cache
                 switch (runMode) {
                 case RunMode.ASSEMBLY:
                 case RunMode.PRODUCTION:
-                    out.shouldNotMatch("Adapters:\\s+total");
-                    out.shouldNotMatch("Shared Blobs:\\s+total");
-                    out.shouldNotMatch("C1 Blobs:\\s+total");
-                    out.shouldNotMatch("C2 Blobs:\\s+total");
+                    out.shouldNotMatch("Adapter:\\s+total");
+                    out.shouldNotMatch("SharedBlob:\\s+total");
+                    out.shouldNotMatch("C1Blob:\\s+total");
+                    out.shouldNotMatch("C2Blob:\\s+total");
+                    out.shouldNotMatch("Stub:\\s+total");
+                    out.shouldNotMatch("Nmethod:\\s+total");
                     break;
                 }
             } else {
                 if (isAdapterCachingOn()) {
                     switch (runMode) {
                     case RunMode.ASSEMBLY:
                     case RunMode.PRODUCTION:
                         // AOTAdapterCaching is on, non-zero adapters should be stored/loaded
-                        out.shouldMatch("Adapters:\\s+total=[1-9][0-9]+");
+                        out.shouldMatch("Adapter:\\s+total=[1-9][0-9]+");
                         break;
                     }
                 } else {
                     switch (runMode) {
                     case RunMode.ASSEMBLY:
                     case RunMode.PRODUCTION:
                         // AOTAdapterCaching is off, no adapters should be stored/loaded
-                        out.shouldMatch("Adapters:\\s+total=0");
+                        out.shouldMatch("Adapter:\\s+total=0");
                         break;
                     }
                 }
                 if (isStubCachingOn()) {
                     switch (runMode) {
                     case RunMode.ASSEMBLY:
                     case RunMode.PRODUCTION:
                         // AOTStubCaching is on, non-zero stubs should be stored/loaded
-                        out.shouldMatch("Shared Blobs:\\s+total=[1-9][0-9]+");
-                        out.shouldMatch("C1 Blobs:\\s+total=[1-9][0-9]+");
-                        out.shouldMatch("C2 Blobs:\\s+total=[1-9][0-9]+");
+                        out.shouldMatch("SharedBlob:\\s+total=[1-9][0-9]+");
+                        out.shouldMatch("C1Blob:\\s+total=[1-9][0-9]+");
+                        out.shouldMatch("C2Blob:\\s+total=[1-9][0-9]+");
+                        out.shouldMatch("Stub:\\s+total=[1-9]+");
                         break;
                     }
                 } else {
                     switch (runMode) {
                     case RunMode.ASSEMBLY:
                     case RunMode.PRODUCTION:
                         // AOTStubCaching is off, no stubs should be stored/loaded
-                        out.shouldMatch("Shared Blobs:\\s+total=0");
-                        out.shouldMatch("C1 Blobs:\\s+total=0");
-                        out.shouldMatch("C2 Blobs:\\s+total=0");
+                        out.shouldMatch("SharedBlob:\\s+total=0");
+                        out.shouldMatch("C1Blob:\\s+total=0");
+                        out.shouldMatch("C2Blob:\\s+total=0");
+                        out.shouldMatch("Stub:\\s+total=0");
+                        break;
+                    }
+                }
+                if (isCodeCachingOn()) {
+                    switch (runMode) {
+                    case RunMode.ASSEMBLY:
+                    case RunMode.PRODUCTION:
+                        // AOTAdapterCaching is on, non-zero adapters should be stored/loaded
+                        out.shouldMatch("Nmethod:\\s+total=[1-9]+");
+                        break;
+                    }
+                } else {
+                    switch (runMode) {
+                    case RunMode.ASSEMBLY:
+                    case RunMode.PRODUCTION:
+                        // AOTAdapterCaching is off, no adapters should be stored/loaded
+                        out.shouldMatch("Nmethod:\\s+total=0");
                         break;
                     }
                 }
             }
         }
