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 Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInferredJavaType(JavaTypeInstance type, InferredJavaType.Source source) InferredJavaType(JavaTypeInstance type, InferredJavaType.Source source, boolean locked) -
Method Summary
Modifier and TypeMethodDescriptionvoidchain(InferredJavaType other) static InferredJavaTypestatic voidcompareAsWithoutCasting(InferredJavaType a, InferredJavaType b, boolean aLit, boolean bLit) voidvoiddeGenerify(JavaTypeInstance other) booleanvoidforceDelegate(InferredJavaType other) voidforceType(JavaTypeInstance type, boolean ignoreLockIfResolveClash) intintinthashCode()booleanisClash()static InferredJavaTypemkClash(JavaTypeInstance... types) voidnoteUseAs(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
-
IGNORE
-
-
Constructor Details
-
InferredJavaType
public InferredJavaType() -
InferredJavaType
-
InferredJavaType
-
-
Method Details
-
combineOrClash
-
mkClash
-
getSource
-
noteUseAs
-
forceType
-
isClash
public boolean isClash() -
collapseTypeClash
-
getLocalId
public int getLocalId() -
getTaggedBytecodeLocation
public int getTaggedBytecodeLocation() -
setTaggedBytecodeLocation
public void setTaggedBytecodeLocation(int location) -
forceDelegate
-
compareAsWithoutCasting
public static void compareAsWithoutCasting(InferredJavaType a, InferredJavaType b, boolean aLit, boolean bLit) -
useAsWithCast
-
useInArithOp
-
useInArithOp
-
useAsWithoutCasting
-
deGenerify
-
applyKnownBaseType
public void applyKnownBaseType() -
chain
-
getRawType
-
shallowSetCanBeVar
public void shallowSetCanBeVar() -
confirmVarIfPossible
public void confirmVarIfPossible() -
getJavaTypeInstance
-
equals
-
hashCode
-
toString
-