|
|
@ -35,8 +35,8 @@ import java.util.Hashtable; |
|
|
|
* tObject boolean int |
|
|
|
* tObject boolean int |
|
|
|
* / \ / \ |
|
|
|
* / \ / \ |
|
|
|
* / tArray short char |
|
|
|
* / tArray short char |
|
|
|
* other \ / |
|
|
|
* other | |
|
|
|
* classes byte |
|
|
|
* classes byte |
|
|
|
* </pre> |
|
|
|
* </pre> |
|
|
|
* |
|
|
|
* |
|
|
|
* int implements the "interface" tBoolInt. boolean and byte |
|
|
|
* int implements the "interface" tBoolInt. boolean and byte |
|
|
@ -86,30 +86,40 @@ public class Type { |
|
|
|
public static final int TC_ERROR = 13; |
|
|
|
public static final int TC_ERROR = 13; |
|
|
|
public static final int TC_UNKNOWN = 101; |
|
|
|
public static final int TC_UNKNOWN = 101; |
|
|
|
public static final int TC_RANGE = 103; |
|
|
|
public static final int TC_RANGE = 103; |
|
|
|
public static final int TC_BOOLBYTE = 105; |
|
|
|
public static final int TC_INTEGER = 107; |
|
|
|
public static final int TC_BOOLINT = 106; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected static JodeEnvironment env; |
|
|
|
protected static JodeEnvironment env; |
|
|
|
|
|
|
|
|
|
|
|
public static final Hashtable classHash = new Hashtable(); |
|
|
|
public static final Hashtable classHash = new Hashtable(); |
|
|
|
public static final Hashtable arrayHash = new Hashtable(); |
|
|
|
public static final Hashtable arrayHash = new Hashtable(); |
|
|
|
|
|
|
|
|
|
|
|
public static final Type tBoolean = new Type(TC_BOOLEAN); |
|
|
|
public static final Type tBoolean = new IntegerType(IntegerType.IT_Z); |
|
|
|
public static final Type tByte = new Type(TC_BYTE); |
|
|
|
public static final Type tByte = new IntegerType(IntegerType.IT_B); |
|
|
|
public static final Type tChar = new Type(TC_CHAR); |
|
|
|
public static final Type tChar = new IntegerType(IntegerType.IT_C); |
|
|
|
public static final Type tShort = new Type(TC_SHORT); |
|
|
|
public static final Type tShort = new IntegerType(IntegerType.IT_S); |
|
|
|
public static final Type tInt = new Type(TC_INT); |
|
|
|
public static final Type tInt = new IntegerType(IntegerType.IT_I); |
|
|
|
public static final Type tLong = new Type(TC_LONG); |
|
|
|
public static final Type tLong = new Type(TC_LONG); |
|
|
|
public static final Type tFloat = new Type(TC_FLOAT); |
|
|
|
public static final Type tFloat = new Type(TC_FLOAT); |
|
|
|
public static final Type tDouble = new Type(TC_DOUBLE); |
|
|
|
public static final Type tDouble = new Type(TC_DOUBLE); |
|
|
|
public static final Type tVoid = new Type(TC_VOID); |
|
|
|
public static final Type tVoid = new Type(TC_VOID); |
|
|
|
public static final Type tError = new Type(TC_ERROR); |
|
|
|
public static final Type tError = new Type(TC_ERROR); |
|
|
|
public static final Type tUnknown = new Type(TC_UNKNOWN); |
|
|
|
public static final Type tUnknown = new Type(TC_UNKNOWN); |
|
|
|
public static final Type tUInt = tRange(tInt, tByte); |
|
|
|
public static final Type tUInt = new IntegerType(IntegerType.IT_I |
|
|
|
public static final Type tBoolInt = new Type(TC_BOOLINT); |
|
|
|
| IntegerType.IT_B |
|
|
|
public static final Type tBoolByte= new Type(TC_BOOLBYTE); |
|
|
|
| IntegerType.IT_C |
|
|
|
public static final Type tObject = tClass("java.lang.Object"); |
|
|
|
| IntegerType.IT_S); |
|
|
|
public static final Type tUObject = tRange(tObject, tUnknown); |
|
|
|
public static final Type tBoolInt = new IntegerType(IntegerType.IT_I |
|
|
|
|
|
|
|
| IntegerType.IT_Z); |
|
|
|
|
|
|
|
public static final Type tBoolUInt= new IntegerType(IntegerType.IT_I |
|
|
|
|
|
|
|
| IntegerType.IT_B |
|
|
|
|
|
|
|
| IntegerType.IT_C |
|
|
|
|
|
|
|
| IntegerType.IT_S |
|
|
|
|
|
|
|
| IntegerType.IT_Z); |
|
|
|
|
|
|
|
public static final Type tBoolByte= new IntegerType(IntegerType.IT_B |
|
|
|
|
|
|
|
| IntegerType.IT_Z); |
|
|
|
|
|
|
|
public static final ClassInterfacesType tObject = tClass("java.lang.Object"); |
|
|
|
|
|
|
|
public static final ClassInterfacesType tNull = new NullType(); |
|
|
|
|
|
|
|
public static final Type tUObject = tRange(tObject, tNull); |
|
|
|
public static final Type tString = tClass("java.lang.String"); |
|
|
|
public static final Type tString = tClass("java.lang.String"); |
|
|
|
public static final Type tStringBuffer = tClass("java.lang.StringBuffer"); |
|
|
|
public static final Type tStringBuffer = tClass("java.lang.StringBuffer"); |
|
|
|
public static final Type tJavaLangClass = tClass("java.lang.Class"); |
|
|
|
public static final Type tJavaLangClass = tClass("java.lang.Class"); |
|
|
@ -148,14 +158,14 @@ public class Type { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static final Type tClass(String clazzname) { |
|
|
|
public static final ClassInterfacesType tClass(String clazzname) { |
|
|
|
clazzname = clazzname.replace('/', '.'); |
|
|
|
clazzname = clazzname.replace('/', '.'); |
|
|
|
Object result = classHash.get(clazzname); |
|
|
|
Object result = classHash.get(clazzname); |
|
|
|
if (result == null) { |
|
|
|
if (result == null) { |
|
|
|
result = new ClassInterfacesType(clazzname); |
|
|
|
result = new ClassInterfacesType(clazzname); |
|
|
|
classHash.put(clazzname, result); |
|
|
|
classHash.put(clazzname, result); |
|
|
|
} |
|
|
|
} |
|
|
|
return (Type) result; |
|
|
|
return (ClassInterfacesType) result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static final Type tArray(Type type) { |
|
|
|
public static final Type tArray(Type type) { |
|
|
@ -169,25 +179,17 @@ public class Type { |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static final Type tRange(Type bottom, Type top) { |
|
|
|
public static final Type tRange(ClassInterfacesType bottom, |
|
|
|
if (bottom.typecode == TC_RANGE |
|
|
|
ClassInterfacesType top) { |
|
|
|
|| top.typecode == TC_RANGE) |
|
|
|
|
|
|
|
throw new AssertError("tRange("+bottom+","+top+")"); |
|
|
|
|
|
|
|
return new RangeType(bottom, top); |
|
|
|
return new RangeType(bottom, top); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static Type tSuperType(Type type) { |
|
|
|
public static Type tSuperType(Type type) { |
|
|
|
if (type.getTop() == tUnknown) { |
|
|
|
return type.getSuperType(); |
|
|
|
if (type == tBoolInt || type == tBoolByte) |
|
|
|
|
|
|
|
return tBoolInt; |
|
|
|
|
|
|
|
if (type.getBottom().typecode == TC_CLASS) |
|
|
|
|
|
|
|
return tUObject; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return type.getTop().createRangeType(tUnknown); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static Type tSubType(Type type) { |
|
|
|
public static Type tSubType(Type type) { |
|
|
|
return tUnknown.createRangeType(type.getBottom()); |
|
|
|
return type.getSubType(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static Type tClassOrArray(String ident) { |
|
|
|
public static Type tClassOrArray(String ident) { |
|
|
@ -210,14 +212,22 @@ public class Type { |
|
|
|
this.typecode = typecode; |
|
|
|
this.typecode = typecode; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Type getBottom() { |
|
|
|
public Type getSubType() { |
|
|
|
return this; |
|
|
|
return this; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Type getTop() { |
|
|
|
public Type getSuperType() { |
|
|
|
return (this == tBoolByte || this == tBoolInt) ? tUnknown : this; |
|
|
|
return this; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public Type getBottom() {
|
|
|
|
|
|
|
|
// return this;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public Type getTop() {
|
|
|
|
|
|
|
|
// return this;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
public Type getHint() { |
|
|
|
public Type getHint() { |
|
|
|
return this; |
|
|
|
return this; |
|
|
|
} |
|
|
|
} |
|
|
@ -243,184 +253,82 @@ public class Type { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
// /**
|
|
|
|
* Returns the common sub type of this and type. |
|
|
|
// * Returns the common sub type of this and type.
|
|
|
|
* @param type the other type. |
|
|
|
// * @param type the other type.
|
|
|
|
* @return the common sub type. |
|
|
|
// * @return the common sub type.
|
|
|
|
*/ |
|
|
|
// */
|
|
|
|
public Type getSpecializedType(Type type) { |
|
|
|
// public Type getSpecializedType(Type type) {
|
|
|
|
/* tError , x -> tError |
|
|
|
// /* tError , x -> tError
|
|
|
|
* tUnknown, x -> x |
|
|
|
// * tUnknown, x -> x
|
|
|
|
* x , x -> x |
|
|
|
// * x , x -> x
|
|
|
|
* boolean , boolint -> boolean |
|
|
|
// */
|
|
|
|
* byte , boolint -> byte |
|
|
|
// return (this == tError || type == tError) ? tError
|
|
|
|
* boolean , boolbyte -> boolean |
|
|
|
// : (this == type || type == tUnknown) ? this
|
|
|
|
* byte , boolbyte -> byte |
|
|
|
// : (this == tUnknown) ? type
|
|
|
|
* short , boolbyte -> byte |
|
|
|
// : tError;
|
|
|
|
* int , boolbyte -> byte |
|
|
|
// }
|
|
|
|
* byte , short -> byte |
|
|
|
|
|
|
|
* boolint , short -> short |
|
|
|
// /**
|
|
|
|
* boolint , boolbyte -> boolbyte |
|
|
|
// * Returns the common super type of this and type.
|
|
|
|
* boolbyte, short -> tError |
|
|
|
// * @param type the other type.
|
|
|
|
*/ |
|
|
|
// * @return the common super type.
|
|
|
|
return (this == tError || type == tError) ? tError |
|
|
|
// */
|
|
|
|
: (this == type || type == tUnknown) ? this |
|
|
|
// public Type getGeneralizedType(Type type) {
|
|
|
|
: (this == tUnknown) ? type |
|
|
|
// /* Note that type can't be boolint/boolbyte (set getBottom) */
|
|
|
|
|
|
|
|
// /* tError , x -> tError
|
|
|
|
: (typecode == TC_BOOLEAN) ? |
|
|
|
// * tUnknown, x -> x
|
|
|
|
/* TC_BOOLEAN is only compatible to TC_BOOLINT / TC_BOOLBYTE */ |
|
|
|
// * x , x -> x
|
|
|
|
((type == tBoolInt || type == tBoolByte) ? this : tError) |
|
|
|
// * byte , short -> short
|
|
|
|
|
|
|
|
// */
|
|
|
|
: (typecode <= TC_INT) |
|
|
|
|
|
|
|
/* TC_BYTE, ..., TC_INT are compatible to higher |
|
|
|
// return (this == tError || type == tError) ? tError
|
|
|
|
* types and TC_BOOLINT, TC_BYTE is compatible to TC_BOOLBYTE |
|
|
|
// : (this == type || type == tUnknown) ? this
|
|
|
|
*/ |
|
|
|
// : (this == tUnknown) ? type
|
|
|
|
? (( type.typecode == TC_BOOLEAN) ? tError |
|
|
|
// : tError;
|
|
|
|
: (type.typecode <= typecode) ? type |
|
|
|
// }
|
|
|
|
: (type.typecode <= TC_INT |
|
|
|
|
|
|
|
|| type.typecode == TC_BOOLINT) ? this |
|
|
|
// /**
|
|
|
|
: (type == tBoolByte) ? tByte |
|
|
|
// * Create the type corresponding to the range from bottomType to this.
|
|
|
|
: tError) |
|
|
|
// * @param bottomType the start point of the range
|
|
|
|
|
|
|
|
// * @return the range type, or tError if not possible.
|
|
|
|
: (typecode == TC_BOOLINT) |
|
|
|
// */
|
|
|
|
/* TC_BOOLEAN,...,TC_INT all implement TC_BOOLINT |
|
|
|
// public Type createRangeType(Type bottomType) {
|
|
|
|
*/ |
|
|
|
// /* Note that this can't be tBoolByte or tBoolInt */
|
|
|
|
? ( (type.typecode <= TC_INT |
|
|
|
// /* x , tError -> tError
|
|
|
|
|| type.typecode == TC_BOOLBYTE) ? type : tError ) |
|
|
|
// * x , x -> x
|
|
|
|
|
|
|
|
// * tUnknown, x -> x
|
|
|
|
: (typecode == TC_BOOLBYTE) |
|
|
|
// * object , tUnknown -> <object, tUnknown>
|
|
|
|
/* TC_BOOLEAN, TC_BYTE implement TC_BOOLBYTE; |
|
|
|
// * int , tUnknown -> int
|
|
|
|
* TC_BYTE extend TC_SHORT, TC_INT. |
|
|
|
// * x , tUnknown -> x
|
|
|
|
* TC_BOOLBYTE extends TC_BOOLINT. |
|
|
|
// */
|
|
|
|
*/ |
|
|
|
|
|
|
|
? ( (type.typecode <= TC_BYTE) ? type |
|
|
|
// return (this == tError || bottomType == tError) ? tError
|
|
|
|
: (type.typecode <= TC_INT) ? tByte |
|
|
|
// : (this == bottomType) ? this
|
|
|
|
: (type == tBoolInt) ? this : tError ) |
|
|
|
// : (bottomType == tUnknown) ? this
|
|
|
|
|
|
|
|
// : (this == tUnknown)
|
|
|
|
: tError; |
|
|
|
// ? ((bottomType.typecode == TC_ARRAY
|
|
|
|
} |
|
|
|
// || bottomType.typecode == TC_CLASS)
|
|
|
|
|
|
|
|
// ? tRange(bottomType, this)
|
|
|
|
/** |
|
|
|
// : bottomType)
|
|
|
|
* Returns the common super type of this and type. |
|
|
|
// : tError;
|
|
|
|
* @param type the other type. |
|
|
|
// }
|
|
|
|
* @return the common super type. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public Type getGeneralizedType(Type type) { |
|
|
|
|
|
|
|
/* Note that type can't be boolint/boolbyte (set getBottom) */ |
|
|
|
|
|
|
|
/* tError , x -> tError |
|
|
|
|
|
|
|
* tUnknown, x -> x |
|
|
|
|
|
|
|
* x , x -> x |
|
|
|
|
|
|
|
* byte , short -> short |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (this == tError || type == tError) ? tError |
|
|
|
|
|
|
|
: (this == type || type == tUnknown) ? this |
|
|
|
|
|
|
|
: (this == tUnknown) ? type |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
: (typecode >= TC_BYTE && typecode <= TC_INT) |
|
|
|
|
|
|
|
/* TC_BYTE, ..., TC_INT are compatible to higher |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
? ((type.typecode < TC_BYTE) ? tError |
|
|
|
|
|
|
|
: (type.typecode <= typecode) ? this |
|
|
|
|
|
|
|
: (type.typecode <= TC_INT) ? type : tError) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
: tError; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Create the type corresponding to the range from bottomType to this. |
|
|
|
|
|
|
|
* @param bottomType the start point of the range |
|
|
|
|
|
|
|
* @return the range type, or tError if not possible. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public Type createRangeType(Type bottomType) { |
|
|
|
|
|
|
|
/* Note that this can't be tBoolByte or tBoolInt */ |
|
|
|
|
|
|
|
/* x , tError -> tError |
|
|
|
|
|
|
|
* object , tUnknown -> <object, tUnknown> |
|
|
|
|
|
|
|
* boolean , tUnknown -> boolean |
|
|
|
|
|
|
|
* int , tUnknown -> <int, byte> |
|
|
|
|
|
|
|
* boolint , tUnknown -> boolint |
|
|
|
|
|
|
|
* x , x -> x |
|
|
|
|
|
|
|
* tUnknown, boolean -> boolean |
|
|
|
|
|
|
|
* tUnknown, short -> <int, short> |
|
|
|
|
|
|
|
* short , byte -> <short, byte> |
|
|
|
|
|
|
|
* byte , short -> tError |
|
|
|
|
|
|
|
* tUnknown, float -> float |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (this == tError || bottomType == tError) ? tError |
|
|
|
|
|
|
|
: (this == bottomType) ? this |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
: (this == tUnknown) |
|
|
|
|
|
|
|
? ((bottomType == tBoolInt |
|
|
|
|
|
|
|
|| bottomType == tBoolByte |
|
|
|
|
|
|
|
|| bottomType == tBoolean |
|
|
|
|
|
|
|
|| bottomType == tByte ) ? bottomType |
|
|
|
|
|
|
|
:(bottomType.typecode <= TC_INT) |
|
|
|
|
|
|
|
? tRange(bottomType, tByte) |
|
|
|
|
|
|
|
: tRange(bottomType, this)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
: (this == tBoolean) |
|
|
|
|
|
|
|
? ((bottomType == tBoolInt |
|
|
|
|
|
|
|
|| bottomType == tBoolByte |
|
|
|
|
|
|
|
|| bottomType == tUnknown) ? this : tError) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
: (typecode <= TC_INT) |
|
|
|
|
|
|
|
/* tUnknown, short -> <int, short> |
|
|
|
|
|
|
|
* short , byte -> <short, byte> |
|
|
|
|
|
|
|
* byte , short -> tError |
|
|
|
|
|
|
|
* boolint , short -> <int, short> |
|
|
|
|
|
|
|
* boolbyte, byte -> byte |
|
|
|
|
|
|
|
* boolbyte, short -> tError |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
? ((bottomType.typecode < typecode) |
|
|
|
|
|
|
|
? tError |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
: (bottomType.typecode <= TC_INT) |
|
|
|
|
|
|
|
? tRange(bottomType, this) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
: (bottomType.typecode == TC_BOOLBYTE |
|
|
|
|
|
|
|
&& this == tByte) |
|
|
|
|
|
|
|
? tByte |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
: (bottomType.typecode == TC_BOOLINT |
|
|
|
|
|
|
|
|| bottomType.typecode == TC_UNKNOWN) |
|
|
|
|
|
|
|
? (this == tInt) ? tInt : tRange(tInt, this) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
: tError) |
|
|
|
|
|
|
|
: (bottomType.typecode == TC_UNKNOWN) ? this |
|
|
|
|
|
|
|
: tError; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Intersect this type with another type and return the new type. |
|
|
|
* Intersect this type with another type and return the new type. |
|
|
|
* @param type the other type. |
|
|
|
* @param type the other type. |
|
|
|
* @return the intersection, or tError, if a type conflict happens. |
|
|
|
* @return the intersection, or tError, if a type conflict happens. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public final Type intersection(Type type) { |
|
|
|
public Type intersection(Type type) { |
|
|
|
|
|
|
|
if (this == tError || type == tError) |
|
|
|
Type top = getTop().getGeneralizedType(type.getTop()); |
|
|
|
return type; |
|
|
|
Type bottom = getBottom().getSpecializedType(type.getBottom()); |
|
|
|
if (this == tUnknown) |
|
|
|
Type result = top.createRangeType(bottom); |
|
|
|
return type; |
|
|
|
|
|
|
|
if (this == type) |
|
|
|
if (result == tError) { |
|
|
|
return this; |
|
|
|
boolean oldTypeDebugging = Decompiler.isTypeDebugging; |
|
|
|
Decompiler.err.println("intersecting "+ this +" and "+ type |
|
|
|
Decompiler.isTypeDebugging = true; |
|
|
|
+ " to <error>"); |
|
|
|
Decompiler.err.println("intersecting "+ this +" and "+ type |
|
|
|
return tError; |
|
|
|
+ " to <" + bottom + "," + top + ">" |
|
|
|
|
|
|
|
+ " to <error>"); |
|
|
|
|
|
|
|
Decompiler.isTypeDebugging = oldTypeDebugging; |
|
|
|
|
|
|
|
if (oldTypeDebugging) |
|
|
|
|
|
|
|
throw new AssertError("type error"); |
|
|
|
|
|
|
|
} else if (Decompiler.isTypeDebugging) { |
|
|
|
|
|
|
|
if (this.equals(type)) { |
|
|
|
|
|
|
|
// Decompiler.err.println("intersecting identical: "+this);
|
|
|
|
|
|
|
|
// Thread.dumpStack();
|
|
|
|
|
|
|
|
} else |
|
|
|
|
|
|
|
Decompiler.err.println("intersecting "+ this +" and "+ type + |
|
|
|
|
|
|
|
" to " + result); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -437,9 +345,7 @@ public class Type { |
|
|
|
* of minimum types. |
|
|
|
* of minimum types. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isValidType() { |
|
|
|
public boolean isValidType() { |
|
|
|
return typecode <= TC_DOUBLE |
|
|
|
return typecode <= TC_DOUBLE; |
|
|
|
|| typecode == TC_BOOLBYTE |
|
|
|
|
|
|
|
|| typecode == TC_BOOLINT; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -454,10 +360,8 @@ public class Type { |
|
|
|
* @param type a simple type; this mustn't be a range type. |
|
|
|
* @param type a simple type; this mustn't be a range type. |
|
|
|
* @return true if this is the case. |
|
|
|
* @return true if this is the case. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public final boolean isOfType(Type type) { |
|
|
|
public boolean isOfType(Type type) { |
|
|
|
return (getTop().getGeneralizedType(type.getTop()).createRangeType |
|
|
|
return (this == tUnknown || (this == type && this != tError)); |
|
|
|
(getBottom().getSpecializedType(type.getBottom())) != tError); |
|
|
|
|
|
|
|
// return (getSpecializedType(type).equals(type));
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -469,18 +373,6 @@ public class Type { |
|
|
|
|
|
|
|
|
|
|
|
public String getDefaultName() { |
|
|
|
public String getDefaultName() { |
|
|
|
switch (typecode) { |
|
|
|
switch (typecode) { |
|
|
|
case TC_BOOLINT: |
|
|
|
|
|
|
|
case TC_BOOLBYTE: |
|
|
|
|
|
|
|
case TC_BOOLEAN: |
|
|
|
|
|
|
|
return "bool"; |
|
|
|
|
|
|
|
case TC_BYTE: |
|
|
|
|
|
|
|
return "i"; |
|
|
|
|
|
|
|
case TC_CHAR: |
|
|
|
|
|
|
|
return "c"; |
|
|
|
|
|
|
|
case TC_SHORT: |
|
|
|
|
|
|
|
return "i"; |
|
|
|
|
|
|
|
case TC_INT: |
|
|
|
|
|
|
|
return "i"; |
|
|
|
|
|
|
|
case TC_LONG: |
|
|
|
case TC_LONG: |
|
|
|
return "l"; |
|
|
|
return "l"; |
|
|
|
case TC_FLOAT: |
|
|
|
case TC_FLOAT: |
|
|
@ -494,18 +386,6 @@ public class Type { |
|
|
|
|
|
|
|
|
|
|
|
public String getTypeSignature() { |
|
|
|
public String getTypeSignature() { |
|
|
|
switch (typecode) { |
|
|
|
switch (typecode) { |
|
|
|
case TC_BOOLINT: |
|
|
|
|
|
|
|
case TC_BOOLBYTE: |
|
|
|
|
|
|
|
case TC_BOOLEAN: |
|
|
|
|
|
|
|
return "Z"; |
|
|
|
|
|
|
|
case TC_BYTE: |
|
|
|
|
|
|
|
return "B"; |
|
|
|
|
|
|
|
case TC_CHAR: |
|
|
|
|
|
|
|
return "C"; |
|
|
|
|
|
|
|
case TC_SHORT: |
|
|
|
|
|
|
|
return "S"; |
|
|
|
|
|
|
|
case TC_INT: |
|
|
|
|
|
|
|
return "I"; |
|
|
|
|
|
|
|
case TC_LONG: |
|
|
|
case TC_LONG: |
|
|
|
return "J"; |
|
|
|
return "J"; |
|
|
|
case TC_FLOAT: |
|
|
|
case TC_FLOAT: |
|
|
@ -519,24 +399,6 @@ public class Type { |
|
|
|
|
|
|
|
|
|
|
|
public String toString() { |
|
|
|
public String toString() { |
|
|
|
switch (typecode) { |
|
|
|
switch (typecode) { |
|
|
|
case TC_BOOLINT: |
|
|
|
|
|
|
|
if (Decompiler.isTypeDebugging) |
|
|
|
|
|
|
|
return "<bool or int>"; |
|
|
|
|
|
|
|
/* fall through */ |
|
|
|
|
|
|
|
case TC_BOOLBYTE: |
|
|
|
|
|
|
|
if (Decompiler.isTypeDebugging) |
|
|
|
|
|
|
|
return "<bool or byte>"; |
|
|
|
|
|
|
|
/* fall through */ |
|
|
|
|
|
|
|
case TC_BOOLEAN: |
|
|
|
|
|
|
|
return "boolean"; |
|
|
|
|
|
|
|
case TC_BYTE: |
|
|
|
|
|
|
|
return "byte"; |
|
|
|
|
|
|
|
case TC_CHAR: |
|
|
|
|
|
|
|
return "char"; |
|
|
|
|
|
|
|
case TC_SHORT: |
|
|
|
|
|
|
|
return "short"; |
|
|
|
|
|
|
|
case TC_INT: |
|
|
|
|
|
|
|
return "int"; |
|
|
|
|
|
|
|
case TC_LONG: |
|
|
|
case TC_LONG: |
|
|
|
return "long"; |
|
|
|
return "long"; |
|
|
|
case TC_FLOAT: |
|
|
|
case TC_FLOAT: |
|
|
|