< prev index next >

test/hotspot/jtreg/compiler/ciReplay/TestInliningProtectionDomain.java

Print this page

 44         new TestInliningProtectionDomain(ProtectionDomainTestNoOtherCompilationPublic.class, false);
 45         new TestInliningProtectionDomain(ProtectionDomainTestNoOtherCompilationPrivate.class, false);
 46         new TestInliningProtectionDomain(ProtectionDomainTestNoOtherCompilationPrivateString.class, false);
 47     }
 48 
 49     public TestInliningProtectionDomain(Class<?> testClass, boolean compileBar) {
 50         super(testClass);
 51         if (compileBar) {
 52             commandLineNormal.add("-XX:CompileCommand=compileonly," + testClass.getName() + "::bar");
 53         }
 54         runTest();
 55     }
 56 
 57     @Override
 58     public void testAction() {
 59         positiveTest(commandLineReplay);
 60         String entryString = getTestClass() + " " + "test";
 61         boolean inlineFails = testClass == ProtectionDomainTestNoOtherCompilationPrivate.class;
 62         int inlineeCount = inlineFails ? 1 : 5;
 63 
 64         List<InlineEntry> inlineesNormal = parseLogFile(LOG_FILE_NORMAL, entryString, "compile_id='" + getCompileIdFromFile(getReplayFileName()), inlineeCount);
 65         List<InlineEntry> inlineesReplay = parseLogFile(LOG_FILE_REPLAY, entryString, "test ()V", inlineeCount);
 66         verifyLists(inlineesNormal, inlineesReplay, inlineeCount);
 67 
 68         if (inlineFails) {
 69             Asserts.assertTrue(inlineesNormal.get(0).compare("compiler.ciReplay.ProtectionDomainTestNoOtherCompilationPrivate", "bar", inlineesNormal.get(0).isUnloadedSignatureClasses()));
 70             Asserts.assertTrue(inlineesReplay.get(0).compare("compiler.ciReplay.ProtectionDomainTestNoOtherCompilationPrivate", "bar", inlineesReplay.get(0).isDisallowedByReplay()));
 71         } else {
 72             Asserts.assertTrue(inlineesNormal.get(4).compare("compiler.ciReplay.InliningBar", "bar2", inlineesNormal.get(4).isNormalInline()));
 73             Asserts.assertTrue(inlineesReplay.get(4).compare("compiler.ciReplay.InliningBar", "bar2", inlineesReplay.get(4).isForcedByReplay() || inlineesReplay.get(4).isForcedIncrementalInlineByReplay()));
 74         }
 75     }
 76 }
 77 
 78 class ProtectionDomainTestCompiledBefore {
 79     public static void main(String[] args) {
 80         for (int i = 0; i < 10000; i++) {
 81             bar(); // Ensure that bar() was compiled
 82         }
 83         for (int i = 0; i < 10000; i++) {
 84             test();

 44         new TestInliningProtectionDomain(ProtectionDomainTestNoOtherCompilationPublic.class, false);
 45         new TestInliningProtectionDomain(ProtectionDomainTestNoOtherCompilationPrivate.class, false);
 46         new TestInliningProtectionDomain(ProtectionDomainTestNoOtherCompilationPrivateString.class, false);
 47     }
 48 
 49     public TestInliningProtectionDomain(Class<?> testClass, boolean compileBar) {
 50         super(testClass);
 51         if (compileBar) {
 52             commandLineNormal.add("-XX:CompileCommand=compileonly," + testClass.getName() + "::bar");
 53         }
 54         runTest();
 55     }
 56 
 57     @Override
 58     public void testAction() {
 59         positiveTest(commandLineReplay);
 60         String entryString = getTestClass() + " " + "test";
 61         boolean inlineFails = testClass == ProtectionDomainTestNoOtherCompilationPrivate.class;
 62         int inlineeCount = inlineFails ? 1 : 5;
 63 
 64         List<InlineEntry> inlineesNormal = parseLogFile(LOG_FILE_NORMAL, entryString, "compile_id='" + getCompileIdFromFile(getReplayFileName()) + "'", inlineeCount);
 65         List<InlineEntry> inlineesReplay = parseLogFile(LOG_FILE_REPLAY, entryString, "test ()V", inlineeCount);
 66         verifyLists(inlineesNormal, inlineesReplay, inlineeCount);
 67 
 68         if (inlineFails) {
 69             Asserts.assertTrue(inlineesNormal.get(0).compare("compiler.ciReplay.ProtectionDomainTestNoOtherCompilationPrivate", "bar", inlineesNormal.get(0).isUnloadedSignatureClasses()));
 70             Asserts.assertTrue(inlineesReplay.get(0).compare("compiler.ciReplay.ProtectionDomainTestNoOtherCompilationPrivate", "bar", inlineesReplay.get(0).isDisallowedByReplay()));
 71         } else {
 72             Asserts.assertTrue(inlineesNormal.get(4).compare("compiler.ciReplay.InliningBar", "bar2", inlineesNormal.get(4).isNormalInline()));
 73             Asserts.assertTrue(inlineesReplay.get(4).compare("compiler.ciReplay.InliningBar", "bar2", inlineesReplay.get(4).isForcedByReplay() || inlineesReplay.get(4).isForcedIncrementalInlineByReplay()));
 74         }
 75     }
 76 }
 77 
 78 class ProtectionDomainTestCompiledBefore {
 79     public static void main(String[] args) {
 80         for (int i = 0; i < 10000; i++) {
 81             bar(); // Ensure that bar() was compiled
 82         }
 83         for (int i = 0; i < 10000; i++) {
 84             test();
< prev index next >