|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjasm.attributes.Code
public class Code
This represents the Code attribute from the JVM Specification.
Nested Class Summary | |
---|---|
static interface |
Code.BytecodeMapAttribute
Maps bytecodes to some kind of attribute. |
static class |
Code.Handler
The exception handler class is used to store the necessary information about where control-flow is directed when an exception is raised. |
static class |
Code.Rewrite
A rewrite defines a sequence of bytecodes that are to be rewritten as a (potentially) smaller sequence. |
Nested classes/interfaces inherited from interface jasm.lang.BytecodeAttribute |
---|
BytecodeAttribute.Fn, BytecodeAttribute.Reader, BytecodeAttribute.Unknown |
Field Summary | |
---|---|
protected java.util.ArrayList<BytecodeAttribute> |
attributes
|
protected java.util.ArrayList<Bytecode> |
bytecodes
|
protected java.util.ArrayList<Code.Handler> |
handlers
|
protected ClassFile.Method |
method
|
Constructor Summary | |
---|---|
Code(java.util.Collection<Bytecode> bytecodes,
java.util.Collection<Code.Handler> handlers,
ClassFile.Method method)
|
Method Summary | ||
---|---|---|
void |
addPoolItems(java.util.Set<Constant.Info> constantPool)
When this method is called, the attribute must add all items that it needs to the constant pool. |
|
void |
apply(java.util.List<Code.Rewrite> rewrites)
This method accepts a list of rewrites which should be applied. |
|
|
attribute(java.lang.Class<T> c)
|
|
java.util.List<BytecodeAttribute> |
attributes()
|
|
java.util.List<Bytecode> |
bytecodes()
|
|
java.util.List<Code.Handler> |
handlers()
|
|
int |
maxLocals()
Determine the maximum number of local variable slots required for this method. |
|
int |
maxStack()
Determine the maximum number of stack slots required for this method. |
|
java.lang.String |
name()
|
|
void |
print(java.io.PrintWriter output,
java.util.Map<Constant.Info,java.lang.Integer> constantPool)
This method is used to print the contents of the attribute in human-readable form, similar to that produced by "javap". |
|
void |
validate(java.util.List<Code.Rewrite> rewrites)
The purpose of this method is to validate a candidate list of rewrites. |
|
void |
write(BinaryOutputStream writer,
java.util.Map<Constant.Info,java.lang.Integer> constantPool)
This method requires the attribute to write itself to the binary stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.ArrayList<Bytecode> bytecodes
protected java.util.ArrayList<Code.Handler> handlers
protected java.util.ArrayList<BytecodeAttribute> attributes
protected ClassFile.Method method
Constructor Detail |
---|
public Code(java.util.Collection<Bytecode> bytecodes, java.util.Collection<Code.Handler> handlers, ClassFile.Method method)
Method Detail |
---|
public java.lang.String name()
name
in interface BytecodeAttribute
public java.util.List<BytecodeAttribute> attributes()
public <T extends BytecodeAttribute> T attribute(java.lang.Class<T> c)
public int maxLocals()
public int maxStack()
public java.util.List<Bytecode> bytecodes()
public java.util.List<Code.Handler> handlers()
public void addPoolItems(java.util.Set<Constant.Info> constantPool)
BytecodeAttribute
addPoolItems
in interface BytecodeAttribute
public void write(BinaryOutputStream writer, java.util.Map<Constant.Info,java.lang.Integer> constantPool) throws java.io.IOException
BytecodeAttribute
write
in interface BytecodeAttribute
java.io.IOException
public void validate(java.util.List<Code.Rewrite> rewrites)
rewrites
- public void apply(java.util.List<Code.Rewrite> rewrites)
rewrites
- public void print(java.io.PrintWriter output, java.util.Map<Constant.Info,java.lang.Integer> constantPool)
BytecodeAttribute
print
in interface BytecodeAttribute
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |