Mercurial > hg > truffle
changeset 20953:c0455554d45b
SL: some minor simplifications.
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/SLExpressionNode.java Tue Apr 14 19:41:36 2015 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/SLExpressionNode.java Tue Apr 14 15:16:14 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.truffle.sl.nodes; -import java.math.*; - import com.oracle.truffle.api.dsl.*; import com.oracle.truffle.api.frame.*; import com.oracle.truffle.api.instrument.ProbeNode.WrapperNode; @@ -70,26 +68,14 @@ return SLTypesGen.expectLong(executeGeneric(frame)); } - public BigInteger executeBigInteger(VirtualFrame frame) throws UnexpectedResultException { - return SLTypesGen.expectBigInteger(executeGeneric(frame)); + public SLFunction executeFunction(VirtualFrame frame) throws UnexpectedResultException { + return SLTypesGen.expectSLFunction(executeGeneric(frame)); } public boolean executeBoolean(VirtualFrame frame) throws UnexpectedResultException { return SLTypesGen.expectBoolean(executeGeneric(frame)); } - public String executeString(VirtualFrame frame) throws UnexpectedResultException { - return SLTypesGen.expectString(executeGeneric(frame)); - } - - public SLFunction executeFunction(VirtualFrame frame) throws UnexpectedResultException { - return SLTypesGen.expectSLFunction(executeGeneric(frame)); - } - - public SLNull executeNull(VirtualFrame frame) throws UnexpectedResultException { - return SLTypesGen.expectSLNull(executeGeneric(frame)); - } - @Override public boolean isInstrumentable() { return true;
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/controlflow/SLBlockNode.java Tue Apr 14 19:41:36 2015 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/controlflow/SLBlockNode.java Tue Apr 14 15:16:14 2015 +0200 @@ -55,8 +55,7 @@ @ExplodeLoop public void executeVoid(VirtualFrame frame) { /* - * This assertion illustrates that the arryay length is really a constant during - * compilation. + * This assertion illustrates that the array length is really a constant during compilation. */ CompilerAsserts.compilationConstant(bodyNodes.length);
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLBigIntegerLiteralNode.java Tue Apr 14 19:41:36 2015 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLBigIntegerLiteralNode.java Tue Apr 14 15:16:14 2015 +0200 @@ -44,12 +44,7 @@ } @Override - public BigInteger executeBigInteger(VirtualFrame frame) { - return value; - } - - @Override - public Object executeGeneric(VirtualFrame frame) { + public BigInteger executeGeneric(VirtualFrame frame) { return value; } }
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLEqualNode.java Tue Apr 14 19:41:36 2015 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLEqualNode.java Tue Apr 14 15:16:14 2015 +0200 @@ -25,6 +25,7 @@ import java.math.*; import com.oracle.truffle.api.dsl.*; +import com.oracle.truffle.api.frame.*; import com.oracle.truffle.api.nodes.*; import com.oracle.truffle.api.source.*; import com.oracle.truffle.sl.nodes.*; @@ -47,6 +48,9 @@ super(src); } + @Override + public abstract boolean executeBoolean(VirtualFrame frame); + @Specialization protected boolean equal(long left, long right) { return left == right;
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLFunctionLiteralNode.java Tue Apr 14 19:41:36 2015 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLFunctionLiteralNode.java Tue Apr 14 15:16:14 2015 +0200 @@ -46,12 +46,7 @@ } @Override - public SLFunction executeFunction(VirtualFrame frame) { - return value; - } - - @Override - public Object executeGeneric(VirtualFrame frame) { + public SLFunction executeGeneric(VirtualFrame frame) { return value; } }
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLLessOrEqualNode.java Tue Apr 14 19:41:36 2015 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLLessOrEqualNode.java Tue Apr 14 15:16:14 2015 +0200 @@ -25,6 +25,7 @@ import java.math.*; import com.oracle.truffle.api.dsl.*; +import com.oracle.truffle.api.frame.*; import com.oracle.truffle.api.nodes.*; import com.oracle.truffle.api.source.*; import com.oracle.truffle.sl.nodes.*; @@ -39,6 +40,9 @@ super(src); } + @Override + public abstract boolean executeBoolean(VirtualFrame frame); + @Specialization protected boolean lessOrEqual(long left, long right) { return left <= right;
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLLessThanNode.java Tue Apr 14 19:41:36 2015 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLLessThanNode.java Tue Apr 14 15:16:14 2015 +0200 @@ -25,6 +25,7 @@ import java.math.*; import com.oracle.truffle.api.dsl.*; +import com.oracle.truffle.api.frame.*; import com.oracle.truffle.api.nodes.*; import com.oracle.truffle.api.source.*; import com.oracle.truffle.sl.nodes.*; @@ -40,6 +41,9 @@ super(src); } + @Override + public abstract boolean executeBoolean(VirtualFrame frame); + @Specialization protected boolean lessThan(long left, long right) { return left < right;
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLLogicalAndNode.java Tue Apr 14 19:41:36 2015 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLLogicalAndNode.java Tue Apr 14 15:16:14 2015 +0200 @@ -23,6 +23,7 @@ package com.oracle.truffle.sl.nodes.expression; import com.oracle.truffle.api.dsl.*; +import com.oracle.truffle.api.frame.*; import com.oracle.truffle.api.nodes.*; import com.oracle.truffle.api.source.*; import com.oracle.truffle.sl.nodes.*; @@ -44,6 +45,9 @@ super(src); } + @Override + public abstract boolean executeBoolean(VirtualFrame frame); + /** * This method is called after the left child was evaluated, but before the right child is * evaluated. The right child is only evaluated when the return value is {code true}.
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLLogicalNotNode.java Tue Apr 14 19:41:36 2015 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLLogicalNotNode.java Tue Apr 14 15:16:14 2015 +0200 @@ -23,6 +23,7 @@ package com.oracle.truffle.sl.nodes.expression; import com.oracle.truffle.api.dsl.*; +import com.oracle.truffle.api.frame.*; import com.oracle.truffle.api.nodes.*; import com.oracle.truffle.api.source.*; import com.oracle.truffle.sl.nodes.*; @@ -39,6 +40,9 @@ super(src); } + @Override + public abstract boolean executeBoolean(VirtualFrame frame); + @Specialization protected boolean doBoolean(boolean value) { return !value;
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLLogicalOrNode.java Tue Apr 14 19:41:36 2015 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLLogicalOrNode.java Tue Apr 14 15:16:14 2015 +0200 @@ -39,6 +39,9 @@ super(src); } + @Override + public abstract boolean executeBoolean(VirtualFrame frame); + @ShortCircuit("rightNode") protected boolean needsRightNode(boolean left) { return !left;
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLParenExpressionNode.java Tue Apr 14 19:41:36 2015 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLParenExpressionNode.java Tue Apr 14 15:16:14 2015 +0200 @@ -22,13 +22,10 @@ */ package com.oracle.truffle.sl.nodes.expression; -import java.math.*; - import com.oracle.truffle.api.frame.*; import com.oracle.truffle.api.nodes.*; import com.oracle.truffle.api.source.*; import com.oracle.truffle.sl.nodes.*; -import com.oracle.truffle.sl.runtime.*; /** * A {@link SLExpressionNode} that represents a parenthesized expression; it simply returns the @@ -57,27 +54,8 @@ } @Override - public BigInteger executeBigInteger(VirtualFrame frame) throws UnexpectedResultException { - return expression.executeBigInteger(frame); - } - - @Override public boolean executeBoolean(VirtualFrame frame) throws UnexpectedResultException { return expression.executeBoolean(frame); } - @Override - public String executeString(VirtualFrame frame) throws UnexpectedResultException { - return expression.executeString(frame); - } - - @Override - public SLFunction executeFunction(VirtualFrame frame) throws UnexpectedResultException { - return expression.executeFunction(frame); - } - - @Override - public SLNull executeNull(VirtualFrame frame) throws UnexpectedResultException { - return expression.executeNull(frame); - } }
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLStringLiteralNode.java Tue Apr 14 19:41:36 2015 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLStringLiteralNode.java Tue Apr 14 15:16:14 2015 +0200 @@ -41,12 +41,7 @@ } @Override - public String executeString(VirtualFrame frame) { - return value; - } - - @Override - public Object executeGeneric(VirtualFrame frame) { + public String executeGeneric(VirtualFrame frame) { return value; } }
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/instrument/SLExpressionWrapperNode.java Tue Apr 14 19:41:36 2015 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/instrument/SLExpressionWrapperNode.java Tue Apr 14 15:16:14 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.truffle.sl.nodes.instrument; -import java.math.*; - import com.oracle.truffle.api.frame.*; import com.oracle.truffle.api.instrument.*; import com.oracle.truffle.api.instrument.ProbeNode.WrapperNode; @@ -101,21 +99,11 @@ } @Override - public BigInteger executeBigInteger(VirtualFrame vFrame) throws UnexpectedResultException { - return SLTypesGen.expectBigInteger(executeGeneric(vFrame)); - } - - @Override public boolean executeBoolean(VirtualFrame vFrame) throws UnexpectedResultException { return SLTypesGen.expectBoolean(executeGeneric(vFrame)); } @Override - public String executeString(VirtualFrame vFrame) throws UnexpectedResultException { - return SLTypesGen.expectString(executeGeneric(vFrame)); - } - - @Override public SLFunction executeFunction(VirtualFrame vFrame) throws UnexpectedResultException { probeNode.enter(child, vFrame); SLFunction result; @@ -130,8 +118,4 @@ return result; } - @Override - public SLNull executeNull(VirtualFrame vFrame) throws UnexpectedResultException { - return SLTypesGen.expectSLNull(executeGeneric(vFrame)); - } }