APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.tools.javac.comp

pack-priv Class ConstFold

extends Object
Class Inheritance
Annotations
@SuppressWarnings:strictfp
Imports
com.sun.tools.javac.code.*, com.sun.tools.javac.jvm.*, com.sun.tools.javac.util.*

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 supported API. 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.

Field Summary

Modifier and TypeField and Description
protected static final Context.Key<ConstFold>
pack-priv static final Integer
pack-priv static final Integer
private Symtab
pack-priv static final Integer

Constructor Summary

AccessConstructor and Description
private strictfp
ConstFold(Context context)

Method Summary

Modifier and TypeMethod and Description
private static strictfp Integer
b2i(boolean b)

Convert boolean to integer (true = 1, false = 0).

pack-priv strictfp Type
coerce(Type
The source type of the coercion, which is assumed to be a constant type compatible with ttype.
etype
,
Type
The target type of the coercion.
ttype
)

Coerce constant type to target type.

private static strictfp double
private static strictfp float
pack-priv strictfp Type
fold1(int
The operation's opcode instruction (usually a byte code), as entered by class Symtab. opcode's ifeq to ifge are for postprocessing xcmp; ifxx pairs of instructions.
opcode
,
Type
The operation's operand type. Argument types are assumed to have non-null constValue's.
operand
)

Fold unary operation.

pack-priv strictfp Type
fold2(int
The operation's opcode instruction (usually a byte code), as entered by class Symtab. opcode's ifeq to ifge are for postprocessing xcmp; ifxx pairs of instructions.
opcode
,
Type
The type of the operation's left operand.
left
,
Type
The type of the operation's right operand.
right
)

Fold binary operation.

public static strictfp ConstFold
instance(Context context)

private static strictfp int
private static strictfp long
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

constFoldKeyback to summary
protected static final Context.Key<ConstFold> constFoldKey
minusOneback to summary
pack-priv static final Integer minusOne
oneback to summary
pack-priv static final Integer one
symsback to summary
private Symtab syms
zeroback to summary
pack-priv static final Integer zero

Constructor Detail

ConstFoldback to summary
private strictfp ConstFold(Context context)

Method Detail

b2iback to summary
private static strictfp Integer b2i(boolean b)

Convert boolean to integer (true = 1, false = 0).

coerceback to summary
pack-priv strictfp Type coerce(Type etype, Type ttype)

Coerce constant type to target type.

Parameters
etype:Type

The source type of the coercion, which is assumed to be a constant type compatible with ttype.

ttype:Type

The target type of the coercion.

doubleValueback to summary
private static strictfp double doubleValue(Object x)
floatValueback to summary
private static strictfp float floatValue(Object x)
fold1back to summary
pack-priv strictfp Type fold1(int opcode, Type operand)

Fold unary operation.

Parameters
opcode:int

The operation's opcode instruction (usually a byte code), as entered by class Symtab. opcode's ifeq to ifge are for postprocessing xcmp; ifxx pairs of instructions.

operand:Type

The operation's operand type. Argument types are assumed to have non-null constValue's.

fold2back to summary
pack-priv strictfp Type fold2(int opcode, Type left, Type right)

Fold binary operation.

Parameters
opcode:int

The operation's opcode instruction (usually a byte code), as entered by class Symtab. opcode's ifeq to ifge are for postprocessing xcmp; ifxx pairs of instructions.

left:Type

The type of the operation's left operand.

right:Type

The type of the operation's right operand.

instanceback to summary
public static strictfp ConstFold instance(Context context)
intValueback to summary
private static strictfp int intValue(Object x)
longValueback to summary
private static strictfp long longValue(Object x)