# HG changeset patch # User Doug Simon # Date 1339537351 -7200 # Node ID 8e6622e1fb7e5f1750afe1f11e907ec269bdaddd # Parent 445dd1a9b8d898c9434363fb1ada25138263ffd4 renamed node intrinsic methods in RuntimeCallNode to better distinguish return type modified RuntimeCallNode to use a varargs constructor for more flexibility in node intrinsics improved toString(Verbosity.Name) value for RuntimeCallNode diff -r 445dd1a9b8d8 -r 8e6622e1fb7e graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/SystemSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/SystemSnippets.java Tue Jun 12 23:38:16 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/SystemSnippets.java Tue Jun 12 23:42:31 2012 +0200 @@ -33,11 +33,11 @@ public class SystemSnippets implements SnippetsInterface { public static long currentTimeMillis() { - return RuntimeCallNode.performCall(RuntimeCall.JavaTimeMillis); + return RuntimeCallNode.callLong(RuntimeCall.JavaTimeMillis); } public static long nanoTime() { - return RuntimeCallNode.performCall(RuntimeCall.JavaTimeNanos); + return RuntimeCallNode.callLong(RuntimeCall.JavaTimeNanos); } } diff -r 445dd1a9b8d8 -r 8e6622e1fb7e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/RuntimeCallNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/RuntimeCallNode.java Tue Jun 12 23:38:16 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/RuntimeCallNode.java Tue Jun 12 23:42:31 2012 +0200 @@ -39,11 +39,7 @@ this(call, new ValueNode[0]); } - public RuntimeCallNode(RuntimeCall call, ValueNode arg1) { - this(call, new ValueNode[] {arg1}); - } - - public RuntimeCallNode(RuntimeCall call, ValueNode[] arguments) { + public RuntimeCallNode(RuntimeCall call, ValueNode... arguments) { super(StampFactory.forKind(call.resultKind), arguments); this.call = call; } @@ -53,16 +49,24 @@ gen.emitRuntimeCall(this); } + @Override + public String toString(Verbosity verbosity) { + if (verbosity == Verbosity.Name) { + return super.toString(verbosity) + "#" + call; + } + return super.toString(verbosity); + } + // specialized on return type (instead of public static T performCall) until boxing/unboxing is sorted out in intrinsification @SuppressWarnings("unused") @NodeIntrinsic - public static double performCall(@ConstantNodeParameter RuntimeCall call, S arg1) { + public static double callDouble(@ConstantNodeParameter RuntimeCall call, S arg1) { throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler"); } @SuppressWarnings("unused") @NodeIntrinsic - public static long performCall(@ConstantNodeParameter RuntimeCall call) { + public static long callLong(@ConstantNodeParameter RuntimeCall call) { throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler"); } } diff -r 445dd1a9b8d8 -r 8e6622e1fb7e graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/MathSnippetsX86.java --- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/MathSnippetsX86.java Tue Jun 12 23:38:16 2012 +0200 +++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/MathSnippetsX86.java Tue Jun 12 23:42:31 2012 +0200 @@ -61,7 +61,7 @@ if (abs(x) < PI_4) { return MathIntrinsicNode.compute(x, Operation.SIN); } else { - return RuntimeCallNode.performCall(RuntimeCall.ArithmeticSin, x); + return RuntimeCallNode.callDouble(RuntimeCall.ArithmeticSin, x); } } @@ -69,7 +69,7 @@ if (abs(x) < PI_4) { return MathIntrinsicNode.compute(x, Operation.COS); } else { - return RuntimeCallNode.performCall(RuntimeCall.ArithmeticCos, x); + return RuntimeCallNode.callDouble(RuntimeCall.ArithmeticCos, x); } } @@ -77,7 +77,7 @@ if (abs(x) < PI_4) { return MathIntrinsicNode.compute(x, Operation.TAN); } else { - return RuntimeCallNode.performCall(RuntimeCall.ArithmeticTan, x); + return RuntimeCallNode.callDouble(RuntimeCall.ArithmeticTan, x); } }