| java.lang.Object com.sun.tools.javac.comp.ConstFold
ConstFold | strictfp class ConstFold (Code) | | Helper class for constant folding, used by the attribution phase.
This class is marked strictfp as mandated by JLS 15.4.
This is NOT part of any API supported by Sun Microsystems. If
you write code that depends on this, you do so at your own risk.
This code and its internal interfaces are subject to change or
deletion without notice.
|
coerce | Type coerce(Type etype, Type ttype)(Code) | | Coerce constant type to target type.
Parameters: etype - The source type of the coercion,which is assumed to be a constant type compatble withttype. Parameters: ttype - The target type of the coercion. |
fold | Type fold(int opcode, List<Type> argtypes)(Code) | | Fold binary or unary operation, returning constant type reflecting the
operations result. Return null if fold failed due to an
arithmetic exception.
Parameters: opcode - The operation's opcode instruction (usually a byte code),as entered by class Symtab. Parameters: argtypes - The operation's argument types (a list of length 1 or 2).Argument types are assumed to have non-null constValue's. |
fold1 | Type fold1(int opcode, Type operand)(Code) | | Fold unary operation.
Parameters: opcode - The operation's opcode instruction (usually a byte code),as entered by class Symtab.opcode's ifeq to ifge are for postprocessingxcmp; ifxx pairs of instructions. Parameters: operand - The operation's operand type.Argument types are assumed to have non-null constValue's. |
fold2 | Type fold2(int opcode, Type left, Type right)(Code) | | Fold binary operation.
Parameters: opcode - The operation's opcode instruction (usually a byte code),as entered by class Symtab.opcode's ifeq to ifge are for postprocessingxcmp; ifxx pairs of instructions. Parameters: left - The type of the operation's left operand. Parameters: right - The type of the operation's right operand. |
|
|