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 * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" 27 * @compile TestResolvedJavaMethod.java MethodUniverse.java TypeUniverse.java TestMetaAccessProvider.java 28 * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaMethod 29 */ 30 31 package jdk.vm.ci.runtime.test; 32 33 import static org.junit.Assert.*; 34 35 import java.lang.annotation.*; 36 import java.lang.invoke.*; 37 import java.lang.reflect.*; 38 import java.util.*; 39 40 import jdk.vm.ci.meta.*; 41 42 import org.junit.*; 43 44 /** 45 * Tests for {@link ResolvedJavaMethod}. 46 */ 47 public class TestResolvedJavaMethod extends MethodUniverse { 48 49 public TestResolvedJavaMethod() { 50 } 51 52 /** 53 * @see ResolvedJavaMethod#getCode() 54 */ 55 @Test 56 public void getCodeTest() { 57 for (Map.Entry<Method, ResolvedJavaMethod> e : methods.entrySet()) { 58 ResolvedJavaMethod m = e.getValue(); 59 byte[] code = m.getCode(); 60 if (code == null) { 61 assertTrue(m.getCodeSize() == 0); 62 } else { | 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 * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" 27 * @compile TestResolvedJavaMethod.java MethodUniverse.java TypeUniverse.java TestMetaAccessProvider.java 28 * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaMethod 29 */ 30 31 package jdk.vm.ci.runtime.test; 32 33 import static org.junit.Assert.assertEquals; 34 import static org.junit.Assert.assertFalse; 35 import static org.junit.Assert.assertNotNull; 36 import static org.junit.Assert.assertTrue; 37 38 import java.lang.annotation.Annotation; 39 import java.lang.annotation.ElementType; 40 import java.lang.annotation.Retention; 41 import java.lang.annotation.RetentionPolicy; 42 import java.lang.annotation.Target; 43 import java.lang.invoke.MethodHandle; 44 import java.lang.reflect.Constructor; 45 import java.lang.reflect.Member; 46 import java.lang.reflect.Method; 47 import java.lang.reflect.Modifier; 48 import java.lang.reflect.Type; 49 import java.util.Arrays; 50 import java.util.HashMap; 51 import java.util.HashSet; 52 import java.util.Map; 53 import java.util.Set; 54 55 import jdk.vm.ci.meta.ConstantPool; 56 import jdk.vm.ci.meta.ExceptionHandler; 57 import jdk.vm.ci.meta.ResolvedJavaMethod; 58 import jdk.vm.ci.meta.ResolvedJavaType; 59 60 import org.junit.Assert; 61 import org.junit.Test; 62 63 /** 64 * Tests for {@link ResolvedJavaMethod}. 65 */ 66 public class TestResolvedJavaMethod extends MethodUniverse { 67 68 public TestResolvedJavaMethod() { 69 } 70 71 /** 72 * @see ResolvedJavaMethod#getCode() 73 */ 74 @Test 75 public void getCodeTest() { 76 for (Map.Entry<Method, ResolvedJavaMethod> e : methods.entrySet()) { 77 ResolvedJavaMethod m = e.getValue(); 78 byte[] code = m.getCode(); 79 if (code == null) { 80 assertTrue(m.getCodeSize() == 0); 81 } else { |