41 /** |
41 /** |
42 * BinaryNode nodes represent two operand operations. |
42 * BinaryNode nodes represent two operand operations. |
43 */ |
43 */ |
44 @Immutable |
44 @Immutable |
45 public final class BinaryNode extends Expression implements Assignment<Expression>, Optimistic { |
45 public final class BinaryNode extends Expression implements Assignment<Expression>, Optimistic { |
|
46 private static final long serialVersionUID = 1L; |
|
47 |
46 // Placeholder for "undecided optimistic ADD type". Unfortunately, we can't decide the type of ADD during optimistic |
48 // Placeholder for "undecided optimistic ADD type". Unfortunately, we can't decide the type of ADD during optimistic |
47 // type calculation as it can have local variables as its operands that will decide its ultimate type. |
49 // type calculation as it can have local variables as its operands that will decide its ultimate type. |
48 private static final Type OPTIMISTIC_UNDECIDED_TYPE = Type.typeFor(new Object(){/*empty*/}.getClass()); |
50 private static final Type OPTIMISTIC_UNDECIDED_TYPE = Type.typeFor(new Object(){/*empty*/}.getClass()); |
49 |
51 |
50 /** Left hand side argument. */ |
52 /** Left hand side argument. */ |
54 |
56 |
55 private final int programPoint; |
57 private final int programPoint; |
56 |
58 |
57 private final Type type; |
59 private final Type type; |
58 |
60 |
59 private Type cachedType; |
61 private transient Type cachedType; |
60 private Object cachedTypeFunction; |
62 private transient Object cachedTypeFunction; |
61 |
63 |
62 @Ignore |
64 @Ignore |
63 private static final Set<TokenType> CAN_OVERFLOW = |
65 private static final Set<TokenType> CAN_OVERFLOW = |
64 Collections.unmodifiableSet(new HashSet<>(Arrays.asList(new TokenType[] { |
66 Collections.unmodifiableSet(new HashSet<>(Arrays.asList(new TokenType[] { |
65 TokenType.ADD, |
67 TokenType.ADD, |