diff graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java @ 18822:fad37aaed6d2

Add utilities isDirect and isIndirect to InvokeKind.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sun, 11 Jan 2015 17:46:47 +0100
parents 2885aafd812f
children 5a21cac1968f
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java	Sun Jan 11 17:24:53 2015 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java	Sun Jan 11 17:46:47 2015 +0100
@@ -80,7 +80,7 @@
         for (Node n : usages()) {
             assertTrue(n instanceof Invoke, "call target can only be used from an invoke (%s)", n);
         }
-        if (invokeKind() == InvokeKind.Special || invokeKind() == InvokeKind.Static) {
+        if (invokeKind().isDirect()) {
             assertFalse(targetMethod().isAbstract(), "special calls or static calls are only allowed for concrete methods (%s)", targetMethod());
         }
         if (invokeKind() == InvokeKind.Static) {
@@ -102,7 +102,7 @@
 
     @Override
     public void simplify(SimplifierTool tool) {
-        if (invokeKind() == InvokeKind.Interface || invokeKind() == InvokeKind.Virtual) {
+        if (invokeKind().isIndirect()) {
             // attempt to devirtualize the call
 
             // check for trivial cases (e.g. final methods, nonvirtual methods)