public class InitializationFinder extends java.lang.Object implements AttributeVisitor, InstructionVisitor
AttributeVisitor
links 'new' instructions and their corresponding initializers in
the CodeAttribute
instances that it visits.Modifier and Type | Field and Description |
---|---|
static int |
NONE |
Constructor and Description |
---|
InitializationFinder()
Creates a new InitializationFinder.
|
InitializationFinder(PartialEvaluator partialEvaluator,
boolean runPartialEvaluator)
Creates a new InitializationFinder that will use the given partial evaluator.
|
Modifier and Type | Method and Description |
---|---|
int |
creationOffset(int initializationOffset)
Returns the 'new' instruction offset at which the object instance is created that is
initialized at the given offset.
|
boolean |
isInitializedBefore(int offset,
InstructionOffsetValue creationOffsetValue)
Returns whether the given creation offset is initialized before the given offset.
|
boolean |
isInitializedBefore(int offset,
int stackEntryIndexBottom)
Returns whether the specified stack entry is initialized.
|
boolean |
isInitializer()
Returns whether the method is an instance initializer, in the CodeAttribute that was visited
most recently.
|
boolean |
isInitializer(int offset)
Returns whether the instruction at the given offset is the special invocation of an instance
initializer.
|
boolean |
isTopInitializedBefore(int offset,
int stackEntryIndexTop)
Returns whether the specified stack entry is initialized.
|
int |
superInitializationOffset()
Returns the instruction offset at which this initializer is calling the "super" or "this"
initializer method, or
NONE if it is not an initializer. |
void |
visitAnyAttribute(Clazz clazz,
Attribute attribute)
Visits any Attribute instance.
|
void |
visitCodeAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
visitAnnotationDefaultAttribute, visitAnyAnnotationsAttribute, visitAnyParameterAnnotationsAttribute, visitAnyTypeAnnotationsAttribute, visitBootstrapMethodsAttribute, visitConstantValueAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitEnclosingMethodAttribute, visitExceptionsAttribute, visitInnerClassesAttribute, visitLineNumberTableAttribute, visitLocalVariableTableAttribute, visitLocalVariableTypeTableAttribute, visitMethodParametersAttribute, visitModuleAttribute, visitModuleMainClassAttribute, visitModulePackagesAttribute, visitNestHostAttribute, visitNestMembersAttribute, visitPermittedSubclassesAttribute, visitRecordAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleParameterAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleParameterAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSourceDebugExtensionAttribute, visitSourceDirAttribute, visitSourceFileAttribute, visitStackMapAttribute, visitStackMapTableAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitUnknownAttribute
visitAnyInstruction, visitAnySwitchInstruction, visitBranchInstruction, visitConstantInstruction, visitLookUpSwitchInstruction, visitSimpleInstruction, visitTableSwitchInstruction, visitVariableInstruction
public static final int NONE
public InitializationFinder()
public InitializationFinder(PartialEvaluator partialEvaluator, boolean runPartialEvaluator)
partialEvaluator
- the evaluator to be used for the analysis.runPartialEvaluator
- specifies whether to run this evaluator on every code attribute that
is visited.public boolean isInitializer()
public int superInitializationOffset()
NONE
if it is not an initializer.public int creationOffset(int initializationOffset)
public boolean isInitializedBefore(int offset, int stackEntryIndexBottom)
public boolean isTopInitializedBefore(int offset, int stackEntryIndexTop)
public boolean isInitializedBefore(int offset, InstructionOffsetValue creationOffsetValue)
public boolean isInitializer(int offset)
public void visitAnyAttribute(Clazz clazz, Attribute attribute)
AttributeVisitor
visitAnyAttribute
in interface AttributeVisitor
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
visitCodeAttribute
in interface AttributeVisitor