Mercurial > hg > graal-jvmci-8
annotate test/compiler/jsr292/MHInlineTest.java @ 23993:7b65bd0ebeb7
removed duplicate registration of StubRoutines::_multiplyToLen in vmstructs
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 31 Jan 2017 22:59:16 +0100 |
parents | 99edc344d77c |
children |
rev | line source |
---|---|
22988
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
1 /* |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
4 * |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
8 * |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
13 * accompanied this code). |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
14 * |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
18 * |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
21 * questions. |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
22 * |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
23 */ |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
24 /** |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
25 * @test |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
26 * @bug 8062280 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
27 * @summary C2: inlining failure due to access checks being too strict |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
28 * @library /testlibrary |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
29 * @run main/othervm MHInlineTest |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
30 */ |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
31 import java.lang.invoke.*; |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
32 import com.oracle.java.testlibrary.*; |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
33 import static com.oracle.java.testlibrary.Asserts.*; |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
34 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
35 public class MHInlineTest { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
36 public static void main(String[] args) throws Exception { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
37 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
38 "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
39 "-server", "-XX:-TieredCompilation", "-Xbatch", |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
40 "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
41 "-XX:CompileCommand=dontinline,MHInlineTest::test*", |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
42 "MHInlineTest$Launcher"); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
43 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
44 OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
45 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
46 analyzer.shouldHaveExitValue(0); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
47 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
48 // The test is applicable only to C2 (present in Server VM). |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
49 if (analyzer.getStderr().contains("Server VM")) { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
50 analyzer.shouldContain("MHInlineTest$B::public_x (3 bytes) inline (hot)"); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
51 analyzer.shouldContain( "MHInlineTest$B::protected_x (3 bytes) inline (hot)"); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
52 analyzer.shouldContain( "MHInlineTest$B::package_x (3 bytes) inline (hot)"); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
53 analyzer.shouldContain("MHInlineTest$A::package_final_x (3 bytes) inline (hot)"); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
54 analyzer.shouldContain("MHInlineTest$B::private_x (3 bytes) inline (hot)"); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
55 analyzer.shouldContain("MHInlineTest$B::private_static_x (3 bytes) inline (hot)"); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
56 analyzer.shouldContain("MHInlineTest$A::package_static_x (3 bytes) inline (hot)"); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
57 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
58 analyzer.shouldNotContain("MHInlineTest$A::protected_x (3 bytes) virtual call"); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
59 analyzer.shouldNotContain("MHInlineTest$A::package_x (3 bytes) virtual call"); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
60 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
61 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
62 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
63 static class A { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
64 public static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup(); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
65 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
66 public Class<?> public_x() { return A.class; } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
67 protected Class<?> protected_x() { return A.class; } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
68 Class<?> package_x() { return A.class; } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
69 final Class<?> package_final_x() { return A.class; } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
70 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
71 static Class<?> package_static_x() { return A.class; } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
72 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
73 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
74 static class B extends A { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
75 public static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup(); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
76 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
77 @Override public Class<?> public_x() { return B.class; } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
78 @Override protected Class<?> protected_x() { return B.class; } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
79 @Override Class<?> package_x() { return B.class; } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
80 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
81 private Class<?> private_x() { return B.class; } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
82 static Class<?> private_static_x() { return B.class; } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
83 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
84 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
85 static final MethodHandle A_PUBLIC_X; |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
86 static final MethodHandle A_PROTECTED_X; |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
87 static final MethodHandle A_PACKAGE_X; |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
88 static final MethodHandle A_PACKAGE_STATIC_X; |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
89 static final MethodHandle A_PACKAGE_FINAL_X; |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
90 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
91 static final MethodHandle B_PRIVATE_X; |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
92 static final MethodHandle B_PRIVATE_STATIC_X; |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
93 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
94 static { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
95 try { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
96 MethodHandles.Lookup LOOKUP = MethodHandles.lookup(); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
97 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
98 A_PUBLIC_X = LOOKUP.findVirtual( |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
99 A.class, "public_x", MethodType.methodType(Class.class)); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
100 A_PROTECTED_X = LOOKUP.findVirtual( |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
101 A.class, "protected_x", MethodType.methodType(Class.class)); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
102 A_PACKAGE_X = LOOKUP.findVirtual( |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
103 A.class, "package_x", MethodType.methodType(Class.class)); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
104 A_PACKAGE_FINAL_X = LOOKUP.findVirtual( |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
105 A.class, "package_final_x", MethodType.methodType(Class.class)); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
106 A_PACKAGE_STATIC_X = LOOKUP.findStatic( |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
107 A.class, "package_static_x", MethodType.methodType(Class.class)); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
108 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
109 B_PRIVATE_X = B.LOOKUP.findVirtual( |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
110 B.class, "private_x", MethodType.methodType(Class.class)); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
111 B_PRIVATE_STATIC_X = B.LOOKUP.findStatic( |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
112 B.class, "private_static_x", MethodType.methodType(Class.class)); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
113 } catch (Exception e) { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
114 throw new Error(e); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
115 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
116 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
117 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
118 static final A a = new B(); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
119 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
120 private static void testPublicMH() { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
121 try { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
122 Class<?> r = (Class<?>)A_PUBLIC_X.invokeExact(a); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
123 assertEquals(r, B.class); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
124 } catch (Throwable throwable) { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
125 throw new Error(throwable); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
126 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
127 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
128 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
129 private static void testProtectedMH() { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
130 try { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
131 Class<?> r = (Class<?>)A_PROTECTED_X.invokeExact(a); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
132 assertEquals(r, B.class); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
133 } catch (Throwable throwable) { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
134 throw new Error(throwable); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
135 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
136 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
137 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
138 private static void testPackageMH() { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
139 try { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
140 Class<?> r = (Class<?>)A_PACKAGE_X.invokeExact(a); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
141 assertEquals(r, B.class); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
142 } catch (Throwable throwable) { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
143 throw new Error(throwable); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
144 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
145 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
146 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
147 private static void testPackageFinalMH() { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
148 try { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
149 Class<?> r = (Class<?>)A_PACKAGE_FINAL_X.invokeExact(a); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
150 assertEquals(r, A.class); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
151 } catch (Throwable throwable) { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
152 throw new Error(throwable); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
153 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
154 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
155 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
156 private static void testPackageStaticMH() { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
157 try { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
158 Class<?> r = (Class<?>)A_PACKAGE_STATIC_X.invokeExact(); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
159 assertEquals(r, A.class); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
160 } catch (Throwable throwable) { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
161 throw new Error(throwable); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
162 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
163 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
164 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
165 private static void testPrivateMH() { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
166 try { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
167 Class<?> r = (Class<?>)B_PRIVATE_X.invokeExact((B)a); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
168 assertEquals(r, B.class); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
169 } catch (Throwable throwable) { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
170 throw new Error(throwable); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
171 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
172 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
173 |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
174 private static void testPrivateStaticMH() { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
175 try { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
176 Class<?> r = (Class<?>)B_PRIVATE_STATIC_X.invokeExact(); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
177 assertEquals(r, B.class); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
178 } catch (Throwable throwable) { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
179 throw new Error(throwable); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
180 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
181 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
182 static class Launcher { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
183 public static void main(String[] args) throws Exception { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
184 for (int i = 0; i < 20_000; i++) { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
185 testPublicMH(); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
186 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
187 for (int i = 0; i < 20_000; i++) { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
188 testProtectedMH(); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
189 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
190 for (int i = 0; i < 20_000; i++) { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
191 testPackageMH(); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
192 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
193 for (int i = 0; i < 20_000; i++) { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
194 testPackageFinalMH(); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
195 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
196 for (int i = 0; i < 20_000; i++) { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
197 testPackageStaticMH(); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
198 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
199 for (int i = 0; i < 20_000; i++) { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
200 testPrivateMH(); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
201 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
202 for (int i = 0; i < 20_000; i++) { |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
203 testPrivateStaticMH(); |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
204 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
205 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
206 } |
99edc344d77c
8062280: C2: inlining failure due to access checks being too strict
vlivanov
parents:
diff
changeset
|
207 } |