Package de.ufinke.cubaja.cafebabe
Class CodeAttribute
- java.lang.Object
-
- de.ufinke.cubaja.cafebabe.CodeAttribute
-
public class CodeAttribute extends Object
Code portion of a method. An instance is supplied by
GenMethod.getCode().Use methods of this class in a way similar to assembler code. Java instructions are added to the generated code by calling the corresponding methods. Just as in assembler, labels may be defined to mark branch target points. Local variables may be identified by their index number, or by name. Constant pool entries are added automatically when needed.
- Author:
- Uwe Finke
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDouble()Opcodedadd.voidaddFloat()Opcodefadd.voidaddInt()Opcodeiadd.voidaddLong()Opcodeladd.voidarithmeticShiftRightInt()Opcodeishr.voidarithmeticShiftRightLong()Opcodelshr.voidarraylength()Opcodearraylength.voidbooleanAndInt()Opcodeiand.voidbooleanAndLong()Opcodeland.voidbooleanOrInt()Opcodeior.voidbooleanOrLong()Opcodelor.voidbooleanXorInt()Opcodeixor.voidbooleanXorLong()Opcodelxor.voidbranch(String labelName)Opcodegoto.voidbranchFar(String labelName)Opcodegoto_w.voidbranchIfEqual(String labelName)Opcodeifeq.voidbranchIfGreater(String labelName)Opcodeifgt.voidbranchIfGreaterEqual(String labelName)Opcodeifge.voidbranchIfLess(String labelName)Opcodeiflt.voidbranchIfLessEqual(String labelName)Opcodeifle.voidbranchIfNonNull(String labelName)Opcodeifnonnull.voidbranchIfNotEqual(String labelName)Opcodeifne.voidbranchIfNull(String labelName)Opcodeifnull.voidcast(Type checkedType)Opcodecheckcast.voidcheckInstance(Type checkedType)Opcodeinstanceof.voidcompareDouble(boolean nanIsMinus)Opcodedcmpgordcmpl.voidcompareFloat(boolean nanIsMinus)Opcodefcmpgorfcmpl.voidcompareIntBranchIfEqual(String labelName)Opcodeif_icmpeq.voidcompareIntBranchIfGreater(String labelName)Opcodeif_icmpgt.voidcompareIntBranchIfGreaterEqual(String labelName)Opcodeif_icmpge.voidcompareIntBranchIfLess(String labelName)Opcodeif_icmplt.voidcompareIntBranchIfLessEqual(String labelName)Opcodeif_icmple.voidcompareIntBranchIfNotEqual(String labelName)Opcodeif_icmpne.voidcompareLong()Opcodelcmp.voidcompareReferenceBranchIfEqual(String labelName)Opcodeif_acmpeq.voidcompareReferenceBranchIfNotEqual(String labelName)Opcodeif_acmpne.voidconvertDoubleToFloat()Opcoded2f.voidconvertDoubleToInt()Opcoded2i.voidconvertDoubleToLong()Opcoded2l.voidconvertFloatToDouble()Opcodef2d.voidconvertFloatToInt()Opcodef2i.voidconvertFloatToLong()Opcodef2l.voidconvertIntToByte()Opcodei2b.voidconvertIntToChar()Opcodei2c.voidconvertIntToDouble()Opcodei2d.voidconvertIntToFloat()Opcodei2f.voidconvertIntToLong()Opcodei2l.voidconvertIntToShort()Opcodei2s.voidconvertLongToDouble()Opcodel2d.voidconvertLongToFloat()Opcodel2f.voidconvertLongToInt()Opcodel2i.voiddefineExceptionHandler(String startLabelName, String endLabelName, Type exceptionType, String handlerLabelName)Defines atry-/catch-block.voiddefineLabel(String labelName)Defines a label.voiddivideDouble()Opcodeddiv.voiddivideFloat()Opcodefdiv.voiddivideInt()Opcodeidiv.voiddivideLong()Opcodeldiv.voidduplicate()Opcodedup.voidduplicateDouble()Opcodedup2.voidduplicateDoubleSkip()Opcodedup2_x1.voidduplicateDoubleSkipDouble()Opcodedup2_x2.voidduplicateSkip()Opcodedup_x1.voidduplicateSkipDouble()Opcodedup_x2.voidgenerate(DataOutputStream out)voidgetField(Type fieldClass, Type fieldType, String fieldName)Opcodegetfield.intgetLocalVariable(String variableName, Type type)Returns the index of a named local variable.voidgetStatic(Type fieldClass, Type fieldType, String fieldName)Opcodegetstatic.voidincrementLocalInt(int index, int increment)Opcode to increment a local int variable (iincor a combination ofload,addandstore).voidincrementLocalInt(String variableName, int increment)Opcode to increment a local int variable by name (iincor a combination ofload,addandstore).voidinvokeInterface(Type methodClass, Type returnType, String methodName, Type... argTypes)Opcodeinvokeinterface.voidinvokeSpecial(Type methodClass, Type returnType, String methodName, Type... argTypes)Opcodeinvokespecial.voidinvokeStatic(Type methodClass, Type returnType, String methodName, Type... argTypes)Opcodeinvokestatic.voidinvokeVirtual(Type methodClass, Type returnType, String methodName, Type... argTypes)Opcodeinvokevirtual.voidjumpFarSubroutine(String labelName)Opcodejsr_w.voidjumpSubroutine(String labelName)Opcodejsr.voidloadBooleanArrayElement()Opcodebaload(boolean).voidloadByteArrayElement()Opcodebaload(byte).voidloadCharArrayElement()Opcodecaload.voidloadConstant(double value)Opcode to load a double constant (dconst_<n>orldc2_w).voidloadConstant(float value)Opcode to load a float constant (fconst_<n>,ldcorldc_w).voidloadConstant(int value)Opcode to load an integer constant (iconst_<n>,bipush,sipush,ldcorldc_w).voidloadConstant(long value)Opcode to load a long constant (lconst_<n>orldc2_w).voidloadConstant(Type value)Opcode to load a class constant (ldcorlcd_w).voidloadConstant(String value)Opcode to load a string constant (ldcorlcd_w).voidloadDoubleArrayElement()Opcodedaload.voidloadFloatArrayElement()Opcodefaload.voidloadIntArrayElement()Opcodeiaload.voidloadLocalDouble(int index)Opcode to load a local double variable (dload_<n>ordload).voidloadLocalDouble(String variableName)Opcode to load a local double variable by name (dload_<n>ordload).voidloadLocalFloat(int index)Opcode to load a local float variable (fload_<n>orfload).voidloadLocalFloat(String variableName)Opcode to load a local float variable by name (fload_<n>orfload).voidloadLocalInt(int index)Opcode to load a local int variable (iload_<n>oriload).voidloadLocalInt(String variableName)Opcode to load a local int variable by name (iload_<n>oriload).voidloadLocalLong(int index)Opcode to load a local long variable (lload_<n>orlload).voidloadLocalLong(String variableName)Opcode to load a local long variable by name (lload_<n>orlload).voidloadLocalReference(int index)Opcode to load a local reference variable (aload_<n>oraload).voidloadLocalReference(String variableName)Opcode to load a local reference variable by name (aload_<n>oraload).voidloadLongArrayElement()Opcodelaload.voidloadNull()Opcodeaconst_null.voidloadReferenceArrayElement()Opcodeaaload.voidloadShortArrayElement()Opcodesaload.voidlogicalShiftRightInt()Opcodeiushr.voidlogicalShiftRightLong()Opcodelushr.voidlookupswitch(BranchTable table)Opcodelookupswitch.voidmonitorEnter()Opcodemonitorenter.voidmonitorExit()Opcodemonitorexit.voidmultiplyDouble()Opcodedmul.voidmultiplyFloat()Opcodefmul.voidmultiplyInt()Opcodeimul.voidmultiplyLong()Opcodelmul.voidnegateDouble()Opcodedneg.voidnegateFloat()Opcodefneg.voidnegateInt()Opcodeineg.voidnegateLong()Opcodelneg.voidnewArray(Type elementType)Opcodenewarrayoranewarray.voidnewMultiReferenceArray(Type clazz, int dimensions)Opcodemultianewarray.voidnewObject(Type clazz)Opcodenew.voidnop()Opcodenop.voidpop()Opcodepop.voidpop(int popSize)Opcode to poppopSizebytes (poporpop2repeatedly).voidpopDouble()Opcodepop2.voidputField(Type fieldClass, Type fieldType, String fieldName)Opcodeputfield.voidputStatic(Type fieldClass, Type fieldType, String fieldName)Opcodeputstatic.voidremainderDouble()Opcodedrem.voidremainderFloat()Opcodefrem.voidremainderInt()Opcodeirem.voidremainderLong()Opcodelrem.voidreturnDouble()Opcodedreturn.voidreturnFloat()Opcodefreturn.voidreturnFromSubroutine(int index)Opcoderet.voidreturnFromSubroutine(String variableName)Opcoderet(address variable by name).voidreturnInt()Opcodeireturn.voidreturnLong()Opcodelreturn.voidreturnReference()Opcodeareturn.voidreturnVoid()Opcodereturn.voidshiftLeftInt()Opcodeishl.voidshiftLeftLong()Opcodelshl.voidstoreBooleanArrayElement()Opcodebastore(boolean).voidstoreByteArrayElement()Opcodebastore(byte).voidstoreCharArrayElement()Opcodecastore.voidstoreDoubleArrayElement()Opcodedastore.voidstoreFloatArrayElement()Opcodefastore.voidstoreIntArrayElement()Opcodeiastore.voidstoreLocalDouble(int index)Opcode to store a local double variable (dstore_<n>ordstore).voidstoreLocalDouble(String variableName)Opcode to store a local double variable by name (dstore_<n>ordstore).voidstoreLocalFloat(int index)Opcode to store a local float variable (fstore_<n>orfstore).voidstoreLocalFloat(String variableName)Opcode to store a local float variable by name (fstore_<n>orfstore).voidstoreLocalInt(int index)Opcode to store a local int variable (istore_<n>oristore).voidstoreLocalInt(String variableName)Opcode to store a local int variable by name (istore_<n>oristore).voidstoreLocalLong(int index)Opcode to store a local long variable (lstore_<n>orlstore).voidstoreLocalLong(String variableName)Opcode to store a local long variable by name (lstore_<n>orlstore).voidstoreLocalReference(int index)Opcode to store a local reference variable (astore_<n>orastore).voidstoreLocalReference(String variableName)Opcode to store a local reference variable by name (astore_<n>orastore).voidstoreLongArrayElement()Opcodelastore.voidstoreReferenceArrayElement()Opcodeaastore.voidstoreShortArrayElement()Opcodesastore.voidsubtractDouble()Opcodedsub.voidsubtractFloat()Opcodefsub.voidsubtractInt()Opcodeisub.voidsubtractLong()Opcodelsub.voidswap()Opcodeswap.voidtableswitch(BranchTable table)Opcodetableswitch.voidthrowException()Opcodeathrow.
-
-
-
Method Detail
-
defineLabel
public void defineLabel(String labelName)
Defines a label. This label may be used as branch target in jump instructions.- Parameters:
labelName- a named label at this place of code
-
defineExceptionHandler
public void defineExceptionHandler(String startLabelName, String endLabelName, Type exceptionType, String handlerLabelName)
Defines atry-/catch-block. Thetry-block must be enclosed with a start and an end label. The entry point of thecatch-block (handler) must also be labelled.- Parameters:
startLabelName- start label name of try blockendLabelName- end label name of try blockexceptionType- exception class or typehandlerLabelName- start label name of catch block
-
getLocalVariable
public int getLocalVariable(String variableName, Type type)
Returns the index of a named local variable.- Parameters:
variableName- name of variabletype- type of variable- Returns:
- index index position
-
nop
public void nop()
Opcodenop.
-
loadNull
public void loadNull()
Opcodeaconst_null.
-
loadConstant
public void loadConstant(int value)
Opcode to load an integer constant (iconst_<n>,bipush,sipush,ldcorldc_w).- Parameters:
value- constant value
-
loadConstant
public void loadConstant(long value)
Opcode to load a long constant (lconst_<n>orldc2_w).- Parameters:
value- constant value
-
loadConstant
public void loadConstant(float value)
Opcode to load a float constant (fconst_<n>,ldcorldc_w).- Parameters:
value- constant value
-
loadConstant
public void loadConstant(double value)
Opcode to load a double constant (dconst_<n>orldc2_w).- Parameters:
value- constant value
-
loadConstant
public void loadConstant(String value)
Opcode to load a string constant (ldcorlcd_w).- Parameters:
value- constant value
-
loadConstant
public void loadConstant(Type value)
Opcode to load a class constant (ldcorlcd_w).- Parameters:
value- class type as constant value
-
loadLocalInt
public void loadLocalInt(String variableName)
Opcode to load a local int variable by name (iload_<n>oriload).- Parameters:
variableName- name of variable
-
loadLocalInt
public void loadLocalInt(int index)
Opcode to load a local int variable (iload_<n>oriload).- Parameters:
index- index position of variable
-
loadLocalLong
public void loadLocalLong(String variableName)
Opcode to load a local long variable by name (lload_<n>orlload).- Parameters:
variableName- name of variable
-
loadLocalLong
public void loadLocalLong(int index)
Opcode to load a local long variable (lload_<n>orlload).- Parameters:
index- index position of variable
-
loadLocalFloat
public void loadLocalFloat(String variableName)
Opcode to load a local float variable by name (fload_<n>orfload).- Parameters:
variableName- name of variable
-
loadLocalFloat
public void loadLocalFloat(int index)
Opcode to load a local float variable (fload_<n>orfload).- Parameters:
index- index position of variable
-
loadLocalDouble
public void loadLocalDouble(String variableName)
Opcode to load a local double variable by name (dload_<n>ordload).- Parameters:
variableName- name of variable
-
loadLocalDouble
public void loadLocalDouble(int index)
Opcode to load a local double variable (dload_<n>ordload).- Parameters:
index- index position of variable
-
loadLocalReference
public void loadLocalReference(String variableName)
Opcode to load a local reference variable by name (aload_<n>oraload).- Parameters:
variableName- name of variable
-
loadLocalReference
public void loadLocalReference(int index)
Opcode to load a local reference variable (aload_<n>oraload).- Parameters:
index- index position of variable
-
loadIntArrayElement
public void loadIntArrayElement()
Opcodeiaload.
-
loadLongArrayElement
public void loadLongArrayElement()
Opcodelaload.
-
loadFloatArrayElement
public void loadFloatArrayElement()
Opcodefaload.
-
loadDoubleArrayElement
public void loadDoubleArrayElement()
Opcodedaload.
-
loadReferenceArrayElement
public void loadReferenceArrayElement()
Opcodeaaload.
-
loadBooleanArrayElement
public void loadBooleanArrayElement()
Opcodebaload(boolean).
-
loadByteArrayElement
public void loadByteArrayElement()
Opcodebaload(byte).
-
loadCharArrayElement
public void loadCharArrayElement()
Opcodecaload.
-
loadShortArrayElement
public void loadShortArrayElement()
Opcodesaload.
-
storeLocalInt
public void storeLocalInt(String variableName)
Opcode to store a local int variable by name (istore_<n>oristore).- Parameters:
variableName- name of variable
-
storeLocalInt
public void storeLocalInt(int index)
Opcode to store a local int variable (istore_<n>oristore).- Parameters:
index- index position of variable
-
storeLocalLong
public void storeLocalLong(String variableName)
Opcode to store a local long variable by name (lstore_<n>orlstore).- Parameters:
variableName- name of variable
-
storeLocalLong
public void storeLocalLong(int index)
Opcode to store a local long variable (lstore_<n>orlstore).- Parameters:
index- index position of variable
-
storeLocalFloat
public void storeLocalFloat(String variableName)
Opcode to store a local float variable by name (fstore_<n>orfstore).- Parameters:
variableName- name of variable
-
storeLocalFloat
public void storeLocalFloat(int index)
Opcode to store a local float variable (fstore_<n>orfstore).- Parameters:
index- index position of variable
-
storeLocalDouble
public void storeLocalDouble(String variableName)
Opcode to store a local double variable by name (dstore_<n>ordstore).- Parameters:
variableName- name of variable
-
storeLocalDouble
public void storeLocalDouble(int index)
Opcode to store a local double variable (dstore_<n>ordstore).- Parameters:
index- index position of variable
-
storeLocalReference
public void storeLocalReference(String variableName)
Opcode to store a local reference variable by name (astore_<n>orastore).- Parameters:
variableName- name of variable
-
storeLocalReference
public void storeLocalReference(int index)
Opcode to store a local reference variable (astore_<n>orastore).- Parameters:
index- index position of variable
-
storeIntArrayElement
public void storeIntArrayElement()
Opcodeiastore.
-
storeLongArrayElement
public void storeLongArrayElement()
Opcodelastore.
-
storeFloatArrayElement
public void storeFloatArrayElement()
Opcodefastore.
-
storeDoubleArrayElement
public void storeDoubleArrayElement()
Opcodedastore.
-
storeReferenceArrayElement
public void storeReferenceArrayElement()
Opcodeaastore.
-
storeBooleanArrayElement
public void storeBooleanArrayElement()
Opcodebastore(boolean).
-
storeByteArrayElement
public void storeByteArrayElement()
Opcodebastore(byte).
-
storeCharArrayElement
public void storeCharArrayElement()
Opcodecastore.
-
storeShortArrayElement
public void storeShortArrayElement()
Opcodesastore.
-
pop
public void pop()
Opcodepop.
-
popDouble
public void popDouble()
Opcodepop2.
-
pop
public void pop(int popSize)
Opcode to poppopSizebytes (poporpop2repeatedly).- Parameters:
popSize- number of bytes to pop
-
duplicate
public void duplicate()
Opcodedup.
-
duplicateSkip
public void duplicateSkip()
Opcodedup_x1.
-
duplicateSkipDouble
public void duplicateSkipDouble()
Opcodedup_x2.
-
duplicateDouble
public void duplicateDouble()
Opcodedup2.
-
duplicateDoubleSkip
public void duplicateDoubleSkip()
Opcodedup2_x1.
-
duplicateDoubleSkipDouble
public void duplicateDoubleSkipDouble()
Opcodedup2_x2.
-
swap
public void swap()
Opcodeswap.
-
addInt
public void addInt()
Opcodeiadd.
-
addLong
public void addLong()
Opcodeladd.
-
addFloat
public void addFloat()
Opcodefadd.
-
addDouble
public void addDouble()
Opcodedadd.
-
subtractInt
public void subtractInt()
Opcodeisub.
-
subtractLong
public void subtractLong()
Opcodelsub.
-
subtractFloat
public void subtractFloat()
Opcodefsub.
-
subtractDouble
public void subtractDouble()
Opcodedsub.
-
multiplyInt
public void multiplyInt()
Opcodeimul.
-
multiplyLong
public void multiplyLong()
Opcodelmul.
-
multiplyFloat
public void multiplyFloat()
Opcodefmul.
-
multiplyDouble
public void multiplyDouble()
Opcodedmul.
-
divideInt
public void divideInt()
Opcodeidiv.
-
divideLong
public void divideLong()
Opcodeldiv.
-
divideFloat
public void divideFloat()
Opcodefdiv.
-
divideDouble
public void divideDouble()
Opcodeddiv.
-
remainderInt
public void remainderInt()
Opcodeirem.
-
remainderLong
public void remainderLong()
Opcodelrem.
-
remainderFloat
public void remainderFloat()
Opcodefrem.
-
remainderDouble
public void remainderDouble()
Opcodedrem.
-
negateInt
public void negateInt()
Opcodeineg.
-
negateLong
public void negateLong()
Opcodelneg.
-
negateFloat
public void negateFloat()
Opcodefneg.
-
negateDouble
public void negateDouble()
Opcodedneg.
-
shiftLeftInt
public void shiftLeftInt()
Opcodeishl.
-
shiftLeftLong
public void shiftLeftLong()
Opcodelshl.
-
arithmeticShiftRightInt
public void arithmeticShiftRightInt()
Opcodeishr.
-
arithmeticShiftRightLong
public void arithmeticShiftRightLong()
Opcodelshr.
-
logicalShiftRightInt
public void logicalShiftRightInt()
Opcodeiushr.
-
logicalShiftRightLong
public void logicalShiftRightLong()
Opcodelushr.
-
booleanAndInt
public void booleanAndInt()
Opcodeiand.
-
booleanAndLong
public void booleanAndLong()
Opcodeland.
-
booleanOrInt
public void booleanOrInt()
Opcodeior.
-
booleanOrLong
public void booleanOrLong()
Opcodelor.
-
booleanXorInt
public void booleanXorInt()
Opcodeixor.
-
booleanXorLong
public void booleanXorLong()
Opcodelxor.
-
incrementLocalInt
public void incrementLocalInt(String variableName, int increment)
Opcode to increment a local int variable by name (iincor a combination ofload,addandstore).- Parameters:
variableName- name of variableincrement- increment value
-
incrementLocalInt
public void incrementLocalInt(int index, int increment)Opcode to increment a local int variable (iincor a combination ofload,addandstore).- Parameters:
index- index position of variableincrement- increment value
-
convertIntToLong
public void convertIntToLong()
Opcodei2l.
-
convertIntToFloat
public void convertIntToFloat()
Opcodei2f.
-
convertIntToDouble
public void convertIntToDouble()
Opcodei2d.
-
convertLongToInt
public void convertLongToInt()
Opcodel2i.
-
convertLongToFloat
public void convertLongToFloat()
Opcodel2f.
-
convertLongToDouble
public void convertLongToDouble()
Opcodel2d.
-
convertFloatToInt
public void convertFloatToInt()
Opcodef2i.
-
convertFloatToLong
public void convertFloatToLong()
Opcodef2l.
-
convertFloatToDouble
public void convertFloatToDouble()
Opcodef2d.
-
convertDoubleToInt
public void convertDoubleToInt()
Opcoded2i.
-
convertDoubleToLong
public void convertDoubleToLong()
Opcoded2l.
-
convertDoubleToFloat
public void convertDoubleToFloat()
Opcoded2f.
-
convertIntToByte
public void convertIntToByte()
Opcodei2b.
-
convertIntToChar
public void convertIntToChar()
Opcodei2c.
-
convertIntToShort
public void convertIntToShort()
Opcodei2s.
-
compareLong
public void compareLong()
Opcodelcmp.
-
compareFloat
public void compareFloat(boolean nanIsMinus)
Opcodefcmpgorfcmpl.- Parameters:
nanIsMinus- flag wether NaN is negative
-
compareDouble
public void compareDouble(boolean nanIsMinus)
Opcodedcmpgordcmpl.- Parameters:
nanIsMinus- flag wether NaN is negative
-
branchIfEqual
public void branchIfEqual(String labelName)
Opcodeifeq. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- name of label to branch to
-
branchIfNotEqual
public void branchIfNotEqual(String labelName)
Opcodeifne. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- name of label to branch to
-
branchIfLess
public void branchIfLess(String labelName)
Opcodeiflt. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- name of label to branch to
-
branchIfGreaterEqual
public void branchIfGreaterEqual(String labelName)
Opcodeifge. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- name of label to branch to
-
branchIfGreater
public void branchIfGreater(String labelName)
Opcodeifgt. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- name of label to branch to
-
branchIfLessEqual
public void branchIfLessEqual(String labelName)
Opcodeifle. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- name of label to branch to
-
compareIntBranchIfEqual
public void compareIntBranchIfEqual(String labelName)
Opcodeif_icmpeq. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- name of label to branch to
-
compareIntBranchIfNotEqual
public void compareIntBranchIfNotEqual(String labelName)
Opcodeif_icmpne. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- name of label to branch to
-
compareIntBranchIfLess
public void compareIntBranchIfLess(String labelName)
Opcodeif_icmplt. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- name of label to branch to
-
compareIntBranchIfGreaterEqual
public void compareIntBranchIfGreaterEqual(String labelName)
Opcodeif_icmpge. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- name of label to branch to
-
compareIntBranchIfGreater
public void compareIntBranchIfGreater(String labelName)
Opcodeif_icmpgt. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- name of label to branch to
-
compareIntBranchIfLessEqual
public void compareIntBranchIfLessEqual(String labelName)
Opcodeif_icmple. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- name of label to branch to
-
compareReferenceBranchIfEqual
public void compareReferenceBranchIfEqual(String labelName)
Opcodeif_acmpeq. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- name of label to branch to
-
compareReferenceBranchIfNotEqual
public void compareReferenceBranchIfNotEqual(String labelName)
Opcodeif_acmpne. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- name of label to branch to
-
branch
public void branch(String labelName)
Opcodegoto. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- name of label to branch to
-
jumpSubroutine
public void jumpSubroutine(String labelName)
Opcodejsr. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- name of label to branch to
-
returnFromSubroutine
public void returnFromSubroutine(String variableName)
Opcoderet(address variable by name).- Parameters:
variableName- name of variable
-
returnFromSubroutine
public void returnFromSubroutine(int index)
Opcoderet.- Parameters:
index- index position of variable
-
tableswitch
public void tableswitch(BranchTable table)
Opcodetableswitch.- Parameters:
table- branch table with case entries
-
lookupswitch
public void lookupswitch(BranchTable table)
Opcodelookupswitch.- Parameters:
table- branch table with case entries
-
returnInt
public void returnInt()
Opcodeireturn.
-
returnLong
public void returnLong()
Opcodelreturn.
-
returnFloat
public void returnFloat()
Opcodefreturn.
-
returnDouble
public void returnDouble()
Opcodedreturn.
-
returnReference
public void returnReference()
Opcodeareturn.
-
returnVoid
public void returnVoid()
Opcodereturn.
-
getStatic
public void getStatic(Type fieldClass, Type fieldType, String fieldName)
Opcodegetstatic.- Parameters:
fieldClass- member class of fieldfieldType- type of fieldfieldName- name of field
-
putStatic
public void putStatic(Type fieldClass, Type fieldType, String fieldName)
Opcodeputstatic.- Parameters:
fieldClass- member class of fieldfieldType- type of fieldfieldName- name of field
-
getField
public void getField(Type fieldClass, Type fieldType, String fieldName)
Opcodegetfield.- Parameters:
fieldClass- member class of fieldfieldType- type of fieldfieldName- name of field
-
putField
public void putField(Type fieldClass, Type fieldType, String fieldName)
Opcodeputfield.- Parameters:
fieldClass- member class of fieldfieldType- type of fieldfieldName- name of field
-
invokeVirtual
public void invokeVirtual(Type methodClass, Type returnType, String methodName, Type... argTypes)
Opcodeinvokevirtual.- Parameters:
methodClass- member class of methodreturnType- type of return valuemethodName- method nameargTypes- types of arguments
-
invokeSpecial
public void invokeSpecial(Type methodClass, Type returnType, String methodName, Type... argTypes)
Opcodeinvokespecial.- Parameters:
methodClass- member class of methodreturnType- type of return valuemethodName- method nameargTypes- types of arguments
-
invokeStatic
public void invokeStatic(Type methodClass, Type returnType, String methodName, Type... argTypes)
Opcodeinvokestatic.- Parameters:
methodClass- member class of methodreturnType- type of return valuemethodName- method nameargTypes- types of arguments
-
invokeInterface
public void invokeInterface(Type methodClass, Type returnType, String methodName, Type... argTypes)
Opcodeinvokeinterface.- Parameters:
methodClass- interface class of methodreturnType- type of return valuemethodName- method nameargTypes- types of arguments
-
newObject
public void newObject(Type clazz)
Opcodenew.- Parameters:
clazz- class type
-
newArray
public void newArray(Type elementType)
Opcodenewarrayoranewarray.- Parameters:
elementType- array element type
-
arraylength
public void arraylength()
Opcodearraylength.
-
throwException
public void throwException()
Opcodeathrow.
-
cast
public void cast(Type checkedType)
Opcodecheckcast.- Parameters:
checkedType- type to cast
-
checkInstance
public void checkInstance(Type checkedType)
Opcodeinstanceof.- Parameters:
checkedType- type of instance
-
monitorEnter
public void monitorEnter()
Opcodemonitorenter.
-
monitorExit
public void monitorExit()
Opcodemonitorexit.
-
newMultiReferenceArray
public void newMultiReferenceArray(Type clazz, int dimensions)
Opcodemultianewarray.- Parameters:
clazz- element class typedimensions- number of dimensions
-
branchIfNull
public void branchIfNull(String labelName)
Opcodeifnull. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- label name to branch to
-
branchIfNonNull
public void branchIfNonNull(String labelName)
Opcodeifnonnull. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- label name to branch to
-
branchFar
public void branchFar(String labelName)
Opcodegoto_w. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- label name to branch to
-
jumpFarSubroutine
public void jumpFarSubroutine(String labelName)
Opcodejsr_w. The label must be defined bydefineLabel(java.lang.String).- Parameters:
labelName- label name to branch to
-
generate
public void generate(DataOutputStream out) throws Exception
- Throws:
Exception
-
-