|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dellroad.jc.cgen.Util
Various utility stuff used when analyzing class files and generating code.
Nested Class Summary | |
static class |
Util.OrderTypeSwitch
Utility class that computes ordering preference in a C structure of the various types. |
static class |
Util.PrimTypeSwitch
Utility class that passes the appropriate string ("byte", "char", etc.) to the prim() method depending
on the primitive type. |
Field Summary | |
static int |
ACC_SUPER
|
static Comparator |
classComparator
Sorts classes by their names' UTF-8 encoding. |
static Comparator |
fieldComparator
Sorts fields by staticness, basic type, name, then signature. |
static Comparator |
localComparator
Sorts local variables by name. |
static Comparator |
methodComparator
Sorts methods by name, then by signature. |
static Comparator |
utf8Comparator
Sorts Strings in the same way that strcmp() does on their UTF-8 encodings. |
Method Summary | |
static String |
_JC_TYPE(Type t)
Return the _JC_TYPE_* macro appropriate for the given type. |
static void |
addSupertypes(SootClass cls,
Set set)
|
static long |
classHash(SootClass sc)
|
static String |
fieldDescriptor(Type t)
|
static SootMethod |
findMethod(SootClass c,
String subSig)
Find a method declared by a SootClass or any of its superclasses. |
static String |
fullSignature(SootMethod m)
|
static Set |
getAllInterfaces(SootClass c)
|
static Set |
getAllSupertypes(SootClass c)
|
static long |
hash(String s)
|
static boolean |
hasSubtypes(SootClass c)
|
static boolean |
hasSubtypes(SootField f)
|
static boolean |
hasSubtypes(SootMethod m)
|
static boolean |
hasSubtypes(Type t)
|
static int |
imethodHash(SootMethod m)
Get the interface method hash table hash. |
static int |
instanceofHash(SootClass sc)
Get the instanceof hash table hash. |
static boolean |
isClassInit(SootMethod m)
|
static boolean |
isConstructor(SootMethod m)
|
static boolean |
isFinal(SootClass c)
|
static boolean |
isFinal(SootField f)
|
static boolean |
isFinal(SootMethod m)
|
static boolean |
isNonvirtual(SpecialInvokeExpr v,
SootMethod callingMethod)
Determine if an INVOKESPECIAL can be implemented like the old INVOKENONVIRTUAL. |
static boolean |
isPrimitive(Type type)
|
static boolean |
isPrimitiveArray(Type type)
|
static boolean |
isReference(SootClass c)
|
static boolean |
isReference(SootField f)
|
static boolean |
isReference(SootMethod m)
|
static boolean |
isReference(Type t)
Return whether type t is a reference type or not.
|
static boolean |
isVirtual(SootMethod m)
|
static void |
panic(String msg)
|
static String |
paramTypes(SootMethod m)
|
static void |
require(boolean value)
|
static void |
require(boolean value,
String msg)
Poor man's assert(). |
static long |
sigHash(SootMethod m)
|
static String |
sigHashString(SootMethod m)
|
static String |
signature(SootField f)
|
static String |
signature(SootMethod m)
|
static char |
typeLetter(Type t)
|
static String |
typeWord(Type t)
|
static byte[] |
utf8Encode(String s)
This method is required to work around a stupid bug in Sun's JDK String.getBytes("UTF-8") (bug #4628881). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ACC_SUPER
public static final Comparator utf8Comparator
public static final Comparator methodComparator
public static final Comparator localComparator
public static final Comparator fieldComparator
public static final Comparator classComparator
Method Detail |
public static String _JC_TYPE(Type t)
public static boolean isReference(SootClass c)
public static boolean isReference(SootField f)
public static boolean isReference(SootMethod m)
public static boolean isPrimitive(Type type)
public static boolean isPrimitiveArray(Type type)
public static boolean isFinal(SootClass c)
public static boolean isFinal(SootField f)
public static boolean isFinal(SootMethod m)
public static boolean isVirtual(SootMethod m)
public static boolean isConstructor(SootMethod m)
public static boolean isClassInit(SootMethod m)
public static boolean hasSubtypes(SootClass c)
public static boolean hasSubtypes(SootField f)
public static boolean hasSubtypes(SootMethod m)
public static boolean hasSubtypes(Type t)
public static boolean isReference(Type t)
t
is a reference type or not.
t
must be a normal Java type, i.e., a type that can
be the type of a variable.
public static char typeLetter(Type t)
public static String fieldDescriptor(Type t)
public static String typeWord(Type t)
public static String signature(SootField f)
public static String signature(SootMethod m)
public static String fullSignature(SootMethod m)
public static String paramTypes(SootMethod m)
public static long hash(String s)
public static long sigHash(SootMethod m)
public static long classHash(SootClass sc)
public static boolean isNonvirtual(SpecialInvokeExpr v, SootMethod callingMethod)
public static int instanceofHash(SootClass sc)
public static int imethodHash(SootMethod m)
public static String sigHashString(SootMethod m)
public static SootMethod findMethod(SootClass c, String subSig)
public static Set getAllInterfaces(SootClass c)
public static Set getAllSupertypes(SootClass c)
public static void addSupertypes(SootClass cls, Set set)
public static void require(boolean value)
public static void require(boolean value, String msg)
public static byte[] utf8Encode(String s)
public static void panic(String msg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |