Package org.openjdk.asmtools.jasm
Class CodeAttr
java.lang.Object
org.openjdk.asmtools.jasm.AttrData
org.openjdk.asmtools.jasm.CodeAttr
- All Implemented Interfaces:
ConstantPoolDataVisitor
,DataWriter
4.7.3. The Code Attribute
Code_attribute { u2 attribute_name_index; u4 attribute_length; u2 max_stack; u2 max_locals; u4 code_length; u1 code[code_length]; u2 exception_table_length; { u2 start_pc; u2 end_pc; u2 handler_pc; u2 catch_type; } exception_table[exception_table_length]; u2 attributes_count; attribute_info attributes[attributes_count]; }
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
(package private) static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataVector<DataVectorAttr<? extends DataWriter>>
protected ClassData
protected StackMapData
protected int
protected JasmEnvironment
protected DataVector<ExceptionData>
protected DataVectorAttr<TypeAnnotationData>
protected HashMap<String,
CodeAttr.Label> protected Instr
protected int
protected DataVectorAttr<LineNumberData>
protected DataVectorAttr<LocVarData>
protected final List<LocVarData>
protected Indexer
protected Indexer
protected MethodData
protected DataVectorAttr<StackMapData>
protected HashMap<String,
CodeAttr.RangePC> private final LocVarData
protected DataVectorAttr<TypeAnnotationData>
protected Instr
-
Constructor Summary
ConstructorsConstructorDescriptionCodeAttr
(MethodData methodData, int paramCount, Indexer max_stack, Indexer max_locals) -
Method Summary
Modifier and TypeMethodDescriptionvoid
(package private) void
addInstr
(int mnenoc_pos, OpcodeTables.Opcode opcode, Indexer arg, Object arg2) int
(package private) void
(package private) void
(package private) void
(package private) void
(package private) void
endCode()
(package private) void
(package private) CodeAttr.Label
void
LocVarDataDef
(int position, int index, ConstCell<?> nameCell, ConstCell<?> descriptorCell) Constructs the local variable nameCell:descriptorCell assigned to the slot index.void
LocVarDataEnd
(short slot, int position) Marks the end of Local Variable presented in the form endVar index: locVarSlots[slot] = VACANT and sets the Length of the Local Var(package private) CodeAttr.RangePC
(package private) void
trapHandler
(int pos, String name, Indexer type) void
Methods inherited from class org.openjdk.asmtools.jasm.AttrData
classifyConstCell, getLength, visit
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.jasm.ConstantPoolDataVisitor
visitConstCell, visitData
-
Field Details
-
locVarSlots
-
VACANT
-
classData
-
methodData
-
environment
-
max_stack
-
max_locals
-
zeroInstr
-
lastInstr
-
curPC
protected int curPC -
exceptionTable
-
lineNumberTable
-
lastLineNumber
protected int lastLineNumber -
localVariableTable
-
attributes
-
labelsHash
-
trapsHash
-
curMapEntry
-
stackMap
-
visTypeAnnotations
-
inVisTypeAnnotations
-
-
Constructor Details
-
CodeAttr
-
-
Method Details
-
endCode
void endCode() -
addAnnotations
-
trapDecl
-
beginTrap
-
endTrap
-
trapHandler
-
checkTraps
void checkTraps() -
labelDecl
-
LabelDef
-
LabelRef
-
checkLabels
void checkLabels() -
LocVarDataDef
public void LocVarDataDef(int position, int index, ConstCell<?> nameCell, ConstCell<?> descriptorCell) Constructs the local variable nameCell:descriptorCell assigned to the slot index.- Parameters:
position
- scanners' position to navigate where a syntax error happened if anyindex
- a valid index into the local variable array of the current framenameCell
- valid unqualified name denoting a local variabledescriptorCell
- a field descriptor which encodes a type of local variable in the source program
-
LocVarDataEnd
public void LocVarDataEnd(short slot, int position) Marks the end of Local Variable presented in the form endVar index: locVarSlots[slot] = VACANT and sets the Length of the Local Var- Parameters:
position
- the position of the scannerslot
- The value of the index item is a valid index into the local variable array of the current frame.
-
checkLocVars
void checkLocVars() -
getStackMap
-
addInstr
-
attrLength
public int attrLength()- Overrides:
attrLength
in classAttrData
-
write
- Specified by:
write
in interfaceDataWriter
- Overrides:
write
in classAttrData
- Throws:
IOException
Parser.CompilerError
-