Package com.strobel.expressions
Class BoundConstants
java.lang.Object
com.strobel.expressions.BoundConstants
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HashMap
<BoundConstants.TypedConstant, LocalBuilder> Bytecode locals for storing frequently used constantsprivate final IdentityHashMap
<Object, MutableInteger> The index of each constant in the constant arrayprivate final HashMap
<BoundConstants.TypedConstant, MutableInteger> Each constant referenced within this lambda, and how often it was referencedThe list of constants in the order they appear in the constant array -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
addReference
(Object value, Type<?> type) (package private) int
count()
(package private) void
(package private) void
emitConstant
(LambdaCompiler lc, Object value, Type<?> type) private void
emitConstantFromArray
(LambdaCompiler lc, Object value, Type type) private static void
private void
incrementCount
(BoundConstants.TypedConstant typedConstant, HashMap<BoundConstants.TypedConstant, MutableInteger> references) private static boolean
shouldCache
(int refCount) (package private) Object[]
toArray()
-
Field Details
-
_values
The list of constants in the order they appear in the constant array -
_indexes
The index of each constant in the constant array -
_references
Each constant referenced within this lambda, and how often it was referenced -
_cache
Bytecode locals for storing frequently used constants
-
-
Constructor Details
-
BoundConstants
BoundConstants()
-
-
Method Details
-
count
int count() -
toArray
Object[] toArray() -
addReference
-
emitConstant
-
emitConstantsArray
-
emitConstantFromArray
-
emitCacheConstants
-
shouldCache
private static boolean shouldCache(int refCount) -
incrementCount
private void incrementCount(BoundConstants.TypedConstant typedConstant, HashMap<BoundConstants.TypedConstant, MutableInteger> references)
-