Package org.openjdk.asmtools.jdis
Class CodeData
- All Implemented Interfaces:
Printable
Code data for a code attribute in method members in a class of the Java Disassembler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
static class
Nested classes/interfaces inherited from class org.openjdk.asmtools.jdis.MemberData
MemberData.AnnotationElementState
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]
private final HashMap<Integer,
InstructionAttr> (parsed) reversed bytecode index hash, associates labels with ByteCode indexesprivate ArrayList<TypeAnnotationData<MethodData>>
The invisible type annotations for this methodprivate ArrayList<CodeData.LineNumData>
(parsed) Line Number table, describes source lines associated with ByteCode indexesprivate ArrayList<CodeData.LocVarData>
(parsed) Local Variable table, describes variable scopes associated with ByteCode indexesprotected int
protected int
private ArrayList<StackMapData>
(parsed) stack map table, describes compiler hints for stack rep, associated with ByteCode indexesprivate ArrayList<TypeAnnotationData<MethodData>>
The visible type annotations for this methodFields inherited from class org.openjdk.asmtools.jdis.MemberData
access, attributes, data, DEFAULT_VALUE_PREFIX, environment, invisibleAnnotations, isDeprecated, isSynthetic, memberType, pool, signature, visibleAnnotations
Fields inherited from class org.openjdk.asmtools.jdis.Indenter
ARGUMENT_DELIMITER, COMMENT_OFFSET, COMMENT_PADDING, INDENT_OFFSET, INDENT_STEP, INDENT_STRING, INSTR_PREFIX_LENGTH, LINE_SPLITTER, OPERAND_PLACEHOLDER_LENGTH, printConstantPool, printCPIndex, printHEX, printLabelAsIdentifiers, printLineTable, printLocalVars, printProgramCounter, printSourceLines, PROGRAM_COUNTER_PLACEHOLDER_LENGTH, skipComments, STACKMAP_TYPE_PLACEHOLDER_LENGTH, toolOutput
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
align
(int n) private int
checkForLabelRef
(int pc) private String
formatOperandLine
(String str, int offset, String prefix, List<Integer> breakPositions) Formats invokedynamic/ldc dynamic operand lineprivate int
getByte
(int pc) protected InstructionAttr
getInstructionAttribute
(int pc) private int
getInt
(int pc) getLookupswitchPairs
(int pad, int count) private int
getShort
(int pc) private int
getUByte
(int pc) private int
getUShort
(int pc) private void
private void
private void
private void
private void
void
print()
Prints the code data to the current output stream.private int
printInstrLn
(int pc, int shift) void
read
(DataInputStream in, int codeAttrLength) Read and resolve the code attribute data called from MethodData.private void
private void
private void
private void
private void
readTypeAnnotations
(DataInputStream in, boolean isInvisible) Methods inherited from class org.openjdk.asmtools.jdis.MemberData
getAnnotationElementState, getAnnotationsCount, getConstantPool, getPseudoFlagsAsString, handleAttributes, init, printAnnotations, printVar, readAttributes, setElementState
Methods inherited from class org.openjdk.asmtools.jdis.Indenter
decIndent, enlargedIndent, enlargedIndent, getCommentOffset, getIndentSize, getIndentStep, getIndentString, getOffset, incIndent, Indent, IndentPadLeft, IndentPadRight, initIndent, nCopies, padLeft, PadLeft, padRight, PadRight, print, print, printIndent, printIndent, printIndent, printIndentLn, printIndentLn, printIndentLn, printIndentPadRight, println, println, println, println, printPadLeft, printPadRight, resetIndent, setCommentOffset, setOffset, setTheSame
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.openjdk.asmtools.jdis.Printable
isPrintable
-
Field Details
-
instructionAttrs
(parsed) reversed bytecode index hash, associates labels with ByteCode indexes -
code
protected byte[] code -
max_stack
protected int max_stack -
max_locals
protected int max_locals -
attrs
-
trap_table
-
lin_num_tb
(parsed) Line Number table, describes source lines associated with ByteCode indexes -
loc_var_tb
(parsed) Local Variable table, describes variable scopes associated with ByteCode indexes -
stack_map
(parsed) stack map table, describes compiler hints for stack rep, associated with ByteCode indexes -
visibleTypeAnnotations
The visible type annotations for this method -
invisibleTypeAnnotations
The invisible type annotations for this method
-
-
Constructor Details
-
CodeData
-
-
Method Details
-
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) -
getInstructionAttribute
-
readLineNumTable
- Throws:
IOException
-
readLocVarTable
- Throws:
IOException
-
readTrapTable
- Throws:
IOException
-
readStackMapEntity
private void readStackMapEntity(StackMapData.EAttributeType type, DataInputStream in) throws IOException - Throws:
IOException
-
readTypeAnnotations
- Throws:
IOException
-
read
Read and resolve the code attribute data called from MethodData. precondition: NumFields has already been read from the stream.- Throws:
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() -
printInstrLn
private int printInstrLn(int pc, int shift) -
getLookupswitchPairs
-
formatOperandLine
private String formatOperandLine(String str, int offset, String prefix, List<Integer> breakPositions) Formats invokedynamic/ldc dynamic operand line- Parameters:
str
- non-formatted operand lineoffset
- indent for new linesprefix
- prefix placed upfront new linesbreakPositions
- numbers where after ":" a lineSeparator is added to wrap a very long operand lines- Returns:
- formatted operand line
-
print
Prints the code data to the current output stream. called from MethodData.- Specified by:
print
in interfacePrintable
- Overrides:
print
in classIndenter
- Throws:
IOException
-
getEnvironment
-