12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 /** 25 * @test 26 * @bug 8062280 27 * @summary C2: inlining failure due to access checks being too strict 28 * @library /testlibrary 29 * @run main/othervm MHInlineTest 30 */ 31 import java.lang.invoke.*; 32 import com.oracle.java.testlibrary.*; 33 import static com.oracle.java.testlibrary.Asserts.*; 34 35 public class MHInlineTest { 36 public static void main(String[] args) throws Exception { 37 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( 38 "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", 39 "-server", "-XX:-TieredCompilation", "-Xbatch", 40 "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", 41 "-XX:CompileCommand=dontinline,MHInlineTest::test*", 42 "MHInlineTest$Launcher"); 43 44 OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); 45 46 analyzer.shouldHaveExitValue(0); 47 48 // The test is applicable only to C2 (present in Server VM). 49 if (analyzer.getStderr().contains("Server VM")) { 50 analyzer.shouldContain("MHInlineTest$B::public_x (3 bytes) inline (hot)"); 51 analyzer.shouldContain( "MHInlineTest$B::protected_x (3 bytes) inline (hot)"); 52 analyzer.shouldContain( "MHInlineTest$B::package_x (3 bytes) inline (hot)"); 53 analyzer.shouldContain("MHInlineTest$A::package_final_x (3 bytes) inline (hot)"); | 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 /** 25 * @test 26 * @bug 8062280 27 * @summary C2: inlining failure due to access checks being too strict 28 * @library /testlibrary 29 * @run main/othervm MHInlineTest 30 */ 31 import java.lang.invoke.*; 32 import jdk.test.lib.*; 33 import static jdk.test.lib.Asserts.*; 34 35 public class MHInlineTest { 36 public static void main(String[] args) throws Exception { 37 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( 38 "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", 39 "-server", "-XX:-TieredCompilation", "-Xbatch", 40 "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", 41 "-XX:CompileCommand=dontinline,MHInlineTest::test*", 42 "MHInlineTest$Launcher"); 43 44 OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); 45 46 analyzer.shouldHaveExitValue(0); 47 48 // The test is applicable only to C2 (present in Server VM). 49 if (analyzer.getStderr().contains("Server VM")) { 50 analyzer.shouldContain("MHInlineTest$B::public_x (3 bytes) inline (hot)"); 51 analyzer.shouldContain( "MHInlineTest$B::protected_x (3 bytes) inline (hot)"); 52 analyzer.shouldContain( "MHInlineTest$B::package_x (3 bytes) inline (hot)"); 53 analyzer.shouldContain("MHInlineTest$A::package_final_x (3 bytes) inline (hot)"); |