public class CodeAttribute extends Attribute
Constructor and Description |
---|
CodeAttribute(ClassMethod method,
ConstPool constPool) |
Modifier and Type | Method and Description |
---|---|
void |
aaload() |
void |
aastore() |
void |
aconstNull() |
void |
aload(int no) |
void |
anewarray(String arrayType) |
void |
arraylength() |
void |
assertNotWideOnStack(int position,
String message) |
void |
assertNotWideOnStack(String message) |
void |
assertTypeOnStack(int position,
StackEntryType type,
String message) |
void |
assertTypeOnStack(StackEntryType type,
String message) |
void |
astore(int no) |
void |
athrow() |
void |
baload() |
void |
bastore() |
void |
bipush(byte value) |
void |
branchEnd(BranchEnd end)
marks the end of a branch.
|
void |
caload() |
void |
castore() |
void |
checkcast(Class<?> clazz) |
void |
checkcast(String className)
Do not use Descriptor format (e.g.
|
void |
d2f() |
void |
d2i() |
void |
d2l() |
void |
dadd() |
void |
daload() |
void |
dastore() |
void |
dcmpg() |
void |
dcmpl() |
void |
dconst(double value)
Adds the appropriate dconst instruction.
|
void |
ddiv() |
void |
dload(int no) |
void |
dmul() |
void |
dneg() |
void |
drem() |
void |
dstore(int no) |
void |
dsub() |
void |
dup() |
void |
dup2() |
void |
dup2X1() |
void |
dup2X2() |
void |
dupX1() |
void |
dupX2() |
void |
exceptionBlockEnd(ExceptionHandler handler)
Mark the end of an exception handler block.
|
ExceptionHandler |
exceptionBlockStart(String exceptionType)
Begin writing an exception handler block.
|
void |
exceptionHandlerStart(ExceptionHandler handler)
Marks the current code location as the exception handler and adds the handler to the exception handler table;
|
void |
f2d() |
void |
f2i() |
void |
f2l() |
void |
fadd() |
void |
faload() |
void |
fastore() |
void |
fcmpg() |
void |
fcmpl() |
void |
fconst(float value)
Adds the appropriate fconst instruction.
|
void |
fdiv() |
void |
fload(int no) |
void |
fmul() |
void |
fneg() |
void |
frem() |
void |
fstore(int no) |
void |
fsub() |
ConstPool |
getConstPool() |
void |
getfield(String className,
String field,
Class<?> fieldType) |
void |
getfield(String className,
String field,
String descriptor) |
LinkedHashMap<Integer,StackFrame> |
getStackFrames() |
void |
getstatic(String className,
String field,
Class<?> fieldType) |
void |
getstatic(String className,
String field,
String descriptor) |
BranchEnd |
gotoInstruction()
writes a goto instruction.
|
void |
gotoInstruction(CodeLocation location)
writes a goto instruction.
|
void |
i2b() |
void |
i2c() |
void |
i2d() |
void |
i2f() |
void |
i2l() |
void |
i2s() |
void |
iadd() |
void |
iaload() |
void |
iand() |
void |
iastore() |
void |
iconst(int value)
Adds the appropriate iconst instruction.
|
void |
idiv() |
BranchEnd |
ifAcmpeq() |
void |
ifAcmpeq(CodeLocation location) |
BranchEnd |
ifAcmpne() |
void |
ifAcmpne(CodeLocation location) |
BranchEnd |
ifeq() |
void |
ifEq(CodeLocation location) |
BranchEnd |
ifge() |
void |
ifge(CodeLocation location) |
BranchEnd |
ifgt() |
void |
ifgt(CodeLocation location) |
BranchEnd |
ifIcmpeq() |
void |
ifIcmpeq(CodeLocation location) |
BranchEnd |
ifIcmpge() |
void |
ifIcmpge(CodeLocation location) |
BranchEnd |
ifIcmpgt() |
void |
ifIcmpgt(CodeLocation location) |
BranchEnd |
ifIcmple() |
void |
ifIcmple(CodeLocation location) |
BranchEnd |
ifIcmplt() |
void |
ifIcmplt(CodeLocation location) |
BranchEnd |
ifIcmpne() |
void |
ifIcmpne(CodeLocation location) |
BranchEnd |
ifle() |
void |
ifle(CodeLocation location) |
BranchEnd |
iflt() |
void |
iflt(CodeLocation location) |
BranchEnd |
ifne() |
void |
ifne(CodeLocation location) |
BranchEnd |
ifnotnull() |
void |
ifnotnull(CodeLocation location) |
BranchEnd |
ifnull()
Jump to the given location if the reference type on the top of the stack is null.
|
void |
ifnull(CodeLocation location)
Jump to the given location if the reference type on the top of the stack is null
|
void |
iinc(int local,
int amount) |
void |
iload(int no) |
void |
imul() |
void |
ineg() |
void |
instanceofInstruction(String className) |
void |
invokeinterface(Method method) |
void |
invokeinterface(String className,
String methodName,
String descriptor) |
void |
invokeinterface(String className,
String methodName,
String returnType,
String[] parameterTypes) |
void |
invokespecial(Constructor<?> constructor) |
void |
invokespecial(Method method) |
void |
invokespecial(String className,
String methodName,
String descriptor) |
void |
invokespecial(String className,
String methodName,
String returnType,
String[] parameterTypes) |
void |
invokestatic(Method method) |
void |
invokestatic(String className,
String methodName,
String descriptor) |
void |
invokestatic(String className,
String methodName,
String returnType,
String[] parameterTypes) |
void |
invokevirtual(Method method) |
void |
invokevirtual(String className,
String methodName,
String descriptor) |
void |
invokevirtual(String className,
String methodName,
String returnType,
String[] parameterTypes) |
void |
ior() |
void |
irem() |
void |
ishl() |
void |
ishr() |
void |
istore(int no) |
void |
isub() |
void |
iushr() |
void |
ixor() |
void |
l2d() |
void |
l2f() |
void |
l2i() |
void |
ladd() |
void |
laload() |
void |
land() |
void |
lastore() |
void |
lcmp() |
void |
lconst(long value)
Adds the appropriate lconst instruction.
|
void |
ldc(float value)
Adds an ldc instruction for float
|
void |
ldc(int value)
Adds an ldc instruction for an int.
|
void |
ldc(String value)
Adds an ldc instruction for a String
To load a class literal using ldc use the @{link #loadType(String)} method.
|
void |
ldc2(double value)
Adds an ldc2_w instruction for double
|
void |
ldc2(long value)
Adds an ldc2_w instruction for long
|
void |
ldiv() |
void |
lload(int no) |
void |
lmul() |
void |
lneg() |
void |
load(Class<?> type,
int no)
Generates the apprpriate load instruction for the given type
|
void |
load(String descriptor,
int no)
Generates the apprpriate load instruction for the given type
|
void |
loadClass(String className) |
void |
loadMethodParameters()
loads all parameters onto the stack.
|
void |
loadType(String descriptor)
Loads a java.lang.Class for the given descriptor into the stack.
|
void |
lookupswitch(LookupSwitchBuilder lookupSwitchBuilder)
Adds a lookup switch statement
|
void |
lor() |
void |
lrem() |
void |
lshl() |
void |
lshr() |
void |
lstore(int no) |
void |
lsub() |
void |
lushr() |
void |
lxor() |
CodeLocation |
mark()
Gets the location object for the current location in the bytecode.
|
void |
monitorenter() |
void |
monitorexit() |
void |
multianewarray(String arrayType,
int dimensions) |
void |
newarray(Class<?> arrayType)
arrayType must be a
Class object that represents a primitive type |
void |
newInstruction(Class<?> clazz) |
void |
newInstruction(String classname) |
void |
nop() |
void |
pop() |
void |
pop2() |
void |
putfield(String className,
String field,
Class<?> fieldType) |
void |
putfield(String className,
String field,
String descriptor) |
void |
putstatic(String className,
String field,
Class<?> fieldType) |
void |
putstatic(String className,
String field,
String descriptor) |
void |
returnInstruction()
Adds the appropriate return instruction for the methods return type.
|
void |
saload() |
void |
sastore() |
void |
setupFrame(String... types) |
void |
sipush(short value) |
void |
swap() |
void |
tableswitch(TableSwitchBuilder builder) |
void |
writeData(ByteArrayDataOutputStream stream) |
public static final String NAME
public CodeAttribute(ClassMethod method, ConstPool constPool)
public void writeData(ByteArrayDataOutputStream stream) throws IOException
writeData
in class Attribute
IOException
public void aaload()
public void aastore()
public void aconstNull()
public void aload(int no)
public void anewarray(String arrayType)
public void arraylength()
public void astore(int no)
public void athrow()
public void baload()
public void bastore()
public void caload()
public void castore()
public void bipush(byte value)
public void branchEnd(BranchEnd end)
public void checkcast(String className)
public void checkcast(Class<?> clazz)
public void d2f()
public void d2i()
public void d2l()
public void dadd()
public void daload()
public void dastore()
public void dcmpg()
public void dcmpl()
public void dconst(double value)
public void ddiv()
public void dload(int no)
public void dmul()
public void dneg()
public void drem()
public void dstore(int no)
public void dsub()
public void dup()
public void dupX1()
public void dupX2()
public void dup2()
public void dup2X1()
public void dup2X2()
public ExceptionHandler exceptionBlockStart(String exceptionType)
public void exceptionBlockEnd(ExceptionHandler handler)
public void exceptionHandlerStart(ExceptionHandler handler)
public void f2d()
public void f2i()
public void f2l()
public void fadd()
public void faload()
public void fastore()
public void fcmpg()
public void fcmpl()
public void fconst(float value)
public void fdiv()
public void fload(int no)
public void fmul()
public void fneg()
public void frem()
public void fstore(int no)
public void fsub()
public void gotoInstruction(CodeLocation location)
public BranchEnd gotoInstruction()
public void i2b()
public void i2c()
public void i2d()
public void i2f()
public void i2l()
public void i2s()
public void iadd()
public void iaload()
public void iand()
public void iastore()
public void iconst(int value)
value
- public void idiv()
public void ifAcmpeq(CodeLocation location)
public BranchEnd ifAcmpeq()
public void ifAcmpne(CodeLocation location)
public BranchEnd ifAcmpne()
public void ifIcmpeq(CodeLocation location)
public BranchEnd ifIcmpeq()
public void ifIcmpne(CodeLocation location)
public BranchEnd ifIcmpne()
public void ifIcmplt(CodeLocation location)
public BranchEnd ifIcmplt()
public void ifIcmple(CodeLocation location)
public BranchEnd ifIcmple()
public void ifIcmpgt(CodeLocation location)
public BranchEnd ifIcmpgt()
public void ifIcmpge(CodeLocation location)
public BranchEnd ifIcmpge()
public void ifEq(CodeLocation location)
public BranchEnd ifeq()
public void ifne(CodeLocation location)
public BranchEnd ifne()
public void iflt(CodeLocation location)
public BranchEnd iflt()
public void ifle(CodeLocation location)
public BranchEnd ifle()
public void ifgt(CodeLocation location)
public BranchEnd ifgt()
public void ifge(CodeLocation location)
public BranchEnd ifge()
public void ifnotnull(CodeLocation location)
public BranchEnd ifnotnull()
public void ifnull(CodeLocation location)
public BranchEnd ifnull()
BranchEnd
returned from this method is used to set the end point to a future point in the bytecode streampublic void iinc(int local, int amount)
public void iload(int no)
public void imul()
public void ineg()
public void instanceofInstruction(String className)
public void invokespecial(String className, String methodName, String returnType, String[] parameterTypes)
public void invokespecial(Constructor<?> constructor)
public void invokespecial(Method method)
public void invokestatic(String className, String methodName, String returnType, String[] parameterTypes)
public void invokestatic(Method method)
public void invokevirtual(String className, String methodName, String returnType, String[] parameterTypes)
public void invokevirtual(Method method)
public void invokeinterface(String className, String methodName, String returnType, String[] parameterTypes)
public void invokeinterface(Method method)
public void ior()
public void irem()
public void ishl()
public void ishr()
public void istore(int no)
public void isub()
public void iushr()
public void ixor()
public void l2d()
public void l2f()
public void l2i()
public void ladd()
public void laload()
public void land()
public void lastore()
public void lcmp()
public void lconst(long value)
public void ldc(int value)
value
- public void ldc(float value)
public void ldc(String value)
public void ldc2(double value)
public void ldc2(long value)
public void ldiv()
public void lload(int no)
public void lmul()
public void lneg()
public void load(Class<?> type, int no)
type
- The type of variableno
- local variable numberpublic void load(String descriptor, int no)
descriptor
- The descriptor of the variableno
- local variable numberpublic void loadClass(String className)
public void loadType(String descriptor)
public void lookupswitch(LookupSwitchBuilder lookupSwitchBuilder)
lookupSwitchBuilder
- public void lor()
public void lrem()
public void lshl()
public void lshr()
public void lstore(int no)
public void lsub()
public void lushr()
public void lxor()
public CodeLocation mark()
public void monitorenter()
public void monitorexit()
public void multianewarray(String arrayType, int dimensions)
public void newInstruction(String classname)
public void newInstruction(Class<?> clazz)
public void newarray(Class<?> arrayType)
Class
object that represents a primitive typepublic void nop()
public void pop()
public void pop2()
public void returnInstruction()
public void saload()
public void sastore()
public void sipush(short value)
public void swap()
public void tableswitch(TableSwitchBuilder builder)
public void loadMethodParameters()
public LinkedHashMap<Integer,StackFrame> getStackFrames()
public void setupFrame(String... types)
public ConstPool getConstPool()
public void assertTypeOnStack(int position, StackEntryType type, String message)
public void assertTypeOnStack(StackEntryType type, String message)
public void assertNotWideOnStack(int position, String message)
public void assertNotWideOnStack(String message)
Copyright © 2017 JBoss, a division of Red Hat, Inc.. All Rights Reserved.