# HG changeset patch # User Christian Humer # Date 1365437753 -7200 # Node ID c3ec5230967a3568d7eb4c4abbdb8462fcd3c99c # Parent 216dce75d5ac7a7785027ded607301fc2ab67a19 Added default execute methods for Truffle-SL. diff -r 216dce75d5ac -r c3ec5230967a graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/ConditionNode.java --- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/ConditionNode.java Mon Apr 08 17:02:55 2013 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/ConditionNode.java Mon Apr 08 18:15:53 2013 +0200 @@ -28,4 +28,9 @@ public abstract boolean executeCondition(VirtualFrame frame); + @Override + public void executeVoid(VirtualFrame frame) { + executeCondition(frame); + } + } diff -r 216dce75d5ac -r c3ec5230967a graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/TypedNode.java --- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/TypedNode.java Mon Apr 08 17:02:55 2013 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/TypedNode.java Mon Apr 08 18:15:53 2013 +0200 @@ -26,6 +26,7 @@ import com.oracle.truffle.api.frame.*; import com.oracle.truffle.api.nodes.*; +import com.oracle.truffle.sl.*; public abstract class TypedNode extends ConditionNode { @@ -38,15 +39,28 @@ } } - public abstract boolean executeBoolean(VirtualFrame frame) throws UnexpectedResultException; + public abstract Object executeGeneric(VirtualFrame frame); - public abstract int executeInteger(VirtualFrame frame) throws UnexpectedResultException; + public boolean executeBoolean(VirtualFrame frame) throws UnexpectedResultException { + return SLTypesGen.SLTYPES.expectBoolean(executeGeneric(frame)); + } + + public int executeInteger(VirtualFrame frame) throws UnexpectedResultException { + return SLTypesGen.SLTYPES.expectInteger(executeGeneric(frame)); + } - public abstract BigInteger executeBigInteger(VirtualFrame frame) throws UnexpectedResultException; + public BigInteger executeBigInteger(VirtualFrame frame) throws UnexpectedResultException { + return SLTypesGen.SLTYPES.expectBigInteger(executeGeneric(frame)); + } - public abstract String executeString(VirtualFrame frame) throws UnexpectedResultException; + public String executeString(VirtualFrame frame) throws UnexpectedResultException { + return SLTypesGen.SLTYPES.expectString(executeGeneric(frame)); + } - public abstract Object executeGeneric(VirtualFrame frame); + @Override + public void executeVoid(VirtualFrame frame) { + executeGeneric(frame); + } public boolean isString(Object a, Object b) { return a instanceof String || b instanceof String;