changeset 9763:4a8b9117327a

Removed MethodProfile testcases.
author Christian Haeubl <haeubl@ssw.jku.at>
date Fri, 17 May 2013 17:34:48 +0200
parents 57e5211846f9
children 51545c49083a
files graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ProfilingInfoTest.java
diffstat 1 files changed, 2 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- 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