< prev index next > test/hotspot/jtreg/compiler/ciReplay/TestInliningProtectionDomain.java
Print this page
/*
! * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
/*
! * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
List<InlineEntry> inlineesReplay = parseLogFile(LOG_FILE_REPLAY, entryString, "test ()V", inlineeCount);
verifyLists(inlineesNormal, inlineesReplay, inlineeCount);
if (inlineFails) {
Asserts.assertTrue(inlineesNormal.get(0).compare("compiler.ciReplay.ProtectionDomainTestNoOtherCompilationPrivate", "bar", inlineesNormal.get(0).isUnloadedSignatureClasses()));
! Asserts.assertTrue(inlineesReplay.get(0).compare("compiler.ciReplay.ProtectionDomainTestNoOtherCompilationPrivate", "bar", inlineesReplay.get(0).isDisallowedByReplay()));
} else {
Asserts.assertTrue(inlineesNormal.get(4).compare("compiler.ciReplay.InliningBar", "bar2", inlineesNormal.get(4).isNormalInline()));
Asserts.assertTrue(inlineesReplay.get(4).compare("compiler.ciReplay.InliningBar", "bar2", inlineesReplay.get(4).isForcedByReplay() || inlineesReplay.get(4).isForcedIncrementalInlineByReplay()));
}
}
List<InlineEntry> inlineesReplay = parseLogFile(LOG_FILE_REPLAY, entryString, "test ()V", inlineeCount);
verifyLists(inlineesNormal, inlineesReplay, inlineeCount);
if (inlineFails) {
Asserts.assertTrue(inlineesNormal.get(0).compare("compiler.ciReplay.ProtectionDomainTestNoOtherCompilationPrivate", "bar", inlineesNormal.get(0).isUnloadedSignatureClasses()));
! Asserts.assertTrue(inlineesReplay.get(0).compare("compiler.ciReplay.ProtectionDomainTestNoOtherCompilationPrivate", "bar", inlineesReplay.get(0).isUnloadedSignatureClasses()));
} else {
Asserts.assertTrue(inlineesNormal.get(4).compare("compiler.ciReplay.InliningBar", "bar2", inlineesNormal.get(4).isNormalInline()));
Asserts.assertTrue(inlineesReplay.get(4).compare("compiler.ciReplay.InliningBar", "bar2", inlineesReplay.get(4).isForcedByReplay() || inlineesReplay.get(4).isForcedIncrementalInlineByReplay()));
}
}
public static void test() {
bar();
}
! // Integer should be resolved for the protection domain of this class because the separate compilation of bar() in
// the normal run will resolve all classes in the signature. Inlining succeeds.
! private static Integer bar() {
InliningFoo.foo();
return null;
}
}
public static void test() {
bar();
}
! // SigType should be resolved for the protection domain of this class because the separate compilation of bar() in
// the normal run will resolve all classes in the signature. Inlining succeeds.
! private static SigType bar() {
InliningFoo.foo();
return null;
}
}
public static void test() {
bar(); // Not compiled before separately
}
! // Integer should be resolved for the protection domain of this class because getDeclaredMethods is called in normal run
// when validating main() method. In this process, all public methods of this class are visited and its signature classes
// are resolved. Inlining of bar() succeeds.
! public static Integer bar() {
InliningFoo.foo();
return null;
}
}
public static void test() {
bar(); // Not compiled before separately
}
! // SigType should be resolved for the protection domain of this class because getDeclaredMethods is called in normal run
// when validating main() method. In this process, all public methods of this class are visited and its signature classes
// are resolved. Inlining of bar() succeeds.
! public static SigType bar() {
InliningFoo.foo();
return null;
}
}
public static void test() {
bar(); // Not compiled before separately
}
! // Integer should be unresolved for the protection domain of this class even though getDeclaredMethods is called in normal
// run when validating main() method. In this process, only public methods of this class are visited and its signature
// classes are resolved. Since this method is private, the signature classes are not resolved for this protection domain.
// Inlining of bar() should fail in normal run with "unresolved signature classes". Therefore, replay compilation should
// also not inline bar().
! private static Integer bar() {
InliningFoo.foo();
return null;
}
}
public static void test() {
bar(); // Not compiled before separately
}
! // SigType should be unresolved for the protection domain of this class even though getDeclaredMethods is called in normal
// run when validating main() method. In this process, only public methods of this class are visited and its signature
// classes are resolved. Since this method is private, the signature classes are not resolved for this protection domain.
// Inlining of bar() should fail in normal run with "unresolved signature classes". Therefore, replay compilation should
// also not inline bar().
! private static SigType bar() {
InliningFoo.foo();
return null;
}
}
public static void test() {
bar(); // Not compiled before separately
}
! // Integer should be resovled for the protection domain of this class because getDeclaredMethods is called in normal run
// when validating main() method. In this process, public methods of this class are visited and its signature classes
// are resolved. bar() is private and not visited in this process (i.e. no resolution of String). But since main()
// has String[] as parameter, the String class will be resolved for this protection domain. Inlining of bar() succeeds.
private static String bar() {
InliningFoo.foo();
public static void test() {
bar(); // Not compiled before separately
}
! // String should be resolved for the protection domain of this class because getDeclaredMethods is called in normal run
// when validating main() method. In this process, public methods of this class are visited and its signature classes
// are resolved. bar() is private and not visited in this process (i.e. no resolution of String). But since main()
// has String[] as parameter, the String class will be resolved for this protection domain. Inlining of bar() succeeds.
private static String bar() {
InliningFoo.foo();
bar2();
}
private static void bar2() {}
}
+
+ class SigType {}
+
< prev index next >