changeset 9162:85b71f453ef5

Merge
author Gilles Duboscq <duboscq@ssw.jku.at>
date Tue, 16 Apr 2013 18:16:57 +0200
parents 8d4174140745 b67a0963fb00
children 45b37dcb24de
files graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractCallTargetNode.java
diffstat 21 files changed, 149 insertions(+), 171 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/NestedLoopTest.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/NestedLoopTest.java	Tue Apr 16 18:16:57 2013 +0200
@@ -28,6 +28,7 @@
 import com.oracle.graal.graph.*;
 import com.oracle.graal.nodes.*;
 import com.oracle.graal.nodes.cfg.*;
+import com.oracle.graal.nodes.java.*;
 
 public class NestedLoopTest extends GraalCompilerTest {
 
@@ -134,9 +135,9 @@
     }
 
     private static Invoke getInvoke(String name, StructuredGraph graph) {
-        for (Invoke invoke : graph.getInvokes()) {
-            if (invoke.methodCallTarget().targetMethod().getName().equals(name)) {
-                return invoke;
+        for (MethodCallTargetNode callTarget : graph.getNodes(MethodCallTargetNode.class)) {
+            if (callTarget.targetMethod().getName().equals(name)) {
+                return callTarget.invoke();
             }
         }
         return null;
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Tue Apr 16 18:16:57 2013 +0200
@@ -598,7 +598,7 @@
 
     @Override
     public void emitInvoke(Invoke x) {
-        AbstractCallTargetNode callTarget = (AbstractCallTargetNode) x.callTarget();
+        LoweredCallTargetNode callTarget = (LoweredCallTargetNode) x.callTarget();
         CallingConvention cc = frameMap.registerConfig.getCallingConvention(callTarget.callType(), x.asNode().stamp().javaType(runtime), callTarget.signature(), target(), false);
         frameMap.callsMethod(cc);
 
--- a/graal/com.oracle.graal.hotspot.server/src/com/oracle/graal/hotspot/server/InvocationSocket.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.hotspot.server/src/com/oracle/graal/hotspot/server/InvocationSocket.java	Tue Apr 16 18:16:57 2013 +0200
@@ -26,6 +26,7 @@
 import java.lang.reflect.*;
 import java.util.*;
 
+import com.oracle.graal.debug.*;
 import com.oracle.graal.hotspot.logging.*;
 
 /**
@@ -38,7 +39,6 @@
  */
 public class InvocationSocket {
 
-    // CheckStyle: stop system..print check
     private static final boolean DEBUG = false;
     private static final boolean COUNT_CALLS = false;
 
@@ -74,7 +74,7 @@
                         sorted.put(entry.getValue(), entry.getKey());
                     }
                     for (Map.Entry<Integer, String> entry : sorted.entrySet()) {
-                        System.out.println(entry.getKey() + ": " + entry.getValue());
+                        TTY.println(entry.getKey() + ": " + entry.getValue());
                     }
                 }
             });
@@ -247,15 +247,15 @@
                     }
                     result = new Result(result);
                 } catch (IllegalArgumentException e) {
-                    System.out.println("error while invoking " + invoke.methodName);
+                    TTY.println("error while invoking " + invoke.methodName);
                     e.getCause().printStackTrace();
                     result = e.getCause();
                 } catch (InvocationTargetException e) {
-                    System.out.println("error while invoking " + invoke.methodName);
+                    TTY.println("error while invoking " + invoke.methodName);
                     e.getCause().printStackTrace();
                     result = e.getCause();
                 } catch (IllegalAccessException e) {
-                    System.out.println("error while invoking " + invoke.methodName);
+                    TTY.println("error while invoking " + invoke.methodName);
                     e.getCause().printStackTrace();
                     result = e.getCause();
                 } finally {
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ArrayCopyIntrinsificationTest.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ArrayCopyIntrinsificationTest.java	Tue Apr 16 18:16:57 2013 +0200
@@ -51,7 +51,7 @@
                     if (node instanceof Invoke) {
                         Invoke invoke = (Invoke) node;
                         Assert.assertTrue(invoke.callTarget() instanceof DirectCallTargetNode);
-                        AbstractCallTargetNode directCall = (AbstractCallTargetNode) invoke.callTarget();
+                        LoweredCallTargetNode directCall = (LoweredCallTargetNode) invoke.callTarget();
                         JavaMethod callee = directCall.target();
                         Assert.assertTrue(callee.getName().equals("<init>"));
                         Assert.assertTrue(runtime.lookupJavaType(ArrayIndexOutOfBoundsException.class).equals(callee.getDeclaringClass()) ||
@@ -63,7 +63,7 @@
                 for (Node node : graph.getNodes()) {
                     if (node instanceof Invoke) {
                         Invoke invoke = (Invoke) node;
-                        AbstractCallTargetNode directCall = (AbstractCallTargetNode) invoke.callTarget();
+                        LoweredCallTargetNode directCall = (LoweredCallTargetNode) invoke.callTarget();
                         JavaMethod callee = directCall.target();
                         if (callee.getDeclaringClass().equals(runtime.lookupJavaType(System.class)) && callee.getName().equals("arraycopy")) {
                             found = true;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/logging/CountingProxy.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/logging/CountingProxy.java	Tue Apr 16 18:16:57 2013 +0200
@@ -27,6 +27,8 @@
 import java.util.concurrent.*;
 import java.util.concurrent.atomic.*;
 
+import com.oracle.graal.debug.*;
+
 /**
  * A java.lang.reflect proxy that hierarchically logs all method invocations along with their
  * parameters and return values.
@@ -41,9 +43,7 @@
 
     public CountingProxy(T delegate) {
         assert ENABLED;
-        // CheckStyle: stop system..print check
-        System.out.println("Counting proxy for " + delegate.getClass().getSimpleName() + " created");
-        // CheckStyle: resume system..print check
+        TTY.println("Counting proxy for " + delegate.getClass().getSimpleName() + " created");
         this.delegate = delegate;
         proxies.add(this);
     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/logging/Logger.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/logging/Logger.java	Tue Apr 16 18:16:57 2013 +0200
@@ -26,6 +26,8 @@
 import java.lang.reflect.*;
 import java.util.*;
 
+import com.oracle.graal.debug.*;
+
 /**
  * Scoped logging class used to display the call hierarchy of VMToCompiler/CompilerToVM calls.
  */
@@ -70,12 +72,11 @@
         }
     }
 
-    // CheckStyle: stop system..print check
     public static void info(String message) {
         if (ENABLED) {
             log(message);
         } else {
-            System.out.println(message);
+            TTY.println(message);
         }
         if (out != null) {
             out.println(message);
@@ -88,11 +89,11 @@
             Logger logger = loggerTL.get();
             for (String line : message.split("\n")) {
                 if (logger.open) {
-                    System.out.println("...");
+                    TTY.println("...");
                     logger.open = false;
                 }
-                System.out.print(space(logger.level));
-                System.out.println(line);
+                TTY.print(space(logger.level));
+                TTY.println(line);
             }
         }
     }
@@ -101,11 +102,11 @@
         if (ENABLED) {
             Logger logger = loggerTL.get();
             if (logger.open) {
-                System.out.println("...");
+                TTY.println("...");
                 logger.open = false;
             }
-            System.out.print(space(logger.level));
-            System.out.print(message);
+            TTY.print(space(logger.level));
+            TTY.print(message);
             logger.openStack.push(logger.open);
             logger.open = true;
             logger.level++;
@@ -117,16 +118,14 @@
             Logger logger = loggerTL.get();
             logger.level--;
             if (logger.open) {
-                System.out.println(message);
+                TTY.println(message);
             } else {
-                System.out.println(space(logger.level) + "..." + message);
+                TTY.println(space(logger.level) + "..." + message);
             }
             logger.open = logger.openStack.pop();
         }
     }
 
-    // CheckStyle: resume system..print check
-
     private static String[] spaces = new String[50];
 
     private static String space(int count) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java	Tue Apr 16 18:16:57 2013 +0200
@@ -502,7 +502,7 @@
         } else if (n instanceof Invoke) {
             Invoke invoke = (Invoke) n;
             if (invoke.callTarget() instanceof MethodCallTargetNode) {
-                MethodCallTargetNode callTarget = invoke.methodCallTarget();
+                MethodCallTargetNode callTarget = (MethodCallTargetNode) invoke.callTarget();
                 NodeInputList<ValueNode> parameters = callTarget.arguments();
                 ValueNode receiver = parameters.size() <= 0 ? null : parameters.get(0);
                 if (!callTarget.isStatic() && receiver.kind() == Kind.Object && !receiver.objectStamp().nonNull()) {
@@ -510,7 +510,7 @@
                 }
                 JavaType[] signature = MetaUtil.signatureToTypes(callTarget.targetMethod().getSignature(), callTarget.isStatic() ? null : callTarget.targetMethod().getDeclaringClass());
 
-                AbstractCallTargetNode loweredCallTarget = null;
+                LoweredCallTargetNode loweredCallTarget = null;
                 if (callTarget.invokeKind() == InvokeKind.Virtual && GraalOptions.InlineVTableStubs && (GraalOptions.AlwaysInlineVTableStubs || invoke.isPolymorphic())) {
 
                     HotSpotResolvedJavaMethod hsMethod = (HotSpotResolvedJavaMethod) callTarget.targetMethod();
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractCallTargetNode.java	Tue Apr 16 18:16:47 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import java.util.*;
-
-import com.oracle.graal.api.code.*;
-import com.oracle.graal.api.meta.*;
-import com.oracle.graal.nodes.type.*;
-
-public abstract class AbstractCallTargetNode extends CallTargetNode {
-
-    private final Stamp returnStamp;
-    private final JavaType[] signature;
-    private final ResolvedJavaMethod target;
-    private final CallingConvention.Type callType;
-
-    public AbstractCallTargetNode(List<ValueNode> arguments, Stamp returnStamp, JavaType[] signature, ResolvedJavaMethod target, CallingConvention.Type callType) {
-        super(arguments);
-        this.returnStamp = returnStamp;
-        this.signature = signature;
-        this.target = target;
-        this.callType = callType;
-    }
-
-    @Override
-    public Stamp returnStamp() {
-        return returnStamp;
-    }
-
-    public JavaType[] signature() {
-        return signature;
-    }
-
-    public ResolvedJavaMethod target() {
-        return target;
-    }
-
-    public CallingConvention.Type callType() {
-        return callType;
-    }
-}
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DirectCallTargetNode.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DirectCallTargetNode.java	Tue Apr 16 18:16:57 2013 +0200
@@ -28,7 +28,7 @@
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.nodes.type.*;
 
-public class DirectCallTargetNode extends AbstractCallTargetNode {
+public class DirectCallTargetNode extends LoweredCallTargetNode {
 
     public DirectCallTargetNode(List<ValueNode> arguments, Stamp returnStamp, JavaType[] signature, ResolvedJavaMethod target, CallingConvention.Type callType) {
         super(arguments, returnStamp, signature, target, callType);
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IndirectCallTargetNode.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IndirectCallTargetNode.java	Tue Apr 16 18:16:57 2013 +0200
@@ -28,7 +28,7 @@
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.nodes.type.*;
 
-public class IndirectCallTargetNode extends AbstractCallTargetNode {
+public class IndirectCallTargetNode extends LoweredCallTargetNode {
 
     @Input protected ValueNode computedAddress;
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/Invoke.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/Invoke.java	Tue Apr 16 18:16:57 2013 +0200
@@ -23,7 +23,6 @@
 package com.oracle.graal.nodes;
 
 import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.java.*;
 import com.oracle.graal.nodes.spi.*;
 
 public interface Invoke extends StateSplit, Lowerable, DeoptimizingNode {
@@ -34,11 +33,6 @@
 
     CallTargetNode callTarget();
 
-    /**
-     * Utility method that returns the {@link #callTarget()} cast to a {@link MethodCallTargetNode}.
-     */
-    MethodCallTargetNode methodCallTarget();
-
     int bci();
 
     FixedNode asNode();
@@ -51,8 +45,6 @@
 
     void intrinsify(Node node);
 
-    Graph graph();
-
     double probability();
 
     void setProbability(double value);
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java	Tue Apr 16 18:16:57 2013 +0200
@@ -27,7 +27,6 @@
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.graph.*;
 import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.java.*;
 import com.oracle.graal.nodes.spi.*;
 import com.oracle.graal.nodes.util.*;
 
@@ -65,11 +64,6 @@
     }
 
     @Override
-    public MethodCallTargetNode methodCallTarget() {
-        return (MethodCallTargetNode) callTarget;
-    }
-
-    @Override
     public boolean isPolymorphic() {
         return polymorphic;
     }
@@ -101,11 +95,7 @@
     @Override
     public Map<Object, Object> getDebugProperties(Map<Object, Object> map) {
         Map<Object, Object> debugProperties = super.getDebugProperties(map);
-        if (callTarget instanceof MethodCallTargetNode && methodCallTarget().targetMethod() != null) {
-            debugProperties.put("targetMethod", methodCallTarget().targetMethod());
-        } else if (callTarget instanceof AbstractCallTargetNode) {
-            debugProperties.put("targetMethod", ((AbstractCallTargetNode) callTarget).target());
-        }
+        debugProperties.put("targetMethod", callTarget.targetName());
         return debugProperties;
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java	Tue Apr 16 18:16:57 2013 +0200
@@ -177,9 +177,7 @@
     @Override
     public Map<Object, Object> getDebugProperties(Map<Object, Object> map) {
         Map<Object, Object> debugProperties = super.getDebugProperties(map);
-        if (callTarget instanceof MethodCallTargetNode && methodCallTarget().targetMethod() != null) {
-            debugProperties.put("targetMethod", methodCallTarget().targetMethod());
-        }
+        debugProperties.put("targetMethod", callTarget.targetName());
         return debugProperties;
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoweredCallTargetNode.java	Tue Apr 16 18:16:57 2013 +0200
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import java.util.*;
+
+import com.oracle.graal.api.code.*;
+import com.oracle.graal.api.meta.*;
+import com.oracle.graal.nodes.type.*;
+
+public abstract class LoweredCallTargetNode extends CallTargetNode {
+
+    private final Stamp returnStamp;
+    private final JavaType[] signature;
+    private final ResolvedJavaMethod target;
+    private final CallingConvention.Type callType;
+
+    public LoweredCallTargetNode(List<ValueNode> arguments, Stamp returnStamp, JavaType[] signature, ResolvedJavaMethod target, CallingConvention.Type callType) {
+        super(arguments);
+        this.returnStamp = returnStamp;
+        this.signature = signature;
+        this.target = target;
+        this.callType = callType;
+    }
+
+    @Override
+    public Stamp returnStamp() {
+        return returnStamp;
+    }
+
+    public JavaType[] signature() {
+        return signature;
+    }
+
+    public ResolvedJavaMethod target() {
+        return target;
+    }
+
+    public CallingConvention.Type callType() {
+        return callType;
+    }
+}
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java	Tue Apr 16 18:16:57 2013 +0200
@@ -31,6 +31,7 @@
 import com.oracle.graal.debug.*;
 import com.oracle.graal.graph.*;
 import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.java.*;
 import com.oracle.graal.nodes.spi.*;
 import com.oracle.graal.phases.*;
 import com.oracle.graal.phases.PhasePlan.PhasePosition;
@@ -267,8 +268,9 @@
         }
 
         private static int numberOfTransferredValues(InlineInfo info) {
-            Signature signature = info.invoke().methodCallTarget().targetMethod().getSignature();
-            int transferredValues = signature.getParameterCount(!Modifier.isStatic(info.invoke().methodCallTarget().targetMethod().getModifiers()));
+            MethodCallTargetNode methodCallTargetNode = ((MethodCallTargetNode) info.invoke().callTarget());
+            Signature signature = methodCallTargetNode.targetMethod().getSignature();
+            int transferredValues = signature.getParameterCount(!Modifier.isStatic(methodCallTargetNode.targetMethod().getModifiers()));
             if (signature.getReturnKind() != Kind.Void) {
                 transferredValues++;
             }
@@ -292,10 +294,11 @@
              * argument simplifies the callee
              */
             int moreSpecificArgumentInfo = 0;
-            boolean isStatic = info.invoke().methodCallTarget().isStatic();
+            MethodCallTargetNode methodCallTarget = (MethodCallTargetNode) info.invoke().callTarget();
+            boolean isStatic = methodCallTarget.isStatic();
             int signatureOffset = isStatic ? 0 : 1;
-            NodeInputList arguments = info.invoke().methodCallTarget().arguments();
-            ResolvedJavaMethod targetMethod = info.invoke().methodCallTarget().targetMethod();
+            NodeInputList arguments = methodCallTarget.arguments();
+            ResolvedJavaMethod targetMethod = methodCallTarget.targetMethod();
             ResolvedJavaType methodHolderClass = targetMethod.getDeclaringClass();
             Signature signature = targetMethod.getSignature();
 
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java	Tue Apr 16 18:16:57 2013 +0200
@@ -252,7 +252,7 @@
 
         protected static void inline(Invoke invoke, ResolvedJavaMethod concrete, InliningCallback callback, Replacements replacements, Assumptions assumptions, boolean receiverNullCheck) {
             Class<? extends FixedWithNextNode> macroNodeClass = getMacroNodeClass(replacements, concrete);
-            StructuredGraph graph = (StructuredGraph) invoke.graph();
+            StructuredGraph graph = (StructuredGraph) invoke.asNode().graph();
             if (macroNodeClass != null) {
                 FixedWithNextNode macroNode;
                 try {
@@ -297,7 +297,7 @@
         }
 
         protected void replaceInvokeCallTarget(StructuredGraph graph, InvokeKind invokeKind, ResolvedJavaMethod targetMethod) {
-            MethodCallTargetNode oldCallTarget = invoke.methodCallTarget();
+            MethodCallTargetNode oldCallTarget = (MethodCallTargetNode) invoke.callTarget();
             MethodCallTargetNode newCallTarget = graph.add(new MethodCallTargetNode(invokeKind, targetMethod, oldCallTarget.arguments().toArray(new ValueNode[0]), oldCallTarget.returnType()));
             invoke.asNode().replaceFirstInput(oldCallTarget, newCallTarget);
         }
@@ -384,7 +384,7 @@
 
         private void createGuard(StructuredGraph graph, MetaAccessProvider runtime) {
             InliningUtil.receiverNullCheck(invoke);
-            ValueNode receiver = invoke.methodCallTarget().receiver();
+            ValueNode receiver = ((MethodCallTargetNode) invoke.callTarget()).receiver();
             ConstantNode typeHub = ConstantNode.forConstant(type.getEncoding(Representation.ObjectHub), runtime, graph);
             LoadHubNode receiverHub = graph.add(new LoadHubNode(receiver, typeHub.kind()));
             CompareNode typeCheck = CompareNode.createCompareNode(Condition.EQ, receiverHub, typeHub);
@@ -463,7 +463,7 @@
             int numberOfMethods = concretes.size();
             FixedNode continuation = invoke.next();
 
-            ValueNode originalReceiver = invoke.methodCallTarget().receiver();
+            ValueNode originalReceiver = ((MethodCallTargetNode) invoke.callTarget()).receiver();
             // setup merge and phi nodes for results and exceptions
             MergeNode returnMerge = graph.add(new MergeNode());
             returnMerge.setProbability(invoke.probability());
@@ -539,7 +539,7 @@
                 Invoke invokeForInlining = (Invoke) node.next();
 
                 ResolvedJavaType commonType = getLeastCommonType(i);
-                ValueNode receiver = invokeForInlining.methodCallTarget().receiver();
+                ValueNode receiver = ((MethodCallTargetNode) invokeForInlining.callTarget()).receiver();
                 boolean exact = getTypeCount(i) == 1;
                 PiNode anchoredReceiver = createAnchoredReceiver(graph, node, commonType, receiver, exact);
                 invokeForInlining.callTarget().replaceFirstInput(receiver, anchoredReceiver);
@@ -559,7 +559,8 @@
                 FixedNode current = returnMerge;
                 int opportunities = 0;
                 do {
-                    if (current instanceof InvokeNode && ((InvokeNode) current).methodCallTarget().receiver() == originalReceiver) {
+                    if (current instanceof InvokeNode && ((InvokeNode) current).callTarget() instanceof MethodCallTargetNode &&
+                                    ((MethodCallTargetNode) ((InvokeNode) current).callTarget()).receiver() == originalReceiver) {
                         opportunities++;
                     } else if (current.inputs().contains(originalReceiver)) {
                         opportunities++;
@@ -626,8 +627,8 @@
         private void createDispatchOnTypeBeforeInvoke(StructuredGraph graph, BeginNode[] successors, boolean invokeIsOnlySuccessor) {
             assert ptypes.size() > 1;
 
-            Kind hubKind = invoke.methodCallTarget().targetMethod().getDeclaringClass().getEncoding(Representation.ObjectHub).getKind();
-            LoadHubNode hub = graph.add(new LoadHubNode(invoke.methodCallTarget().receiver(), hubKind));
+            Kind hubKind = ((MethodCallTargetNode) invoke.callTarget()).targetMethod().getDeclaringClass().getEncoding(Representation.ObjectHub).getKind();
+            LoadHubNode hub = graph.add(new LoadHubNode(((MethodCallTargetNode) invoke.callTarget()).receiver(), hubKind));
             graph.addBeforeFixed(invoke.asNode(), hub);
 
             ResolvedJavaType[] keys = new ResolvedJavaType[ptypes.size()];
@@ -717,7 +718,7 @@
         }
 
         private void tryToDevirtualizeMultipleMethods(StructuredGraph graph) {
-            MethodCallTargetNode methodCallTarget = invoke.methodCallTarget();
+            MethodCallTargetNode methodCallTarget = (MethodCallTargetNode) invoke.callTarget();
             if (methodCallTarget.invokeKind() == InvokeKind.Interface) {
                 ResolvedJavaMethod targetMethod = methodCallTarget.targetMethod();
                 ResolvedJavaType leastCommonType = getLeastCommonType();
@@ -744,7 +745,7 @@
             createDispatchOnTypeBeforeInvoke(graph, successors, true);
 
             invocationEntry.setNext(invoke.asNode());
-            ValueNode receiver = invoke.methodCallTarget().receiver();
+            ValueNode receiver = ((MethodCallTargetNode) invoke.callTarget()).receiver();
             PiNode anchoredReceiver = createAnchoredReceiver(graph, invocationEntry, target.getDeclaringClass(), receiver, false);
             invoke.callTarget().replaceFirstInput(receiver, anchoredReceiver);
             replaceInvokeCallTarget(graph, kind, target);
@@ -820,7 +821,7 @@
             return null;
         }
         ResolvedJavaMethod caller = getCaller(invoke);
-        MethodCallTargetNode callTarget = invoke.methodCallTarget();
+        MethodCallTargetNode callTarget = (MethodCallTargetNode) invoke.callTarget();
         ResolvedJavaMethod targetMethod = callTarget.targetMethod();
 
         if (callTarget.invokeKind() == InvokeKind.Special || targetMethod.canBeStaticallyBound()) {
@@ -970,13 +971,14 @@
             return logNotInlinedMethodAndReturnFalse(invoke, "the invoke is dead code");
         } else if (!(invoke.callTarget() instanceof MethodCallTargetNode)) {
             return logNotInlinedMethodAndReturnFalse(invoke, "the invoke has already been lowered, or has been created as a low-level node");
-        } else if (invoke.methodCallTarget().targetMethod() == null) {
+        } else if (((MethodCallTargetNode) invoke.callTarget()).targetMethod() == null) {
             return logNotInlinedMethodAndReturnFalse(invoke, "target method is null");
         } else if (invoke.stateAfter() == null) {
             return logNotInlinedMethodAndReturnFalse(invoke, "the invoke has no after state");
         } else if (!invoke.useForInlining()) {
             return logNotInlinedMethodAndReturnFalse(invoke, "the invoke is marked to be not used for inlining");
-        } else if (invoke.methodCallTarget().receiver() != null && invoke.methodCallTarget().receiver().isConstant() && invoke.methodCallTarget().receiver().asConstant().isNull()) {
+        } else if (((MethodCallTargetNode) invoke.callTarget()).receiver() != null && ((MethodCallTargetNode) invoke.callTarget()).receiver().isConstant() &&
+                        ((MethodCallTargetNode) invoke.callTarget()).receiver().asConstant().isNull()) {
             return logNotInlinedMethodAndReturnFalse(invoke, "receiver is null");
         } else {
             return true;
@@ -1198,8 +1200,8 @@
     }
 
     public static void receiverNullCheck(Invoke invoke) {
-        MethodCallTargetNode callTarget = invoke.methodCallTarget();
-        StructuredGraph graph = (StructuredGraph) invoke.graph();
+        MethodCallTargetNode callTarget = (MethodCallTargetNode) invoke.callTarget();
+        StructuredGraph graph = (StructuredGraph) callTarget.graph();
         NodeInputList<ValueNode> parameters = callTarget.arguments();
         ValueNode firstParam = parameters.size() <= 0 ? null : parameters.get(0);
         if (!callTarget.isStatic() && firstParam.kind() == Kind.Object && !firstParam.objectStamp().nonNull()) {
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationPhase.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationPhase.java	Tue Apr 16 18:16:57 2013 +0200
@@ -54,10 +54,8 @@
     @Override
     protected void run(StructuredGraph graph) {
         ArrayList<Node> cleanUpReturnList = new ArrayList<>();
-        for (Invoke i : graph.getInvokes()) {
-            if (i.callTarget() instanceof MethodCallTargetNode) {
-                tryIntrinsify(i, cleanUpReturnList);
-            }
+        for (MethodCallTargetNode node : graph.getNodes(MethodCallTargetNode.class)) {
+            tryIntrinsify(node, cleanUpReturnList);
         }
 
         for (Node node : cleanUpReturnList) {
@@ -65,8 +63,8 @@
         }
     }
 
-    private boolean tryIntrinsify(Invoke invoke, List<Node> cleanUpReturnList) {
-        ResolvedJavaMethod target = invoke.methodCallTarget().targetMethod();
+    private boolean tryIntrinsify(MethodCallTargetNode methodCallTargetNode, List<Node> cleanUpReturnList) {
+        ResolvedJavaMethod target = methodCallTargetNode.targetMethod();
         NodeIntrinsic intrinsic = target.getAnnotation(Node.NodeIntrinsic.class);
         ResolvedJavaType declaringClass = target.getDeclaringClass();
         if (intrinsic != null) {
@@ -77,7 +75,7 @@
             ResolvedJavaType returnType = target.getSignature().getReturnType(declaringClass).resolve(declaringClass);
 
             // Prepare the arguments for the reflective constructor call on the node class.
-            Constant[] nodeConstructorArguments = prepareArguments(invoke, parameterTypes, target, false);
+            Constant[] nodeConstructorArguments = prepareArguments(methodCallTargetNode, parameterTypes, target, false);
             if (nodeConstructorArguments == null) {
                 return false;
             }
@@ -87,8 +85,8 @@
             Node newInstance = createNodeInstance(c, parameterTypes, returnType, intrinsic.setStampFromReturnType(), nodeConstructorArguments);
 
             // Replace the invoke with the new node.
-            invoke.asNode().graph().add(newInstance);
-            invoke.intrinsify(newInstance);
+            methodCallTargetNode.graph().add(newInstance);
+            methodCallTargetNode.invoke().intrinsify(newInstance);
 
             // Clean up checkcast instructions inserted by javac if the return type is generic.
             cleanUpReturnList.add(newInstance);
@@ -96,12 +94,12 @@
             ResolvedJavaType[] parameterTypes = MetaUtil.resolveJavaTypes(MetaUtil.signatureToTypes(target), declaringClass);
 
             // Prepare the arguments for the reflective method call
-            Constant[] arguments = prepareArguments(invoke, parameterTypes, target, true);
+            Constant[] arguments = prepareArguments(methodCallTargetNode, parameterTypes, target, true);
             if (arguments == null) {
                 return false;
             }
             Constant receiver = null;
-            if (!invoke.methodCallTarget().isStatic()) {
+            if (!methodCallTargetNode.isStatic()) {
                 receiver = arguments[0];
                 arguments = Arrays.copyOfRange(arguments, 1, arguments.length);
                 parameterTypes = Arrays.copyOfRange(parameterTypes, 1, parameterTypes.length);
@@ -112,14 +110,14 @@
 
             if (constant != null) {
                 // Replace the invoke with the result of the call
-                ConstantNode node = ConstantNode.forConstant(constant, runtime, invoke.asNode().graph());
-                invoke.intrinsify(node);
+                ConstantNode node = ConstantNode.forConstant(constant, runtime, methodCallTargetNode.graph());
+                methodCallTargetNode.invoke().intrinsify(node);
 
                 // Clean up checkcast instructions inserted by javac if the return type is generic.
                 cleanUpReturnList.add(node);
             } else {
                 // Remove the invoke
-                invoke.intrinsify(null);
+                methodCallTargetNode.invoke().intrinsify(null);
             }
         }
         return true;
@@ -133,12 +131,12 @@
      * @return the arguments for the reflective invocation or null if an argument of {@code invoke}
      *         that is expected to be constant isn't
      */
-    private Constant[] prepareArguments(Invoke invoke, ResolvedJavaType[] parameterTypes, ResolvedJavaMethod target, boolean folding) {
-        NodeInputList<ValueNode> arguments = invoke.callTarget().arguments();
+    private Constant[] prepareArguments(MethodCallTargetNode methodCallTargetNode, ResolvedJavaType[] parameterTypes, ResolvedJavaMethod target, boolean folding) {
+        NodeInputList<ValueNode> arguments = methodCallTargetNode.arguments();
         Constant[] reflectionCallArguments = new Constant[arguments.size()];
         for (int i = 0; i < reflectionCallArguments.length; ++i) {
             int parameterIndex = i;
-            if (!invoke.methodCallTarget().isStatic()) {
+            if (!methodCallTargetNode.isStatic()) {
                 parameterIndex--;
             }
             ValueNode argument = arguments.get(i);
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationVerificationPhase.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationVerificationPhase.java	Tue Apr 16 18:16:57 2013 +0200
@@ -42,20 +42,18 @@
 
     @Override
     protected void run(StructuredGraph graph) {
-        for (Invoke i : graph.getInvokes()) {
-            if (i.callTarget() instanceof MethodCallTargetNode) {
-                checkInvoke(i);
-            }
+        for (MethodCallTargetNode n : graph.getNodes(MethodCallTargetNode.class)) {
+            checkInvoke(n);
         }
     }
 
-    private static void checkInvoke(Invoke invoke) {
-        ResolvedJavaMethod target = invoke.methodCallTarget().targetMethod();
+    private static void checkInvoke(MethodCallTargetNode n) {
+        ResolvedJavaMethod target = n.targetMethod();
         NodeIntrinsic intrinsic = target.getAnnotation(Node.NodeIntrinsic.class);
         if (intrinsic != null) {
-            throw new GraalInternalError("Illegal call to node intrinsic in " + invoke.graph() + ": " + invoke);
+            throw new GraalInternalError("Illegal call to node intrinsic in " + n.graph() + ": " + n.invoke());
         } else if (target.getAnnotation(Fold.class) != null) {
-            throw new GraalInternalError("Illegal call to foldable method in " + invoke.graph() + ": " + invoke);
+            throw new GraalInternalError("Illegal call to foldable method in " + n.graph() + ": " + n.invoke());
         }
     }
 }
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java	Tue Apr 16 18:16:57 2013 +0200
@@ -345,13 +345,12 @@
             assert !Modifier.isAbstract(methodToParse.getModifiers()) && !Modifier.isNative(methodToParse.getModifiers()) : methodToParse;
             final StructuredGraph graph = buildInitialGraph(methodToParse);
 
-            for (Invoke invoke : graph.getInvokes()) {
-                MethodCallTargetNode callTarget = invoke.methodCallTarget();
+            for (MethodCallTargetNode callTarget : graph.getNodes(MethodCallTargetNode.class)) {
                 ResolvedJavaMethod callee = callTarget.targetMethod();
                 if (callee == method) {
                     final StructuredGraph originalGraph = new StructuredGraph(original);
                     new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getSnippetDefault(), OptimisticOptimizations.NONE).apply(originalGraph);
-                    InliningUtil.inline(invoke, originalGraph, true);
+                    InliningUtil.inline(callTarget.invoke(), originalGraph, true);
 
                     Debug.dump(graph, "after inlining %s", callee);
                     afterInline(graph, originalGraph);
@@ -365,7 +364,7 @@
                         } else {
                             targetGraph = parseGraph(callee, policy);
                         }
-                        InliningUtil.inline(invoke, targetGraph, true);
+                        InliningUtil.inline(callTarget.invoke(), targetGraph, true);
                         Debug.dump(graph, "after inlining %s", callee);
                         afterInline(graph, targetGraph);
                     }
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroNode.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroNode.java	Tue Apr 16 18:16:57 2013 +0200
@@ -42,10 +42,11 @@
 
     protected MacroNode(Invoke invoke) {
         super(invoke.asNode().stamp(), invoke.stateAfter());
-        this.arguments = new NodeInputList<>(this, invoke.methodCallTarget().arguments());
+        MethodCallTargetNode methodCallTarget = (MethodCallTargetNode) invoke.callTarget();
+        this.arguments = new NodeInputList<>(this, methodCallTarget.arguments());
         this.bci = invoke.bci();
-        this.targetMethod = invoke.methodCallTarget().targetMethod();
-        this.returnType = invoke.methodCallTarget().returnType();
+        this.targetMethod = methodCallTarget.targetMethod();
+        this.returnType = methodCallTarget.returnType();
     }
 
     public int getBci() {
@@ -92,11 +93,11 @@
 
     protected void replaceSnippetInvokes(StructuredGraph snippetGraph) {
         for (InvokeNode invoke : snippetGraph.getNodes(InvokeNode.class)) {
-            if (invoke.methodCallTarget().targetMethod() != getTargetMethod()) {
+            if (((MethodCallTargetNode) invoke.callTarget()).targetMethod() != getTargetMethod()) {
                 throw new GraalInternalError("unexpected invoke %s in snippet", getClass().getSimpleName());
             }
             if (invoke.stateAfter().bci == FrameState.INVALID_FRAMESTATE_BCI) {
-                InvokeNode newInvoke = snippetGraph.add(new InvokeNode(invoke.methodCallTarget(), getBci()));
+                InvokeNode newInvoke = snippetGraph.add(new InvokeNode(invoke.callTarget(), getBci()));
                 newInvoke.setStateAfter(snippetGraph.add(new FrameState(FrameState.AFTER_BCI)));
                 snippetGraph.replaceFixedWithFixed(invoke, newInvoke);
             } else {
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeParser.java	Tue Apr 16 18:16:47 2013 +0200
+++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeParser.java	Tue Apr 16 18:16:57 2013 +0200
@@ -62,9 +62,6 @@
                 if (node != null) {
                     String dump = parsed.dump();
                     log.message(Kind.ERROR, null, null, null, dump);
-                    // CheckStyle: stop system..print check
-                    System.out.println(dump);
-                    // CheckStyle: resume system..print check
                 }
             }
         } finally {