Mercurial > hg > graal-compiler
changeset 13911:3e0cc5cc5dc0
Simplify IntegerArithmeticNode.add/mul/sub
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Fri, 07 Feb 2014 17:31:48 +0100 |
parents | d25c52a893d9 |
children | 766de6735435 |
files | graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerArithmeticNode.java |
diffstat | 1 files changed, 3 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerArithmeticNode.java Fri Feb 07 17:51:14 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerArithmeticNode.java Fri Feb 07 17:31:48 2014 +0100 @@ -35,37 +35,16 @@ public static IntegerAddNode add(StructuredGraph graph, ValueNode v1, ValueNode v2) { assert v1.kind() == v2.kind(); - switch (v1.kind()) { - case Int: - return graph.unique(new IntegerAddNode(Kind.Int, v1, v2)); - case Long: - return graph.unique(new IntegerAddNode(Kind.Long, v1, v2)); - default: - throw ValueNodeUtil.shouldNotReachHere(); - } + return graph.unique(new IntegerAddNode(v1.kind(), v1, v2)); } public static IntegerMulNode mul(StructuredGraph graph, ValueNode v1, ValueNode v2) { assert v1.kind() == v2.kind(); - switch (v1.kind()) { - case Int: - return graph.unique(new IntegerMulNode(Kind.Int, v1, v2)); - case Long: - return graph.unique(new IntegerMulNode(Kind.Long, v1, v2)); - default: - throw ValueNodeUtil.shouldNotReachHere(); - } + return graph.unique(new IntegerMulNode(v1.kind(), v1, v2)); } public static IntegerSubNode sub(StructuredGraph graph, ValueNode v1, ValueNode v2) { assert v1.kind() == v2.kind(); - switch (v1.kind()) { - case Int: - return graph.unique(new IntegerSubNode(Kind.Int, v1, v2)); - case Long: - return graph.unique(new IntegerSubNode(Kind.Long, v1, v2)); - default: - throw ValueNodeUtil.shouldNotReachHere(); - } + return graph.unique(new IntegerSubNode(v1.kind(), v1, v2)); } }