Interface IWildcardType
- All Superinterfaces:
Comparable<IWildcardType>,ICodeItem,INativeItem,INativeItemListenable
Wildcard types can be defined (they wrap native types) or undefined (they contain a set of
attributes partially defining the actual type, such as effective size, group, signedness, etc.).
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumGroup (category) of a wildcard type. -
Field Summary
Fields inherited from interface com.pnfsoftware.jeb.core.units.code.ICodeItem
FLAG_ABSTRACT, FLAG_ANNOTATION, FLAG_ANONYMOUS, FLAG_ARTIFICIAL, FLAG_BRIDGE, FLAG_CONSTRUCTOR, FLAG_DECLARED_SYNCHRONIZED, FLAG_DESTRUCTOR, FLAG_ENUM, FLAG_FINAL, FLAG_INNER, FLAG_INTERFACE, FLAG_INTERNAL, FLAG_NATIVE, FLAG_PRIVATE, FLAG_PROTECTED, FLAG_PUBLIC, FLAG_STATIC, FLAG_STRICT, FLAG_SYNCHRONIZED, FLAG_SYNTHETIC, FLAG_TRANSIENT, FLAG_VARARGS, FLAG_VIRTUAL, FLAG_VOLATILE -
Method Summary
Modifier and TypeMethodDescriptionintThe currently determined size of this wildcard type.intThe currently set effective size for an undefined wildcard type.getGroup()intMaximum effective size for an undefined wildcard type.If the wildcard type is defined, provide the wrapped native type.intintintDetermine the number of stack slots currently required to accommodate this wildcard type.booleanDetermine if this wildcard type is fully defined, ie, it wraps anative type.booleanisEquivalent(IWildcardType otherType) An extendedequalitycheck, that checks unaliased native types (if both wildcard types areresolved).booleanisFloat()default booleanDetermine whether this wildcard type represents an integer (it could be defined or partially defined).booleanDetermine if this wildcard type appears to be less specialized than the provided parameter wildcard type.booleanDetermine if this wildcard type is partially defined: it does not wrap a native type, but does contain preliminary type information, such as the effective size, group, signedness, etc.booleandefault booleanDetermine if this wildcard type is fully defined, ie, it wraps anative type.booleanisSigned()Determine whether this wildcard type represents a signed integer (it could be defined or partially defined).booleanDetermine if this wildcard type is entirely undefined: it does not wrap a native type and does not contain any preliminary type information.booleanDetermine whether this wildcard type represents an unsigned integer (it could be defined or partially defined).booleanDetermine if this wildcard type can be updated.booleanisVoid()booleanresolveA()Attempt to resolve the wildcard type, ie, generate a defined wildcard type (wrapping a primitive) from this possibly undefined wildcard type.resolveU()Resolve the wildcard type, ie, generate a defined wildcard type (wrapping a primitive) from this possibly undefined wildcard type.toString()Generate a compact representation of the type.toString(boolean compact) Generate a string representation of this wildcard type.updateEffectiveBitsize(int newEffectiveBitsize) updateGroup(IWildcardType.Group group) updateMaxBitsize(int newMaxBitsize) updatePointedBitsize(int newPointedBitsize) updatePointedGroup(IWildcardType.Group newPointedGroup) updateProperties(IWildcardType srctype) Soft-transfer the properties of a source type to this type.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.pnfsoftware.jeb.core.units.code.ICodeItem
getAddress, getAddress, getGenericFlags, getIndex, getItemId, getName, getName, getSignature, getSignature, getSignature, isArtificial, isInternalMethods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.items.INativeItem
addFlags, dispose, getAttribute, getAttributes, hasAttribute, hasFlag, hasTrueAttribute, isAutoGenerated, isDisposed, isRenamed, removeAttribute, removeFlags, setAttribute, setAutoGenerated, setFlags, setNameMethods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.items.INativeItemListenable
addListener, removeListener
-
Method Details
-
getNativeType
INativeType getNativeType()If the wildcard type is defined, provide the wrapped native type.- Returns:
-
isVoid
boolean isVoid()- Returns:
- true if this wildcard type wraps the native
voidtype
-
getBitsize
int getBitsize()The currently determined size of this wildcard type. If defined, it is trivial. If undefined, it is either the maximum bitsize or the effective bitsize (if non-zero).- Returns:
- always >0
-
getMaximumBitsize
int getMaximumBitsize()Maximum effective size for an undefined wildcard type.- Returns:
- always >0
-
getEffectiveBitsize
int getEffectiveBitsize()The currently set effective size for an undefined wildcard type. If 0, it means the effective size is unknown and should be considered equal to the maximum size.- Returns:
- possibly 0 if undetermined
-
getSlotCount
int getSlotCount()Determine the number of stack slots currently required to accommodate this wildcard type.- Returns:
-
getGroup
IWildcardType.Group getGroup()- Returns:
- possibly null if unknown
-
isFloat
boolean isFloat()- Returns:
-
isSigned
boolean isSigned()Determine whether this wildcard type represents a signed integer (it could be defined or partially defined).- Returns:
-
isUnsigned
boolean isUnsigned()Determine whether this wildcard type represents an unsigned integer (it could be defined or partially defined).- Returns:
-
isInteger
default boolean isInteger()Determine whether this wildcard type represents an integer (it could be defined or partially defined).- Returns:
-
isPointer
boolean isPointer()- Returns:
-
isWildcardPointer
boolean isWildcardPointer()- Returns:
-
getPointedBitsize
int getPointedBitsize()- Returns:
- possibly 0 if unknown
-
getPointedSize
int getPointedSize()- Returns:
- possibly 0 if unknown
-
getPointedGroup
IWildcardType.Group getPointedGroup()- Returns:
- possibly null if unknown
-
updateEffectiveBitsize
- Parameters:
newEffectiveBitsize-- Returns:
-
updateMaxBitsize
- Parameters:
newMaxBitsize-- Returns:
-
updateGroup
- Parameters:
group-- Returns:
-
updatePointedBitsize
- Parameters:
newPointedBitsize-- Returns:
-
updatePointedGroup
- Parameters:
newPointedGroup-- Returns:
-
isLessSpecializedThan
Determine if this wildcard type appears to be less specialized than the provided parameter wildcard type.Note: "Specialized" within the context of this class and wildcard types has a meaning different than the one used by type systems for hierarchy of type objects.
Same as
compareTo(o)<0- Parameters:
o- another type- Returns:
-
isDefined
boolean isDefined()Determine if this wildcard type is fully defined, ie, it wraps anative type.- Returns:
-
isResolved
default boolean isResolved()Determine if this wildcard type is fully defined, ie, it wraps anative type.Same as
isDefined().- Returns:
-
isPartiallyDefined
boolean isPartiallyDefined()Determine if this wildcard type is partially defined: it does not wrap a native type, but does contain preliminary type information, such as the effective size, group, signedness, etc.- Returns:
-
isUndefined
boolean isUndefined()Determine if this wildcard type is entirely undefined: it does not wrap a native type and does not contain any preliminary type information.- Returns:
-
isUpdatable
boolean isUpdatable()Determine if this wildcard type can be updated. Undefined wildcard types can be updated, whereas most defined wildcard types (wrapping native types) cannot be updated, except for some primitives.Note that wildcard types are immutable, the process of updating them will always yield the creation of a new wildcard type.
- Returns:
-
resolveU
IWildcardType resolveU()Resolve the wildcard type, ie, generate a defined wildcard type (wrapping a primitive) from this possibly undefined wildcard type.This method throws an
IllegalStateExceptionon error (if the wildcard type cannot be resolved).- Returns:
- never null
-
resolveA
IWildcardType resolveA()Attempt to resolve the wildcard type, ie, generate a defined wildcard type (wrapping a primitive) from this possibly undefined wildcard type.This method does not throw on error (if the wildcard type cannot be resolved). To determine whether or not the returned type was really resolved, use
isResolved().- Returns:
- a resolved type or the same (this) type if the resolution failed
-
toString
Generate a string representation of this wildcard type. Examples with slotsize= 32 bits:?? => slot=1, esize=unk, group=unk (normal representation) ? => slot=1, esize=unk, group=unk (same, compact representation) ??32 => slot=1, esize=32, group=unk (normal representation) ?32 => slot=1, esize=32, group=unk (same, compact representation) ??/64 => slot=2, esize=unk, group=unk ??32/64 => slot=2, esize=32, group=unk ?I => slot=1, esize=unk, group=int ?I32 => slot=1, esize=32, group=int ?U => ?U64 => slot=2, esize=64, group=uint (note that 2 full slots are used, but /64 is not appended since it matches the esize) ?F => ?F32 => ?F64 => ?F32/64 => ?F/64 => ?P => slot=1, psize=unk, group=ptr ?P32 => slot=1, psize=32, group=ptr ?P32/64 => slot=2, psize=32, group=ptr
- Parameters:
compact- true to generate a compact representation: avoid double '?' sequences, do not append the physical bitsize ('/NN') after the type in cases where it's not equal to a slot size- Returns:
- a string representation of the type
-
toString
String toString()Generate a compact representation of the type. Same astoString(true). -
updateProperties
Soft-transfer the properties of a source type to this type.- Parameters:
srctype-- Returns:
- a new type (or this type if no update was performed)
-
getLayoutInfo
TypeLayoutInfo getLayoutInfo()- Returns:
-
isEquivalent
An extendedequalitycheck, that checks unaliased native types (if both wildcard types areresolved).- Parameters:
otherType-- Returns:
-