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 enumprivate static interfaceprivate static classprivate static classstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static intstatic final InferredJavaTypeprivate InferredJavaType.IJTInternal -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateInferredJavaType(JavaTypeInstance type, InferredJavaType.Source source) InferredJavaType(JavaTypeInstance type, InferredJavaType.Source source, boolean locked) -
Method Summary
Modifier and TypeMethodDescriptionvoidchain(InferredJavaType other) private CastActionchainFrom(InferredJavaType other) private CastActionprivate booleancheckBaseCompatibility(JavaTypeInstance otherType) private static booleancheckBaseCompatibility(JavaTypeInstance thisType, JavaTypeInstance otherType) private static booleancheckGenericCompatibility(JavaGenericRefTypeInstance thisType, JavaGenericRefTypeInstance otherType) static InferredJavaTypestatic voidcompareAsWithoutCasting(InferredJavaType a, InferredJavaType b, boolean aLit, boolean bLit) voidvoiddeGenerify(JavaTypeInstance other) booleanvoidforceDelegate(InferredJavaType other) voidforceType(JavaTypeInstance type, boolean ignoreLockIfResolveClash) private static Map<JavaTypeInstance, JavaGenericRefTypeInstance> getBoundSuperClasses(JavaTypeInstance clashType) intprivate static List<JavaTypeInstance> getMostDerivedType(Set<JavaTypeInstance> types) intinthashCode()private voidimproveGenericType(JavaGenericRefTypeInstance otherGeneric) booleanisClash()private static booleanprivate voidmergeGenericInfo(JavaGenericRefTypeInstance otherTypeInstance) private static InferredJavaTypemkClash(List<JavaTypeInstance> types) static InferredJavaTypemkClash(JavaTypeInstance... types) private static voidvoidnoteUseAs(JavaTypeInstance type) voidsetTaggedBytecodeLocation(int location) voidtoString()voiduseAsWithCast(RawJavaType otherRaw) voiduseAsWithoutCasting(JavaTypeInstance otherTypeInstance) static voiduseInArithOp(InferredJavaType lhs, InferredJavaType rhs, ArithOp op) voiduseInArithOp(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
-
toString
-