|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.impl.enhancer.classfile.ClassAttribute
org.apache.jdo.impl.enhancer.classfile.CodeAttribute
Subtype of ClassAttribute which describes the "Code" attribute associated with a method.
Field Summary | |
private AttributeVector |
codeAttributes
|
(package private) CodeEnv |
codeEnv
|
private ExceptionTable |
exceptionTable
|
static java.lang.String |
expectedAttrName
|
private int |
maxLocals
|
private int |
maxStack
|
private Insn |
theCode
|
private byte[] |
theCodeBytes
|
private byte[] |
theDataBytes
|
Fields inherited from class org.apache.jdo.impl.enhancer.classfile.ClassAttribute |
|
Constructor Summary | |
CodeAttribute(ConstUtf8 attrName,
byte[] dataBytes,
CodeEnv codeEnv)
Constructs a CodeAttribute object for later disassembly |
|
CodeAttribute(ConstUtf8 attrName,
int maxStack,
int maxLocals,
Insn code,
byte[] codeBytes,
ExceptionTable excTable,
AttributeVector codeAttrs,
CodeEnv codeEnv)
Constructs a CodeAttribute object |
|
CodeAttribute(ConstUtf8 attrName,
int maxStack,
int maxLocals,
Insn code,
ExceptionTable excTable,
AttributeVector codeAttrs)
Constructs a CodeAttribute object for construction from scratch |
Method Summary | |
AttributeVector |
attributes()
Return the attributes which apply to this code |
private void |
buildInstructionBytes()
Derive the instruction byte codes from the instruction list This should also recompute stack and variables but for now we assume that this isn't needed |
private void |
buildInstructions(CodeEnv codeEnv)
Derive the instruction list from the instruction byte codes |
byte[] |
byteCodes()
Return the java VM byte code sequence for this method - null for native and abstract methods |
(package private) int |
codeSize()
|
ExceptionTable |
exceptionHandlers()
Return the exception ranges and handlers which apply to the code in this method. |
boolean |
isEqual(java.util.Stack msg,
java.lang.Object obj)
Compares this instance with another for structural equality. |
int |
localsUsed()
Return the maximum number of local variables used by this method |
private void |
makeValid()
If theDataBytes is non-null, disassemble this code attribute from the data bytes. |
(package private) void |
print(java.io.PrintStream out,
int indent)
Print a description of the attribute to the print stream |
(package private) static CodeAttribute |
read(ConstUtf8 attrName,
java.io.DataInputStream data,
ConstantPool pool)
|
(package private) static CodeAttribute |
read(ConstUtf8 attrName,
int attrLength,
java.io.DataInputStream data,
ConstantPool pool)
|
private int |
resolveOffsets()
Assign offsets to instructions and return the number of bytes. |
void |
setLocalsUsed(int used)
Set the maximum number of local variables used by this method |
void |
setStackUsed(int used)
Set the maximum number of stack entries used by this method |
void |
setTheCode(Insn insn)
Install the instruction sequence for this method - the byte code array is later updated. |
int |
stackUsed()
Return the maximum number of stack entries used by this method |
Insn |
theCode()
Return the instruction sequence for this method - initially derived from the byte code array, but may later be modified |
(package private) void |
write(java.io.DataOutputStream out)
Write the attribute to the output stream |
Methods inherited from class org.apache.jdo.impl.enhancer.classfile.ClassAttribute |
attrName, read, read |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String expectedAttrName
private byte[] theDataBytes
private int maxStack
private int maxLocals
private byte[] theCodeBytes
private Insn theCode
private ExceptionTable exceptionTable
private AttributeVector codeAttributes
CodeEnv codeEnv
Constructor Detail |
public CodeAttribute(ConstUtf8 attrName, int maxStack, int maxLocals, Insn code, ExceptionTable excTable, AttributeVector codeAttrs)
public CodeAttribute(ConstUtf8 attrName, int maxStack, int maxLocals, Insn code, byte[] codeBytes, ExceptionTable excTable, AttributeVector codeAttrs, CodeEnv codeEnv)
public CodeAttribute(ConstUtf8 attrName, byte[] dataBytes, CodeEnv codeEnv)
Method Detail |
public int stackUsed()
public void setStackUsed(int used)
public int localsUsed()
public void setLocalsUsed(int used)
public byte[] byteCodes()
public Insn theCode()
public void setTheCode(Insn insn)
public ExceptionTable exceptionHandlers()
public AttributeVector attributes()
public boolean isEqual(java.util.Stack msg, java.lang.Object obj)
isEqual
in class ClassAttribute
static CodeAttribute read(ConstUtf8 attrName, java.io.DataInputStream data, ConstantPool pool) throws java.io.IOException
java.io.IOException
static CodeAttribute read(ConstUtf8 attrName, int attrLength, java.io.DataInputStream data, ConstantPool pool) throws java.io.IOException
java.io.IOException
void write(java.io.DataOutputStream out) throws java.io.IOException
ClassAttribute
write
in class ClassAttribute
java.io.IOException
void print(java.io.PrintStream out, int indent)
ClassAttribute
print
in class ClassAttribute
private int resolveOffsets()
int codeSize()
private void buildInstructions(CodeEnv codeEnv)
private void buildInstructionBytes()
private void makeValid()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |