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 classstatic class(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataVector<DataVectorAttr<? extends DataWriter>> protected ClassDataprotected StackMapDataprotected intprotected JasmEnvironmentprotected DataVector<ExceptionData> protected DataVectorAttr<TypeAnnotationData> protected HashMap<String, CodeAttr.Label> protected Instrprotected intprotected DataVectorAttr<LineNumberData> protected DataVectorAttr<LocVarData> protected final List<LocVarData> protected Indexerprotected Indexerprotected MethodDataprotected DataVectorAttr<StackMapData> protected HashMap<String, CodeAttr.RangePC> private final LocVarDataprotected DataVectorAttr<TypeAnnotationData> protected Instr -
Constructor Summary
ConstructorsConstructorDescriptionCodeAttr(MethodData methodData, int paramCount, Indexer max_stack, Indexer max_locals) -
Method Summary
Modifier and TypeMethodDescriptionvoid(package private) voidaddInstr(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) voidendCode()(package private) void(package private) CodeAttr.LabelvoidLocVarDataDef(int position, int index, ConstCell<?> nameCell, ConstCell<?> descriptorCell) Constructs the local variable nameCell:descriptorCell assigned to the slot index.voidLocVarDataEnd(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) voidtrapHandler(int pos, String name, Indexer type) voidMethods inherited from class org.openjdk.asmtools.jasm.AttrData
classifyConstCell, getLength, visitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
slot- The value of the index item is a valid index into the local variable array of the current frame.position- the position of the scanner
-
checkLocVars
void checkLocVars() -
getStackMap
-
addInstr
-
attrLength
public int attrLength()- Overrides:
attrLengthin classAttrData
-
write
- Specified by:
writein interfaceDataWriter- Overrides:
writein classAttrData- Throws:
IOExceptionParser.CompilerError
-