Package org.openjdk.asmtools.jdis
Class CodeData
- java.lang.Object
-
- org.openjdk.asmtools.jdis.Indenter
-
- org.openjdk.asmtools.jdis.CodeData
-
public class CodeData extends Indenter
Code data for a code attribute in method members in a class of the Java Disassembler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classCodeData.LineNumDatastatic classCodeData.LocVarData
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<AttrData>attrsThe remaining attributes of this classprotected ClassDataclsprotected byte[]codeRaw byte array for the byte codesprivate java.util.HashMap<java.lang.Integer,iAtt>iattrs(parsed) reversed bytecode index hash, associates labels with ByteCode indexesprivate java.util.ArrayList<TypeAnnotationData>invisibleTypeAnnotationsThe invisible type annotations for this methodprivate java.util.ArrayList<CodeData.LineNumData>lin_num_tb(parsed) Line Number table, describes source lines associated with ByteCode indexesprivate java.util.ArrayList<CodeData.LocVarData>loc_var_tb(parsed) Local Variable table, describes variable scopes associated with ByteCode indexesprotected intmax_localsLimit for the number of local varsprotected intmax_stackLimit for the stack sizeprotected MethodDatamethprivate java.io.PrintWriteroutprivate java.util.ArrayList<StackMapData>stack_map(parsed) stack map table, describes compiler hints for stack rep, associated with ByteCode indexesprivate java.util.ArrayList<TrapData>trap_table(parsed) Trap table, describes exceptions caughtprivate java.util.ArrayList<TypeAnnotationData>visibleTypeAnnotationsThe visible type annotations for this method
-
Constructor Summary
Constructors Constructor Description CodeData(MethodData meth)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static intalign(int n)private intcheckForLabelRef(int pc)protected iAttget_iAtt(int pc)private intgetbyte(int pc)private intgetInt(int pc)private intgetShort(int pc)private intgetUbyte(int pc)private intgetUShort(int pc)private voidloadLabelTable()private voidloadLineNumTable()private voidloadLocVarTable()private voidloadStackMap()private voidloadTrapTable()voidprint()printprivate voidPrintCommentedConstant(int cpx)private voidPrintConstant(int cpx)private intprintInstr(int pc)voidread(java.io.DataInputStream in, int codeattrlen)readprivate voidreadLineNumTable(java.io.DataInputStream in)private voidreadLocVarTable(java.io.DataInputStream in)private voidreadStackMap(java.io.DataInputStream in)private voidreadStackMapTable(java.io.DataInputStream in)private voidreadTrapTable(java.io.DataInputStream in)private voidreadTypeAnnotations(java.io.DataInputStream in, boolean isInvisible)-
Methods inherited from class org.openjdk.asmtools.jdis.Indenter
decreaseIndent, getIndentString, increaseIndent, indent, setIndent
-
-
-
-
Field Detail
-
code
protected byte[] code
Raw byte array for the byte codes
-
max_stack
protected int max_stack
Limit for the stack size
-
max_locals
protected int max_locals
Limit for the number of local vars
-
attrs
protected java.util.ArrayList<AttrData> attrs
The remaining attributes of this class
-
cls
protected ClassData cls
-
meth
protected MethodData meth
-
trap_table
private java.util.ArrayList<TrapData> trap_table
(parsed) Trap table, describes exceptions caught
-
lin_num_tb
private java.util.ArrayList<CodeData.LineNumData> lin_num_tb
(parsed) Line Number table, describes source lines associated with ByteCode indexes
-
loc_var_tb
private java.util.ArrayList<CodeData.LocVarData> loc_var_tb
(parsed) Local Variable table, describes variable scopes associated with ByteCode indexes
-
stack_map
private java.util.ArrayList<StackMapData> stack_map
(parsed) stack map table, describes compiler hints for stack rep, associated with ByteCode indexes
-
visibleTypeAnnotations
private java.util.ArrayList<TypeAnnotationData> visibleTypeAnnotations
The visible type annotations for this method
-
invisibleTypeAnnotations
private java.util.ArrayList<TypeAnnotationData> invisibleTypeAnnotations
The invisible type annotations for this method
-
iattrs
private java.util.HashMap<java.lang.Integer,iAtt> iattrs
(parsed) reversed bytecode index hash, associates labels with ByteCode indexes
-
out
private java.io.PrintWriter out
-
-
Constructor Detail
-
CodeData
public CodeData(MethodData meth)
-
-
Method Detail
-
align
private static int align(int n)
-
getbyte
private int getbyte(int pc)
-
getUbyte
private int getUbyte(int pc)
-
getShort
private int getShort(int pc)
-
getUShort
private int getUShort(int pc)
-
getInt
private int getInt(int pc)
-
get_iAtt
protected iAtt get_iAtt(int pc)
-
readLineNumTable
private void readLineNumTable(java.io.DataInputStream in) throws java.io.IOException- Throws:
java.io.IOException
-
readLocVarTable
private void readLocVarTable(java.io.DataInputStream in) throws java.io.IOException- Throws:
java.io.IOException
-
readTrapTable
private void readTrapTable(java.io.DataInputStream in) throws java.io.IOException- Throws:
java.io.IOException
-
readStackMap
private void readStackMap(java.io.DataInputStream in) throws java.io.IOException- Throws:
java.io.IOException
-
readStackMapTable
private void readStackMapTable(java.io.DataInputStream in) throws java.io.IOException- Throws:
java.io.IOException
-
readTypeAnnotations
private void readTypeAnnotations(java.io.DataInputStream in, boolean isInvisible) throws java.io.IOException- Throws:
java.io.IOException
-
read
public void read(java.io.DataInputStream in, int codeattrlen) throws java.io.IOExceptionreadread and resolve the code attribute data called from MethodData. precondition: NumFields has already been read from the stream.
- Throws:
java.io.IOException
-
checkForLabelRef
private int checkForLabelRef(int pc)
-
loadLabelTable
private void loadLabelTable()
-
loadLineNumTable
private void loadLineNumTable()
-
loadStackMap
private void loadStackMap()
-
loadLocVarTable
private void loadLocVarTable()
-
loadTrapTable
private void loadTrapTable()
-
PrintConstant
private void PrintConstant(int cpx)
-
PrintCommentedConstant
private void PrintCommentedConstant(int cpx)
-
printInstr
private int printInstr(int pc)
-
print
public void print() throws java.io.IOExceptionprintprints the code data to the current output stream. called from MethodData.
- Throws:
java.io.IOException
-
-