|
| 1 | +/* |
| 2 | + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. |
| 3 | + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | + * |
| 5 | + * This code is free software; you can redistribute it and/or modify it |
| 6 | + * under the terms of the GNU General Public License version 2 only, as |
| 7 | + * published by the Free Software Foundation. |
| 8 | + * |
| 9 | + * This code is distributed in the hope that it will be useful, but WITHOUT |
| 10 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 11 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 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 | +// This jasm file implements the following java code: |
| 26 | +interface I { } |
| 27 | + |
| 28 | +public class InterfaceObj implements I { |
| 29 | + static void f(I intf) throws Throwable { |
| 30 | + I.finalize(); |
| 31 | + } |
| 32 | + public static void testFinalize() throws Throwable { |
| 33 | + f(new InterfaceObj()); |
| 34 | + } |
| 35 | + static void c(I intf) throws Throwable { |
| 36 | + I.clone(); |
| 37 | + } |
| 38 | + public static void testClone() throws Throwable { |
| 39 | + c(new InterfaceObj()); |
| 40 | + } |
| 41 | + } |
| 42 | +*/ |
| 43 | + |
| 44 | +public interface I version 60:0 { } // end Class I |
| 45 | + |
| 46 | + |
| 47 | +super public class InterfaceObj implements I version 60:0 { |
| 48 | + |
| 49 | + |
| 50 | + public Method "<init>":"()V" stack 1 locals 1 { |
| 51 | + aload_0; |
| 52 | + invokespecial Method java/lang/Object."<init>":"()V"; |
| 53 | + return; |
| 54 | + } |
| 55 | + |
| 56 | + static Method f:"(LI;)V" throws java/lang/Throwable stack 1 locals 1 { |
| 57 | + aload_0; |
| 58 | + invokeinterface InterfaceMethod I.finalize:"()V", 1; |
| 59 | + return; |
| 60 | + } |
| 61 | + |
| 62 | + public static Method testFinalize:"()V" throws java/lang/Throwable stack 2 locals 1 { |
| 63 | + new class InterfaceObj; |
| 64 | + dup; |
| 65 | + invokespecial Method "<init>":"()V"; |
| 66 | + invokestatic Method f:"(LI;)V"; |
| 67 | + return; |
| 68 | + } |
| 69 | + |
| 70 | + static Method c:"(LI;)V" throws java/lang/Throwable stack 1 locals 1 { |
| 71 | + aload_0; |
| 72 | + invokeinterface InterfaceMethod I.clone:"()Ljava/lang/Object;", 1; |
| 73 | + return; |
| 74 | + } |
| 75 | + |
| 76 | + public static Method testClone:"()V" throws java/lang/Throwable stack 2 locals 1 { |
| 77 | + new class InterfaceObj; |
| 78 | + dup; |
| 79 | + invokespecial Method "<init>":"()V"; |
| 80 | + invokestatic Method c:"(LI;)V"; |
| 81 | + return; |
| 82 | + } |
| 83 | + |
| 84 | +} // end Class InterfaceObj |
0 commit comments