Commit 493aa1c1 authored by Eric Bruneton's avatar Eric Bruneton

Merge branch 'improve-context'

parents 96cf4b21 f5f51321
......@@ -35,78 +35,111 @@ package org.objectweb.asm;
*/
class Context {
/** Prototypes of the attributes that must be parsed for this class. */
Attribute[] attrs;
/** Prototypes of the attributes that must be parsed in this class. */
Attribute[] attributePrototypes;
/** The {@link ClassReader} option flags for the parsing of this class. */
int flags;
/**
* The options used to parse this class. One or more of {@link ClassReader#SKIP_CODE}, {@link
* ClassReader#SKIP_DEBUG}, {@link ClassReader#SKIP_FRAMES}, {@link ClassReader#EXPAND_FRAMES} or
* {@link ClassReader#EXPAND_ASM_INSNS}.
*/
int parsingOptions;
/** The buffer used to read strings in the constant pool. */
char[] charBuffer;
/**
* The offsets, from the start of the class file structure, to the first byte of each element of
* the bootstrap_methods array (in the BootstrapMethod attribute).
*
* @see https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.23
*/
int[] bootstrapMethodOffsets;
/** The buffer used to read strings. */
char[] buffer;
// Information about the current method, i.e. the one read in the current (or latest) call
// to {@link ClassReader#readMethod()}.
/** The start index of each bootstrap method. */
int[] bootstrapMethods;
/** The access flags of the current method. */
int currentMethodAccess;
/** The access flags of the method currently being parsed. */
int access;
/** The name of the current method. */
String currentMethodName;
/** The name of the method currently being parsed. */
String name;
/** The descriptor of the current method. */
String currentMethodDesc;
/** The descriptor of the method currently being parsed. */
String desc;
/**
* The labels of the current method, indexed by bytecode offset (only bytecode offsets for which a
* label is needed have a non null associated Label).
*/
Label[] currentMethodLabels;
// Information about the current type annotation target, i.e. the one read in the current
// (or latest) call to {@link ClassReader#readAnnotationTarget()}.
/**
* The label objects, indexed by bytecode offset, of the method currently being parsed (only
* bytecode offsets for which a label is needed have a non null associated Label object).
* The target_type and target_info of the current type annotation target, encoded as described in
* {@link TypeReference}.
*/
Label[] labels;
int currentTypeAnnotationTarget;
/** The target of the type annotation currently being parsed. */
int typeRef;
/** The target_path of the current type annotation target. */
TypePath currentTypeAnnotationTargetPath;
/** The path of the type annotation currently being parsed. */
TypePath typePath;
/** The start of each local variable range in the current local variable annotation. */
Label[] currentLocalVariableAnnotationRangeStarts;
/** The offset of the latest stack map frame that has been parsed. */
int offset;
/** The end of each local variable range in the current local variable annotation. */
Label[] currentLocalVariableAnnotationRangeEnds;
/**
* The labels corresponding to the start of the local variable ranges in the local variable type
* annotation currently being parsed.
* The local variable index of each local variable range in the current local variable annotation.
*/
Label[] start;
int[] currentLocalVariableAnnotationRangeIndices;
// Information about the current stack map frame, i.e. the one read in the current (or latest)
// call to {@link ClassReader#readFrame()}.
/** The bytecode offset of the current stack map frame. */
int currentFrameOffset;
/**
* The labels corresponding to the end of the local variable ranges in the local variable type
* annotation currently being parsed.
* The type of the current stack map frame. One of {@link Opcodes.F_FULL}, {@link
* Opcodes.F_APPEND}, {@link Opcodes.F_CHOP}, {@link Opcodes.F_SAME} or {@link Opcodes.F_SAME1}.
*/
Label[] end;
int currentFrameType;
/**
* The local variable indices for each local variable range in the local variable type annotation
* currently being parsed.
* The number of local variable types in the current stack map frame. Each type is represented
* with a single array element (even long and double).
*/
int[] index;
/** The encoding of the latest stack map frame that has been parsed. */
int mode;
/** The number of locals in the latest stack map frame that has been parsed. */
int localCount;
int currentFrameLocalCount;
/**
* The number locals in the latest stack map frame that has been parsed, minus the number of
* locals in the previous frame.
* The delta number of local variable types in the current stack map frame (each type is
* represented with a single array element - even long and double). This is the number of local
* variable types in this frame, minus the number of local variable types in the previous frame.
*/
int localDiff;
int currentFrameLocalCountDelta;
/** The local values of the latest stack map frame that has been parsed. */
Object[] local;
/**
* The types of the local variables in the current stack map frame. Each type is represented with
* a single array element (even long and double), using the format described in {@link
* MethodVisitor#visitFrame()}. Depending on {@link #currentFrameType}, this contains the types of
* all the local variables, or only those of the additional ones (compared to the previous frame).
*/
Object[] currentFrameLocalTypes;
/** The stack size of the latest stack map frame that has been parsed. */
int stackCount;
/**
* The number stack element types in the current stack map frame. Each type is represented with a
* single array element (even long and double).
*/
int currentFrameStackCount;
/** The stack values of the latest stack map frame that has been parsed. */
Object[] stack;
/**
* The types of the stack elements in the current stack map frame. Each type is represented with a
* single array element (even long and double), using the format described in {@link
* MethodVisitor#visitFrame()}.
*/
Object[] currentFrameStackTypes;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment