Mercurial > hg > graal-compiler
changeset 5579:8e6622e1fb7e
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
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 12 Jun 2012 23:42:31 +0200 |
parents | 445dd1a9b8d8 |
children | 69358a2182a3 |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/SystemSnippets.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/RuntimeCallNode.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/MathSnippetsX86.java |
diffstat | 3 files changed, 16 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- 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); } }
--- 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> T performCall) until boxing/unboxing is sorted out in intrinsification @SuppressWarnings("unused") @NodeIntrinsic - public static <S> double performCall(@ConstantNodeParameter RuntimeCall call, S arg1) { + public static <S> 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"); } }
--- 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); } }