# HG changeset patch # User Christian Haeubl # Date 1368804888 -7200 # Node ID 4a8b9117327a75cf18852aaf621bc1adc526eda7 # Parent 57e5211846f947509ac9317ffe4fd118c35954de Removed MethodProfile testcases. diff -r 57e5211846f9 -r 4a8b9117327a graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ProfilingInfoTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ProfilingInfoTest.java Fri May 17 17:24:03 2013 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ProfilingInfoTest.java Fri May 17 17:34:48 2013 +0200 @@ -105,9 +105,8 @@ } @Test - public void testProfileInvokeVirtual() throws NoSuchMethodException { + public void testProfileInvokeVirtual() { testTypeProfile("invokeVirtualSnippet", 1); - testMethodProfile("invokeVirtualSnippet", 1, "hashCode"); } public static int invokeVirtualSnippet(Object obj) { @@ -115,9 +114,8 @@ } @Test - public void testTypeProfileInvokeInterface() throws NoSuchMethodException { + public void testTypeProfileInvokeInterface() { testTypeProfile("invokeInterfaceSnippet", 1); - testMethodProfile("invokeInterfaceSnippet", 1, "length"); } public static int invokeInterfaceSnippet(CharSequence a) { @@ -167,31 +165,6 @@ Assert.assertNull(typeProfile); } - private void testMethodProfile(String testSnippet, int bci, String expectedProfiledMethod) throws NoSuchMethodException { - ResolvedJavaMethod stringMethod = runtime.lookupJavaMethod(String.class.getMethod(expectedProfiledMethod)); - ResolvedJavaMethod stringBuilderMethod = runtime.lookupJavaMethod(StringBuilder.class.getMethod(expectedProfiledMethod)); - - ProfilingInfo info = profile(testSnippet, "ABC"); - JavaMethodProfile methodProfile = info.getMethodProfile(bci); - Assert.assertEquals(0.0, methodProfile.getNotRecordedProbability(), DELTA); - Assert.assertEquals(1, methodProfile.getMethods().length); - Assert.assertEquals(stringMethod, methodProfile.getMethods()[0].getMethod()); - Assert.assertEquals(1.0, methodProfile.getMethods()[0].getProbability(), DELTA); - - continueProfiling(testSnippet, new StringBuilder()); - methodProfile = info.getMethodProfile(bci); - Assert.assertEquals(0.0, methodProfile.getNotRecordedProbability(), DELTA); - Assert.assertEquals(2, methodProfile.getMethods().length); - Assert.assertEquals(stringMethod, methodProfile.getMethods()[0].getMethod()); - Assert.assertEquals(stringBuilderMethod, methodProfile.getMethods()[1].getMethod()); - Assert.assertEquals(0.5, methodProfile.getMethods()[0].getProbability(), DELTA); - Assert.assertEquals(0.5, methodProfile.getMethods()[1].getProbability(), DELTA); - - resetProfile(testSnippet); - methodProfile = info.getMethodProfile(bci); - Assert.assertNull(methodProfile); - } - @Test public void testExceptionSeen() { // NullPointerException