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 import java.io.File;
25 import java.util.ArrayList;
26 import java.util.Collections;
27
28 import jdk.test.lib.*;
29
30 /*
31 * @test
32 * @bug 8050079
33 * @summary Compiles a monomorphic call to finalizeObject() on a modified java.lang.Object to test C1 CHA.
34 * @library /testlibrary
35 * @modules java.base/sun.misc
36 * java.management
37 * @compile -XDignore.symbol.file java/lang/Object.java TestMonomorphicObjectCall.java
38 * @run main TestMonomorphicObjectCall
39 */
40 public class TestMonomorphicObjectCall {
41 final static String testClasses = System.getProperty("test.classes") + File.separator;
42
43 private static void callFinalize(Object object) throws Throwable {
44 // Call modified version of java.lang.Object::finalize() that is
45 // not overridden by any subclass. C1 CHA should mark the call site
46 // as monomorphic and inline the method.
47 object.finalizeObject();
48 }
49
50 public static void main(String[] args) throws Throwable {
51 if (args.length == 0) {
52 // Execute new instance with modified java.lang.Object
53 executeTestJvm();
54 } else {
55 // Trigger compilation of 'callFinalize'
56 callFinalize(new Object());
|
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 import java.io.File;
25 import java.util.ArrayList;
26 import java.util.Collections;
27
28 import jdk.test.lib.*;
29
30 /*
31 * @test
32 * @bug 8050079
33 * @summary Compiles a monomorphic call to finalizeObject() on a modified java.lang.Object to test C1 CHA.
34 * @library /testlibrary
35 * @modules java.base/sun.misc
36 * java.management
37 * java.base/jdk.internal
38 * @compile -XDignore.symbol.file java/lang/Object.java TestMonomorphicObjectCall.java
39 * @run main TestMonomorphicObjectCall
40 */
41 public class TestMonomorphicObjectCall {
42 final static String testClasses = System.getProperty("test.classes") + File.separator;
43
44 private static void callFinalize(Object object) throws Throwable {
45 // Call modified version of java.lang.Object::finalize() that is
46 // not overridden by any subclass. C1 CHA should mark the call site
47 // as monomorphic and inline the method.
48 object.finalizeObject();
49 }
50
51 public static void main(String[] args) throws Throwable {
52 if (args.length == 0) {
53 // Execute new instance with modified java.lang.Object
54 executeTestJvm();
55 } else {
56 // Trigger compilation of 'callFinalize'
57 callFinalize(new Object());
|