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) class
CodeData.LineNumData
static class
CodeData.LocVarData
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<AttrData>
attrs
The remaining attributes of this classprotected ClassData
cls
protected byte[]
code
Raw 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>
invisibleTypeAnnotations
The 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 int
max_locals
Limit for the number of local varsprotected int
max_stack
Limit for the stack sizeprotected MethodData
meth
private java.io.PrintWriter
out
private 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>
visibleTypeAnnotations
The 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 int
align(int n)
private int
checkForLabelRef(int pc)
protected iAtt
get_iAtt(int pc)
private int
getbyte(int pc)
private int
getInt(int pc)
private int
getShort(int pc)
private int
getUbyte(int pc)
private int
getUShort(int pc)
private void
loadLabelTable()
private void
loadLineNumTable()
private void
loadLocVarTable()
private void
loadStackMap()
private void
loadTrapTable()
void
print()
printprivate void
PrintCommentedConstant(int cpx)
private void
PrintConstant(int cpx)
private int
printInstr(int pc)
void
read(java.io.DataInputStream in, int codeattrlen)
readprivate void
readLineNumTable(java.io.DataInputStream in)
private void
readLocVarTable(java.io.DataInputStream in)
private void
readStackMap(java.io.DataInputStream in)
private void
readStackMapTable(java.io.DataInputStream in)
private void
readTrapTable(java.io.DataInputStream in)
private void
readTypeAnnotations(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.IOException
readread 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.IOException
printprints the code data to the current output stream. called from MethodData.
- Throws:
java.io.IOException
-
-