Added:
/src/org/ductilej/runtime/Binop.java
/src/org/ductilej/runtime/Unop.java
Deleted:
/src/org/ductilej/runtime/ops/OpsUtil.java
Modified:
/src/org/ductilej/detyper/Detype.java
/src/org/ductilej/runtime/RT.java
=======================================
--- /dev/null
+++ /src/org/ductilej/runtime/Binop.java Sat Jul 10 11:48:44 2010
@@ -0,0 +1,245 @@
+//
+// $Id$
+
+package org.ductilej.runtime;
+
+import java.util.Map;
+
+import com.google.common.collect.ImmutableMap;
+
+import org.ductilej.runtime.ops.*;
+
+/**
+ * Used to dispatch binary operations at runtime.
+ */
+public enum Binop {
+ EQUAL_TO {
+ public Object invoke (Object lhs, Object rhs) {
+ return isEqualTo(lhs, rhs);
+ }
+ },
+ NOT_EQUAL_TO {
+ public Object invoke (Object lhs, Object rhs) {
+ return !isEqualTo(lhs, rhs);
+ }
+ },
+
+ PLUS {
+ public Object invoke (Object lhs, Object rhs) {
+ if (lhs instanceof String || rhs instanceof String) {
+ return String.valueOf(lhs) + String.valueOf(rhs);
+ } else {
+ return get(lhs, rhs).plus(lhs, rhs);
+ }
+ }
+ },
+ MINUS {
+ public Object invoke (Object lhs, Object rhs) {
+ return get(lhs, rhs).minus(lhs, rhs);
+ }
+ },
+ MULTIPLY {
+ public Object invoke (Object lhs, Object rhs) {
+ return get(lhs, rhs).multiply(lhs, rhs);
+ }
+ },
+ DIVIDE {
+ public Object invoke (Object lhs, Object rhs) {
+ return get(lhs, rhs).divide(lhs, rhs);
+ }
+ },
+ REMAINDER {
+ public Object invoke (Object lhs, Object rhs) {
+ return get(lhs, rhs).remainder(lhs, rhs);
+ }
+ },
+
+ LESS_THAN {
+ public Object invoke (Object lhs, Object rhs) {
+ return get(lhs, rhs).lessThan(lhs, rhs);
+ }
+ },
+ GREATER_THAN {
+ public Object invoke (Object lhs, Object rhs) {
+ return get(lhs, rhs).greaterThan(lhs, rhs);
+ }
+ },
+ LESS_THAN_EQUAL {
+ public Object invoke (Object lhs, Object rhs) {
+ return get(lhs, rhs).lessThanEq(lhs, rhs);
+ }
+ },
+ GREATER_THAN_EQUAL {
+ public Object invoke (Object lhs, Object rhs) {
+ return get(lhs, rhs).greaterThanEq(lhs, rhs);
+ }
+ },
+
+ OR {
+ public Object invoke (Object lhs, Object rhs) {
+ return get(lhs, rhs).bitOr(lhs, rhs);
+ }
+ },
+ AND {
+ public Object invoke (Object lhs, Object rhs) {
+ return get(lhs, rhs).bitAnd(lhs, rhs);
+ }
+ },
+ XOR {
+ public Object invoke (Object lhs, Object rhs) {
+ return get(lhs, rhs).bitXor(lhs, rhs);
+ }
+ },
+
+ LEFT_SHIFT {
+ public Object invoke (Object lhs, Object rhs) {
+ return get(lhs, rhs).leftShift(lhs, rhs);
+ }
+ },
+ RIGHT_SHIFT {
+ public Object invoke (Object lhs, Object rhs) {
+ return get(lhs, rhs).rightShift(lhs, rhs);
+ }
+ },
+ UNSIGNED_RIGHT_SHIFT {
+ public Object invoke (Object lhs, Object rhs) {
+ return get(lhs, rhs).unsignedRightShift(lhs, rhs);
+ }
+ },
+
+ CONDITIONAL_AND {
+ public Object invoke (Object lhs, Object rhs) {
+ throw new IllegalArgumentException("&& should not be lifted");
+ }
+ },
+ CONDITIONAL_OR {
+ public Object invoke (Object lhs, Object rhs) {
+ throw new IllegalArgumentException("|| should not be lifted");
+ }
+ };
+
+ // conditional and and or are not detyped
+ // CONDITIONAL_AND
+ // CONDITIONAL_OR
+
+ // the assignment operators are transformed into non-assignment
versions by the detyper
+ // MULTIPLY_ASSIGNMENT
+ // DIVIDE_ASSIGNMENT
+ // REMAINDER_ASSIGNMENT
+ // PLUS_ASSIGNMENT
+ // MINUS_ASSIGNMENT
+ // LEFT_SHIFT_ASSIGNMENT
+ // RIGHT_SHIFT_ASSIGNMENT
+ // UNSIGNED_RIGHT_SHIFT_ASSIGNMENT
+ // AND_ASSIGNMENT
+ // XOR_ASSIGNMENT
+ // OR_ASSIGNMENT
+
+ /**
+ * Executes this operation.
+ */
+ public abstract Object invoke (Object lhs, Object rhs);
+
+ /**
+ * Returns the {@link BinOps} instance appropriate for the supplied
left- and right-hand-sides
+ * of a binary expression.
+ */
+ protected static BinOps get (Object lhs, Object rhs)
+ {
+ // TODO: we probably want this check here, though it will hurt
performance
+ // if (lhs == null || rhs == null) {
+ // throw new NullPointerException(
+ // "Binary op (" + opcode + ") on null arg (lhs=" + lhs
+ ", rhs=" + rhs + ")");
+ // }
+ return BINOPS.get(lhs.getClass()).get(rhs.getClass());
+ }
+
+ /**
+ * Compares the two instances for equality. If the instances represent
primitive types,
+ * implicit coercions may be performed on them as appropriate. If
either instance is not a
+ * coercible primitive type (non-boolean), reference equality is
returned.
+ */
+ protected static boolean isEqualTo (Object lhs, Object rhs)
+ {
+ if (lhs != null && rhs != null) {
+ Map<Class<?>, BinOps> omap = BINOPS.get(lhs.getClass());
+ if (omap != null) {
+ BinOps ops = omap.get(rhs.getClass());
+ if (ops != null) {
+ return ops.equalTo(lhs, rhs);
+ }
+ }
+ }
+ return (lhs == rhs);
+ }
+
+ protected static final Map<Class<?>, Map<Class<?>, BinOps>> BINOPS =
+ ImmutableMap.<Class<?>, Map<Class<?>, BinOps>>builder().
+ put(Boolean.class, ImmutableMap.<Class<?>, BinOps>builder().
+ put(Boolean.class, new BooleanBooleanOps()).
+ build()).
+ put(Byte.class, ImmutableMap.<Class<?>, BinOps>builder().
+ put(Byte.class, new ByteByteOps()).
+ put(Short.class, new ByteShortOps()).
+ put(Character.class, new ByteCharacterOps()).
+ put(Integer.class, new ByteIntegerOps()).
+ put(Long.class, new ByteLongOps()).
+ put(Float.class, new ByteFloatOps()).
+ put(Double.class, new ByteDoubleOps()).
+ build()).
+ put(Short.class, ImmutableMap.<Class<?>, BinOps>builder().
+ put(Byte.class, new ShortByteOps()).
+ put(Short.class, new ShortShortOps()).
+ put(Character.class, new ShortCharacterOps()).
+ put(Integer.class, new ShortIntegerOps()).
+ put(Long.class, new ShortLongOps()).
+ put(Float.class, new ShortFloatOps()).
+ put(Double.class, new ShortDoubleOps()).
+ build()).
+ put(Character.class, ImmutableMap.<Class<?>, BinOps>builder().
+ put(Byte.class, new CharacterByteOps()).
+ put(Short.class, new CharacterShortOps()).
+ put(Character.class, new CharacterCharacterOps()).
+ put(Integer.class, new CharacterIntegerOps()).
+ put(Long.class, new CharacterLongOps()).
+ put(Float.class, new CharacterFloatOps()).
+ put(Double.class, new CharacterDoubleOps()).
+ build()).
+ put(Integer.class, ImmutableMap.<Class<?>, BinOps>builder().
+ put(Byte.class, new IntegerByteOps()).
+ put(Short.class, new IntegerShortOps()).
+ put(Character.class, new IntegerCharacterOps()).
+ put(Integer.class, new IntegerIntegerOps()).
+ put(Long.class, new IntegerLongOps()).
+ put(Float.class, new IntegerFloatOps()).
+ put(Double.class, new IntegerDoubleOps()).
+ build()).
+ put(Long.class, ImmutableMap.<Class<?>, BinOps>builder().
+ put(Byte.class, new LongByteOps()).
+ put(Short.class, new LongShortOps()).
+ put(Character.class, new LongCharacterOps()).
+ put(Integer.class, new LongIntegerOps()).
+ put(Long.class, new LongLongOps()).
+ put(Float.class, new LongFloatOps()).
+ put(Double.class, new LongDoubleOps()).
+ build()).
+ put(Float.class, ImmutableMap.<Class<?>, BinOps>builder().
+ put(Byte.class, new FloatByteOps()).
+ put(Short.class, new FloatShortOps()).
+ put(Character.class, new FloatCharacterOps()).
+ put(Integer.class, new FloatIntegerOps()).
+ put(Long.class, new FloatLongOps()).
+ put(Float.class, new FloatFloatOps()).
+ put(Double.class, new FloatDoubleOps()).
+ build()).
+ put(Double.class, ImmutableMap.<Class<?>, BinOps>builder().
+ put(Byte.class, new DoubleByteOps()).
+ put(Short.class, new DoubleShortOps()).
+ put(Character.class, new DoubleCharacterOps()).
+ put(Integer.class, new DoubleIntegerOps()).
+ put(Long.class, new DoubleLongOps()).
+ put(Float.class, new DoubleFloatOps()).
+ put(Double.class, new DoubleDoubleOps()).
+ build()).
+ build();
+}
=======================================
--- /dev/null
+++ /src/org/ductilej/runtime/Unop.java Sat Jul 10 11:48:44 2010
@@ -0,0 +1,89 @@
+//
+// $Id$
+
+package org.ductilej.runtime;
+
+import java.util.Map;
+
+import com.google.common.collect.ImmutableMap;
+
+import org.ductilej.runtime.ops.*;
+
+/**
+ * Used to dispatch unary operations at runtime.
+ */
+public enum Unop
+{
+ UNARY_MINUS {
+ public Object invoke (Object arg) {
+ return get(arg).minus(arg);
+ }
+ },
+ UNARY_PLUS {
+ public Object invoke (Object arg) {
+ return get(arg).plus(arg);
+ }
+ },
+
+ BITWISE_COMPLEMENT {
+ public Object invoke (Object arg) {
+ return get(arg).bitComp(arg);
+ }
+ },
+ LOGICAL_COMPLEMENT {
+ public Object invoke (Object arg) {
+ return get(arg).logicalComp(arg);
+ }
+ },
+
+ // the side effects for these operations are handled by rewriting the
AST, so they simply
+ // need to return an incremented or decremented value
+ PREFIX_INCREMENT {
+ public Object invoke (Object arg) {
+ return get(arg).increment(arg);
+ }
+ },
+ POSTFIX_INCREMENT {
+ public Object invoke (Object arg) {
+ return get(arg).increment(arg);
+ }
+ },
+ PREFIX_DECREMENT {
+ public Object invoke (Object arg) {
+ return get(arg).decrement(arg);
+ }
+ },
+ POSTFIX_DECREMENT {
+ public Object invoke (Object arg) {
+ return get(arg).decrement(arg);
+ }
+ };
+
+ /**
+ * Executes this unary operation.
+ */
+ public abstract Object invoke (Object arg);
+
+ /**
+ * Returns the {@link UnOps} instance appropriate for the supplied
expression argument type.
+ */
+ protected static UnOps get (Object arg)
+ {
+ // TODO: we probably want this check here, though it will hurt
performance
+ // if (arg == null) {
+ // throw new NullPointerException("Unary op (" + opcode + ")
on null arg.");
+ // }
+ return UNOPS.get(arg.getClass());
+ }
+
+ protected static final Map<Class<?>, UnOps> UNOPS =
ImmutableMap.<Class<?>, UnOps>builder().
+ put(Boolean.class, new BooleanOps()).
+ put(Byte.class, new ByteOps()).
+ put(Short.class, new ShortOps()).
+ put(Character.class, new CharacterOps()).
+ put(Integer.class, new IntegerOps()).
+ put(Long.class, new LongOps()).
+ put(Float.class, new FloatOps()).
+ put(Double.class, new DoubleOps()).
+ build();
+}
=======================================
--- /src/org/ductilej/runtime/ops/OpsUtil.java Fri Jul 9 15:54:45 2010
+++ /dev/null
@@ -1,143 +0,0 @@
-//
-// $Id$
-
-package org.ductilej.runtime.ops;
-
-import java.util.Map;
-
-import com.google.common.collect.ImmutableMap;
-
-import org.ductilej.runtime.BinOps;
-import org.ductilej.runtime.UnOps;
-
-/**
- * Provides access to the myriad registered operations.
- */
-public class OpsUtil
-{
- /**
- * Returns the {@link UnOps} instance appropriate for the supplied
expression argument type.
- */
- public static UnOps get (Object arg)
- {
- // TODO: we probably want this check here, though it will hurt
performance
- // if (arg == null) {
- // throw new NullPointerException("Unary op (" + opcode + ")
on null arg.");
- // }
- return UNOPS.get(arg.getClass());
- }
-
- /**
- * Returns the {@link BinOps} instance appropriate for the supplied
left- and right-hand-sides
- * of a binary expression.
- */
- public static BinOps get (Object lhs, Object rhs)
- {
- // TODO: we probably want this check here, though it will hurt
performance
- // if (lhs == null || rhs == null) {
- // throw new NullPointerException(
- // "Binary op (" + opcode + ") on null arg (lhs=" + lhs
+ ", rhs=" + rhs + ")");
- // }
- return BINOPS.get(lhs.getClass()).get(rhs.getClass());
- }
-
- /**
- * Compares the two instances for equality. If the instances represent
primitive types,
- * implicit coercions may be performed on them as appropriate. If
either instance is not a
- * coercible primitive type (non-boolean), reference equality is
returned.
- */
- public static boolean isEqualTo (Object lhs, Object rhs)
- {
- if (lhs != null && rhs != null) {
- Map<Class<?>, BinOps> omap = BINOPS.get(lhs.getClass());
- if (omap != null) {
- BinOps ops = omap.get(rhs.getClass());
- if (ops != null) {
- return ops.equalTo(lhs, rhs);
- }
- }
- }
- return (lhs == rhs);
- }
-
- protected static final Map<Class<?>, UnOps> UNOPS =
ImmutableMap.<Class<?>, UnOps>builder().
- put(Boolean.class, new BooleanOps()).
- put(Byte.class, new ByteOps()).
- put(Short.class, new ShortOps()).
- put(Character.class, new CharacterOps()).
- put(Integer.class, new IntegerOps()).
- put(Long.class, new LongOps()).
- put(Float.class, new FloatOps()).
- put(Double.class, new DoubleOps()).
- build();
-
- protected static final Map<Class<?>, Map<Class<?>, BinOps>> BINOPS =
- ImmutableMap.<Class<?>, Map<Class<?>, BinOps>>builder().
- put(Boolean.class, ImmutableMap.<Class<?>, BinOps>builder().
- put(Boolean.class, new BooleanBooleanOps()).
- build()).
- put(Byte.class, ImmutableMap.<Class<?>, BinOps>builder().
- put(Byte.class, new ByteByteOps()).
- put(Short.class, new ByteShortOps()).
- put(Character.class, new ByteCharacterOps()).
- put(Integer.class, new ByteIntegerOps()).
- put(Long.class, new ByteLongOps()).
- put(Float.class, new ByteFloatOps()).
- put(Double.class, new ByteDoubleOps()).
- build()).
- put(Short.class, ImmutableMap.<Class<?>, BinOps>builder().
- put(Byte.class, new ShortByteOps()).
- put(Short.class, new ShortShortOps()).
- put(Character.class, new ShortCharacterOps()).
- put(Integer.class, new ShortIntegerOps()).
- put(Long.class, new ShortLongOps()).
- put(Float.class, new ShortFloatOps()).
- put(Double.class, new ShortDoubleOps()).
- build()).
- put(Character.class, ImmutableMap.<Class<?>, BinOps>builder().
- put(Byte.class, new CharacterByteOps()).
- put(Short.class, new CharacterShortOps()).
- put(Character.class, new CharacterCharacterOps()).
- put(Integer.class, new CharacterIntegerOps()).
- put(Long.class, new CharacterLongOps()).
- put(Float.class, new CharacterFloatOps()).
- put(Double.class, new CharacterDoubleOps()).
- build()).
- put(Integer.class, ImmutableMap.<Class<?>, BinOps>builder().
- put(Byte.class, new IntegerByteOps()).
- put(Short.class, new IntegerShortOps()).
- put(Character.class, new IntegerCharacterOps()).
- put(Integer.class, new IntegerIntegerOps()).
- put(Long.class, new IntegerLongOps()).
- put(Float.class, new IntegerFloatOps()).
- put(Double.class, new IntegerDoubleOps()).
- build()).
- put(Long.class, ImmutableMap.<Class<?>, BinOps>builder().
- put(Byte.class, new LongByteOps()).
- put(Short.class, new LongShortOps()).
- put(Character.class, new LongCharacterOps()).
- put(Integer.class, new LongIntegerOps()).
- put(Long.class, new LongLongOps()).
- put(Float.class, new LongFloatOps()).
- put(Double.class, new LongDoubleOps()).
- build()).
- put(Float.class, ImmutableMap.<Class<?>, BinOps>builder().
- put(Byte.class, new FloatByteOps()).
- put(Short.class, new FloatShortOps()).
- put(Character.class, new FloatCharacterOps()).
- put(Integer.class, new FloatIntegerOps()).
- put(Long.class, new FloatLongOps()).
- put(Float.class, new FloatFloatOps()).
- put(Double.class, new FloatDoubleOps()).
- build()).
- put(Double.class, ImmutableMap.<Class<?>, BinOps>builder().
- put(Byte.class, new DoubleByteOps()).
- put(Short.class, new DoubleShortOps()).
- put(Character.class, new DoubleCharacterOps()).
- put(Integer.class, new DoubleIntegerOps()).
- put(Long.class, new DoubleLongOps()).
- put(Float.class, new DoubleFloatOps()).
- put(Double.class, new DoubleDoubleOps()).
- build()).
- build();
-}
=======================================
--- /src/org/ductilej/detyper/Detype.java Fri Jul 9 15:54:45 2010
+++ /src/org/ductilej/detyper/Detype.java Sat Jul 10 11:48:44 2010
@@ -35,9 +35,11 @@
import com.sun.tools.javac.util.Name; // Name.Table -> Names in OpenJDK
import com.sun.tools.javac.util.Names;
+import org.ductilej.runtime.Binop;
import org.ductilej.runtime.Debug;
import org.ductilej.runtime.RT;
import org.ductilej.runtime.Transformed;
+import org.ductilej.runtime.Unop;
import org.ductilej.util.ASTUtil;
import org.ductilej.util.PathedTreeTranslator;
@@ -1204,13 +1206,13 @@
protected JCMethodInvocation unop (int pos, Tree.Kind op, JCExpression
arg)
{
return _tmaker.at(pos).Apply(
- null, mkFA(RT.class.getName() + ".Unop." + op + ".invoke",
pos), List.of(arg));
+ null, mkFA(Unop.class.getName() + "." + op + ".invoke", pos),
List.of(arg));
}
protected JCMethodInvocation binop (int pos, Tree.Kind op,
JCExpression lhs, JCExpression rhs)
{
return _tmaker.at(pos).Apply(
- null, mkFA(RT.class.getName() + ".Binop." + op + ".invoke",
pos), List.of(lhs, rhs));
+ null, mkFA(Binop.class.getName() + "." + op + ".invoke", pos),
List.of(lhs, rhs));
}
/**
=======================================
--- /src/org/ductilej/runtime/RT.java Sat Jul 10 11:38:58 2010
+++ /src/org/ductilej/runtime/RT.java Sat Jul 10 11:48:44 2010
@@ -29,8 +29,6 @@
import com.google.common.collect.Multimap;
import com.google.common.primitives.*;
-import org.ductilej.runtime.ops.OpsUtil;
-
/**
* Provides dynamic method dispatch, operator evaluation and other bits.
*/
@@ -38,187 +36,6 @@
{
/** A suffix appended to signature mangled method names. */
public static final String MM_SUFFIX = "$M";
-
- /** Used to dispatch unary operations at runtime. */
- public enum Unop {
- UNARY_MINUS {
- public Object invoke (Object arg) {
- return OpsUtil.get(arg).minus(arg);
- }
- },
- UNARY_PLUS {
- public Object invoke (Object arg) {
- return OpsUtil.get(arg).plus(arg);
- }
- },
-
- BITWISE_COMPLEMENT {
- public Object invoke (Object arg) {
- return OpsUtil.get(arg).bitComp(arg);
- }
- },
- LOGICAL_COMPLEMENT {
- public Object invoke (Object arg) {
- return OpsUtil.get(arg).logicalComp(arg);
- }
- },
-
- // the side effects for these operations are handled by rewriting
the AST, so they simply
- // need to return an incremented or decremented value
- PREFIX_INCREMENT {
- public Object invoke (Object arg) {
- return OpsUtil.get(arg).increment(arg);
- }
- },
- POSTFIX_INCREMENT {
- public Object invoke (Object arg) {
- return OpsUtil.get(arg).increment(arg);
- }
- },
- PREFIX_DECREMENT {
- public Object invoke (Object arg) {
- return OpsUtil.get(arg).decrement(arg);
- }
- },
- POSTFIX_DECREMENT {
- public Object invoke (Object arg) {
- return OpsUtil.get(arg).decrement(arg);
- }
- };
-
- public Object invoke (Object arg) {
- throw new IllegalArgumentException(this + " not supported.");
- }
- }
-
- /** Used to dispatch binary operations at runtime. */
- public enum Binop {
- EQUAL_TO {
- public Object invoke (Object lhs, Object rhs) {
- return OpsUtil.isEqualTo(lhs, rhs);
- }
- },
- NOT_EQUAL_TO {
- public Object invoke (Object lhs, Object rhs) {
- return !OpsUtil.isEqualTo(lhs, rhs);
- }
- },
-
- PLUS {
- public Object invoke (Object lhs, Object rhs) {
- if (lhs instanceof String || rhs instanceof String) {
- return String.valueOf(lhs) + String.valueOf(rhs);
- } else {
- return OpsUtil.get(lhs, rhs).plus(lhs, rhs);
- }
- }
- },
- MINUS {
- public Object invoke (Object lhs, Object rhs) {
- return OpsUtil.get(lhs, rhs).minus(lhs, rhs);
- }
- },
- MULTIPLY {
- public Object invoke (Object lhs, Object rhs) {
- return OpsUtil.get(lhs, rhs).multiply(lhs, rhs);
- }
- },
- DIVIDE {
- public Object invoke (Object lhs, Object rhs) {
- return OpsUtil.get(lhs, rhs).divide(lhs, rhs);
- }
- },
- REMAINDER {
- public Object invoke (Object lhs, Object rhs) {
- return OpsUtil.get(lhs, rhs).remainder(lhs, rhs);
- }
- },
-
- LESS_THAN {
- public Object invoke (Object lhs, Object rhs) {
- return OpsUtil.get(lhs, rhs).lessThan(lhs, rhs);
- }
- },
- GREATER_THAN {
- public Object invoke (Object lhs, Object rhs) {
- return OpsUtil.get(lhs, rhs).greaterThan(lhs, rhs);
- }
- },
- LESS_THAN_EQUAL {
- public Object invoke (Object lhs, Object rhs) {
- return OpsUtil.get(lhs, rhs).lessThanEq(lhs, rhs);
- }
- },
- GREATER_THAN_EQUAL {
- public Object invoke (Object lhs, Object rhs) {
- return OpsUtil.get(lhs, rhs).greaterThanEq(lhs, rhs);
- }
- },
-
- OR {
- public Object invoke (Object lhs, Object rhs) {
- return OpsUtil.get(lhs, rhs).bitOr(lhs, rhs);
- }
- },
- AND {
- public Object invoke (Object lhs, Object rhs) {
- return OpsUtil.get(lhs, rhs).bitAnd(lhs, rhs);
- }
- },
- XOR {
- public Object invoke (Object lhs, Object rhs) {
- return OpsUtil.get(lhs, rhs).bitXor(lhs, rhs);
- }
- },
-
- LEFT_SHIFT {
- public Object invoke (Object lhs, Object rhs) {
- return OpsUtil.get(lhs, rhs).leftShift(lhs, rhs);
- }
- },
- RIGHT_SHIFT {
- public Object invoke (Object lhs, Object rhs) {
- return OpsUtil.get(lhs, rhs).rightShift(lhs, rhs);
- }
- },
- UNSIGNED_RIGHT_SHIFT {
- public Object invoke (Object lhs, Object rhs) {
- return OpsUtil.get(lhs, rhs).unsignedRightShift(lhs, rhs);
- }
- },
-
- CONDITIONAL_AND {
- public Object invoke (Object lhs, Object rhs) {
- throw new IllegalArgumentException("&& should not be
lifted");
- }
- },
- CONDITIONAL_OR {
- public Object invoke (Object lhs, Object rhs) {
- throw new IllegalArgumentException("|| should not be
lifted");
- }
- };
-
- // conditional and and or are not detyped
- // CONDITIONAL_AND
- // CONDITIONAL_OR
-
- // the assignment operators are transformed into non-assignment
versions by the detyper
- // MULTIPLY_ASSIGNMENT
- // DIVIDE_ASSIGNMENT
- // REMAINDER_ASSIGNMENT
- // PLUS_ASSIGNMENT
- // MINUS_ASSIGNMENT
- // LEFT_SHIFT_ASSIGNMENT
- // RIGHT_SHIFT_ASSIGNMENT
- // UNSIGNED_RIGHT_SHIFT_ASSIGNMENT
- // AND_ASSIGNMENT
- // XOR_ASSIGNMENT
- // OR_ASSIGNMENT
-
- public Object invoke (Object lhs, Object rhs) {
- throw new IllegalArgumentException(this + " not supported.");
- }
- }
/**
* Invokes the constructor of the supplied class, with the specified
arguments and returns the