|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.claritysys.jvm.classfile.Utils
public final class Utils
| Constructor Summary | |
|---|---|
Utils()
|
|
| Method Summary | |
|---|---|
static int |
getMethodReturnType(java.lang.String vmSignature)
Determine the return type of the method, given its VM signature. |
static int |
getMethodStackWords(java.lang.String vmMethodSig)
Count the number of stack words needed to hold the parameters for the given method signature. |
static int |
getParameterCount(java.lang.String vmMethodSig)
Count how many parameters there are in the given method signature. |
static java.lang.String[] |
getParameters(java.lang.String vmMethodSig)
Return an array of strings representing the individual parameters of the given VM-formatted method signature. |
static int |
getStackWords(int type)
|
static int |
getStackWords(java.lang.String fieldType)
|
static int |
parseType(char ch)
|
static int |
parseType(java.lang.String vmSignature)
Return one of the JVM.T_XXX constants for the given VM signature. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Utils()
| Method Detail |
|---|
public static int parseType(java.lang.String vmSignature)
For example, if given "I", return JVM.T_INT. If given "Ljava/lang/Object;" return JVM.T_OBJECT.
public static int getStackWords(java.lang.String fieldType)
public static int getStackWords(int type)
public static int parseType(char ch)
public static int getMethodReturnType(java.lang.String vmSignature)
A VM signature looks like this (some samples):
(IIZ)V // a method taking (int, int, boolean) and returning void ()I // a method taking no params and return an int ()[I // a method taking no params and returning array of int.
public static int getMethodStackWords(java.lang.String vmMethodSig)
Because it doesn't know if the method is static, it cannot include the "this", which is always local zero for non-static methods, so be sure to account for that.
public static java.lang.String[] getParameters(java.lang.String vmMethodSig)
Eg, given a signature "(II)Ljava/lang/String;" return an array with 2 string elements "I" and "I". The return type is discarded.
vmMethodSig - Method signature in VM format (see doc description).
public static int getParameterCount(java.lang.String vmMethodSig)
vmMethodSig -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||