diff graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java @ 18244:691e2b53dc63

Merge.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Wed, 30 Jul 2014 22:28:09 +0200
parents bb2c3f570e26 4bfe1359d98a
children 34cb95edfc97
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java	Tue Nov 04 14:06:35 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java	Wed Jul 30 22:28:09 2014 +0200
@@ -113,6 +113,10 @@
             // check if the type of the receiver can narrow the result
             ValueNode receiver = receiver();
             ResolvedJavaType type = StampTool.typeOrNull(receiver);
+            if (type == null && invokeKind == InvokeKind.Virtual) {
+                // For virtual calls, we are guaranteed to receive a correct receiver type.
+                type = targetMethod.getDeclaringClass();
+            }
             if (type != null && (invoke().stateAfter() != null || invoke().stateDuring() != null)) {
                 /*
                  * either the holder class is exact, or the receiver object has an exact type, or