Package com.strobel.expressions
Class BoundConstants
- java.lang.Object
-
- com.strobel.expressions.BoundConstants
-
final class BoundConstants extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classBoundConstants.TypedConstant
-
Field Summary
Fields Modifier and Type Field Description private java.util.HashMap<BoundConstants.TypedConstant,LocalBuilder>_cacheBytecode locals for storing frequently used constantsprivate java.util.IdentityHashMap<java.lang.Object,MutableInteger>_indexesThe index of each constant in the constant arrayprivate java.util.HashMap<BoundConstants.TypedConstant,MutableInteger>_referencesEach constant referenced within this lambda, and how often it was referencedprivate java.util.ArrayList<java.lang.Object>_valuesThe list of constants in the order they appear in the constant array
-
Constructor Summary
Constructors Constructor Description BoundConstants()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidaddReference(java.lang.Object value, Type<?> type)(package private) intcount()(package private) voidemitCacheConstants(LambdaCompiler lc)(package private) voidemitConstant(LambdaCompiler lc, java.lang.Object value, Type<?> type)private voidemitConstantFromArray(LambdaCompiler lc, java.lang.Object value, Type type)private static voidemitConstantsArray(LambdaCompiler lc)private voidincrementCount(BoundConstants.TypedConstant typedConstant, java.util.HashMap<BoundConstants.TypedConstant,MutableInteger> references)private static booleanshouldCache(int refCount)(package private) java.lang.Object[]toArray()
-
-
-
Field Detail
-
_values
private final java.util.ArrayList<java.lang.Object> _values
The list of constants in the order they appear in the constant array
-
_indexes
private final java.util.IdentityHashMap<java.lang.Object,MutableInteger> _indexes
The index of each constant in the constant array
-
_references
private final java.util.HashMap<BoundConstants.TypedConstant,MutableInteger> _references
Each constant referenced within this lambda, and how often it was referenced
-
_cache
private final java.util.HashMap<BoundConstants.TypedConstant,LocalBuilder> _cache
Bytecode locals for storing frequently used constants
-
-
Method Detail
-
count
int count()
-
toArray
java.lang.Object[] toArray()
-
addReference
void addReference(java.lang.Object value, Type<?> type)
-
emitConstant
void emitConstant(LambdaCompiler lc, java.lang.Object value, Type<?> type)
-
emitConstantsArray
private static void emitConstantsArray(LambdaCompiler lc)
-
emitConstantFromArray
private void emitConstantFromArray(LambdaCompiler lc, java.lang.Object value, Type type)
-
emitCacheConstants
void emitCacheConstants(LambdaCompiler lc)
-
shouldCache
private static boolean shouldCache(int refCount)
-
incrementCount
private void incrementCount(BoundConstants.TypedConstant typedConstant, java.util.HashMap<BoundConstants.TypedConstant,MutableInteger> references)
-
-