Class InferredJavaType
- java.lang.Object
-
- org.benf.cfr.reader.bytecode.analysis.types.discovery.InferredJavaType
-
public class InferredJavaType extends java.lang.Object
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 Modifier and Type Class Description private static class
InferredJavaType.ClashState
private static interface
InferredJavaType.IJTInternal
private static class
InferredJavaType.IJTInternal_Clash
private static class
InferredJavaType.IJTInternal_Impl
static class
InferredJavaType.Source
-
Field Summary
Fields Modifier and Type Field Description private static int
global_id
static InferredJavaType
IGNORE
private InferredJavaType.IJTInternal
value
-
Constructor Summary
Constructors Modifier Constructor Description InferredJavaType()
private
InferredJavaType(InferredJavaType.IJTInternal_Clash clash)
InferredJavaType(JavaTypeInstance type, InferredJavaType.Source source)
InferredJavaType(JavaTypeInstance type, InferredJavaType.Source source, boolean locked)
-
Method Summary
-
-
-
Field Detail
-
global_id
private static int global_id
-
value
private InferredJavaType.IJTInternal value
-
IGNORE
public static final InferredJavaType IGNORE
-
-
Constructor Detail
-
InferredJavaType
public InferredJavaType()
-
InferredJavaType
public InferredJavaType(JavaTypeInstance type, InferredJavaType.Source source)
-
InferredJavaType
public InferredJavaType(JavaTypeInstance type, InferredJavaType.Source source, boolean locked)
-
InferredJavaType
private InferredJavaType(InferredJavaType.IJTInternal_Clash clash)
-
-
Method Detail
-
getMostDerivedType
private static java.util.List<JavaTypeInstance> getMostDerivedType(java.util.Set<JavaTypeInstance> types)
-
mkClash
private static InferredJavaType mkClash(java.util.List<JavaTypeInstance> types)
-
combineOrClash
public static InferredJavaType combineOrClash(InferredJavaType t1, InferredJavaType t2)
-
mkClash
public static InferredJavaType mkClash(JavaTypeInstance... types)
-
getBoundSuperClasses
private static java.util.Map<JavaTypeInstance,JavaGenericRefTypeInstance> getBoundSuperClasses(JavaTypeInstance clashType)
-
getSource
public InferredJavaType.Source getSource()
-
mergeGenericInfo
private void mergeGenericInfo(JavaGenericRefTypeInstance otherTypeInstance)
-
noteUseAs
public void noteUseAs(JavaTypeInstance type)
-
forceType
public void forceType(JavaTypeInstance type, boolean ignoreLockIfResolveClash)
-
isClash
public boolean isClash()
-
collapseTypeClash
public InferredJavaType 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
private boolean checkBaseCompatibility(JavaTypeInstance otherType)
-
checkBaseCompatibility
private static boolean checkBaseCompatibility(JavaTypeInstance thisType, JavaTypeInstance otherType)
-
chainFrom
private CastAction chainFrom(InferredJavaType other)
-
mkDelegate
private static void mkDelegate(InferredJavaType.IJTInternal a, InferredJavaType.IJTInternal b)
-
forceDelegate
public void forceDelegate(InferredJavaType other)
-
chainIntegralTypes
private CastAction chainIntegralTypes(InferredJavaType other)
-
compareAsWithoutCasting
public static void compareAsWithoutCasting(InferredJavaType a, InferredJavaType b, boolean aLit, boolean bLit)
-
useAsWithCast
public void useAsWithCast(RawJavaType otherRaw)
-
useInArithOp
public void useInArithOp(InferredJavaType other, RawJavaType otherRaw, boolean forbidBool)
-
useInArithOp
public static void useInArithOp(InferredJavaType lhs, InferredJavaType rhs, ArithOp op)
-
useAsWithoutCasting
public void useAsWithoutCasting(JavaTypeInstance otherTypeInstance)
-
improveGenericType
private void improveGenericType(JavaGenericRefTypeInstance otherGeneric)
-
deGenerify
public void deGenerify(JavaTypeInstance other)
-
applyKnownBaseType
public void applyKnownBaseType()
-
isPrimitiveArray
private static boolean isPrimitiveArray(InferredJavaType.IJTInternal i)
-
chain
public CastAction chain(InferredJavaType other)
-
getRawType
public RawJavaType getRawType()
-
shallowSetCanBeVar
public void shallowSetCanBeVar()
-
confirmVarIfPossible
public void confirmVarIfPossible()
-
getJavaTypeInstance
public JavaTypeInstance getJavaTypeInstance()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-