Class InferredJavaType
java.lang.Object
org.benf.cfr.reader.bytecode.analysis.types.discovery.InferredJavaType
Multiple expressions / lvalues will have pointers to a single instance of this - at type changing boundaries,
we will explicitly create a new one.
Thus if we have
a = 94
b = a
c = b
charfunction((no cast)c)
we know that c is appropriate to be passed directly to a char function (i.e. a char). So we can update the
type which is held by c=b=a=94.
however, if we have
a = 94
b = a
c = (i2c)b
charfunction((no cast)c), c will have a forced char type, we won't need to update it.
Note that this works only for narrowing functions, as a char will be passed by the JVM to an int function without
extension.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static enum
private static interface
private static class
private static class
static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static int
static final InferredJavaType
private InferredJavaType.IJTInternal
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
InferredJavaType
(JavaTypeInstance type, InferredJavaType.Source source) InferredJavaType
(JavaTypeInstance type, InferredJavaType.Source source, boolean locked) -
Method Summary
Modifier and TypeMethodDescriptionvoid
chain
(InferredJavaType other) private CastAction
chainFrom
(InferredJavaType other) private CastAction
private boolean
checkBaseCompatibility
(JavaTypeInstance otherType) private static boolean
checkBaseCompatibility
(JavaTypeInstance thisType, JavaTypeInstance otherType) private static boolean
checkGenericCompatibility
(JavaGenericRefTypeInstance thisType, JavaGenericRefTypeInstance otherType) static InferredJavaType
static void
compareAsWithoutCasting
(InferredJavaType a, InferredJavaType b, boolean aLit, boolean bLit) void
void
deGenerify
(JavaTypeInstance other) boolean
void
forceDelegate
(InferredJavaType other) void
forceType
(JavaTypeInstance type, boolean ignoreLockIfResolveClash) private static Map<JavaTypeInstance,
JavaGenericRefTypeInstance> getBoundSuperClasses
(JavaTypeInstance clashType) int
private static List<JavaTypeInstance>
getMostDerivedType
(Set<JavaTypeInstance> types) int
int
hashCode()
private void
improveGenericType
(JavaGenericRefTypeInstance otherGeneric) boolean
isClash()
private static boolean
private void
mergeGenericInfo
(JavaGenericRefTypeInstance otherTypeInstance) private static InferredJavaType
mkClash
(List<JavaTypeInstance> types) static InferredJavaType
mkClash
(JavaTypeInstance... types) private static void
void
noteUseAs
(JavaTypeInstance type) void
setTaggedBytecodeLocation
(int location) void
toString()
void
useAsWithCast
(RawJavaType otherRaw) void
useAsWithoutCasting
(JavaTypeInstance otherTypeInstance) static void
useInArithOp
(InferredJavaType lhs, InferredJavaType rhs, ArithOp op) void
useInArithOp
(InferredJavaType other, RawJavaType otherRaw, boolean forbidBool)
-
Field Details
-
global_id
private static int global_id -
value
-
IGNORE
-
-
Constructor Details
-
InferredJavaType
public InferredJavaType() -
InferredJavaType
-
InferredJavaType
-
InferredJavaType
-
-
Method Details
-
getMostDerivedType
-
mkClash
-
combineOrClash
-
mkClash
-
getBoundSuperClasses
private static Map<JavaTypeInstance,JavaGenericRefTypeInstance> getBoundSuperClasses(JavaTypeInstance clashType) -
getSource
-
mergeGenericInfo
-
noteUseAs
-
forceType
-
isClash
public boolean isClash() -
collapseTypeClash
-
getLocalId
public int getLocalId() -
getTaggedBytecodeLocation
public int getTaggedBytecodeLocation() -
setTaggedBytecodeLocation
public void setTaggedBytecodeLocation(int location) -
checkGenericCompatibility
private static boolean checkGenericCompatibility(JavaGenericRefTypeInstance thisType, JavaGenericRefTypeInstance otherType) -
checkBaseCompatibility
-
checkBaseCompatibility
private static boolean checkBaseCompatibility(JavaTypeInstance thisType, JavaTypeInstance otherType) -
chainFrom
-
mkDelegate
-
forceDelegate
-
chainIntegralTypes
-
compareAsWithoutCasting
public static void compareAsWithoutCasting(InferredJavaType a, InferredJavaType b, boolean aLit, boolean bLit) -
useAsWithCast
-
useInArithOp
-
useInArithOp
-
useAsWithoutCasting
-
improveGenericType
-
deGenerify
-
applyKnownBaseType
public void applyKnownBaseType() -
isPrimitiveArray
-
chain
-
getRawType
-
shallowSetCanBeVar
public void shallowSetCanBeVar() -
confirmVarIfPossible
public void confirmVarIfPossible() -
getJavaTypeInstance
-
equals
-
hashCode
public int hashCode() -
toString
-