Mercurial > hg > truffle
changeset 14741:8c0e5b7d5af9
Do not call @NodeIntrinsic method from within Graal
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Tue, 25 Mar 2014 11:48:33 -0700 |
parents | 470e1e6664e2 |
children | ed8533832ea4 |
files | graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MathIntrinsicNode.java |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MathIntrinsicNode.java Tue Mar 25 11:47:43 2014 -0700 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MathIntrinsicNode.java Tue Mar 25 11:48:33 2014 -0700 @@ -88,7 +88,7 @@ public Constant evalConst(Constant... inputs) { assert inputs.length == 1; - return Constant.forDouble(compute(inputs[0].asDouble(), operation())); + return Constant.forDouble(doCompute(inputs[0].asDouble(), operation())); } @Override @@ -101,6 +101,10 @@ @NodeIntrinsic public static double compute(double value, @ConstantNodeParameter Operation op) { + return doCompute(value, op); + } + + private static double doCompute(double value, Operation op) throws GraalInternalError { switch (op) { case ABS: return Math.abs(value);