类 InstructionUsageMarker
- java.lang.Object
-
- proguard.optimize.evaluation.InstructionUsageMarker
-
- 所有已实现的接口:
proguard.classfile.attribute.visitor.AttributeVisitor
public class InstructionUsageMarker extends java.lang.Object implements proguard.classfile.attribute.visitor.AttributeVisitorThis AttributeVisitor marks necessary instructions in the code attributes that it visits, based on partial evaluation.
-
-
构造器概要
构造器 构造器 说明 InstructionUsageMarker(boolean markExternalSideEffects)Creates a new InstructionUsageMarker.InstructionUsageMarker(proguard.evaluation.PartialEvaluator partialEvaluator, boolean runPartialEvaluator, boolean markExternalSideEffects)Creates a new InstructionUsageMarker.InstructionUsageMarker(proguard.evaluation.PartialEvaluator partialEvaluator, boolean runPartialEvaluator, boolean ensureSafetyForVerifier, boolean markExternalSideEffects)Creates a new InstructionUsageMarker.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 proguard.evaluation.value.InstructionOffsetValuebranchTargets(int instructionOffset)Returns the instruction offsets to which the given instruction offset branches in the most recently analyzed code attribute.proguard.evaluation.TracedStackgetStackAfter(int instructionOffset)Returns the stack after execution of the instruction at the given offset.proguard.evaluation.TracedStackgetStackBefore(int instructionOffset)Returns the stack before execution of the instruction at the given offset.booleanisAnyStackEntryNecessaryAfter(proguard.evaluation.value.InstructionOffsetValue instructionOffsets, int stackIndex)Returns whether any of the stack entries after the given offsets are necessary.booleanisExtraPushPopInstructionNecessary(int instructionOffset)Returns whether an extra push/pop instruction is required at the given offset in the most recently analyzed code attribute.booleanisInstructionNecessary(int instructionOffset)Returns whether the specified instruction is necessary in the most recently analyzed code attribute.booleanisStackEntriesNecessaryAfter(int instructionOffset, int stackIndex1, int stackIndex2)Returns whether the stack specified entries after the given offset are necessary.booleanisStackEntriesPresentBefore(int instructionOffset, int stackIndex1, int stackIndex2)Returns whether the stack specified entries before the given offset are present.booleanisStackEntryNecessaryAfter(int instructionOffset, int stackIndex)Returns whether the specified stack entry after the given offset is necessary.booleanisStackEntryPresentBefore(int instructionOffset, int stackIndex)Returns whether the specified stack entry before the given offset is present.booleanisStackEntryUnwantedBefore(int instructionOffset, int stackIndex)Returns whether the specified stack entry before the given offset is unwanted, e.g. because it was intended as a method parameter that has been removed.booleanisTraced(int instructionOffset)Returns whether the specified instruction was traced in the most recently analyzed code attribute.proguard.classfile.instruction.visitor.InstructionVisitornecessaryInstructionFilter(boolean necessary, proguard.classfile.instruction.visitor.InstructionVisitor instructionVisitor)Returns a filtering version of the given instruction visitor that only visits necessary or unnecessary instructions.proguard.classfile.instruction.visitor.InstructionVisitornecessaryInstructionFilter(proguard.classfile.instruction.visitor.InstructionVisitor instructionVisitor)Returns a filtering version of the given instruction visitor that only visits necessary instructions.proguard.classfile.instruction.visitor.InstructionVisitortracedInstructionFilter(boolean traced, proguard.classfile.instruction.visitor.InstructionVisitor instructionVisitor)Returns a filtering version of the given instruction visitor that only visits traced or untraced instructions.proguard.classfile.instruction.visitor.InstructionVisitortracedInstructionFilter(proguard.classfile.instruction.visitor.InstructionVisitor instructionVisitor)Returns a filtering version of the given instruction visitor that only visits traced instructions.voidvisitAnyAttribute(proguard.classfile.Clazz clazz, proguard.classfile.attribute.Attribute attribute)voidvisitCodeAttribute(proguard.classfile.Clazz clazz, proguard.classfile.Method method, proguard.classfile.attribute.CodeAttribute codeAttribute)voidvisitCodeAttribute0(proguard.classfile.Clazz clazz, proguard.classfile.Method method, proguard.classfile.attribute.CodeAttribute codeAttribute)-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 proguard.classfile.attribute.visitor.AttributeVisitor
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
-
-
-
-
构造器详细资料
-
InstructionUsageMarker
public InstructionUsageMarker(boolean markExternalSideEffects)
Creates a new InstructionUsageMarker.- 参数:
markExternalSideEffects- specifies whether instructions with external side effects should be marked
-
InstructionUsageMarker
public InstructionUsageMarker(proguard.evaluation.PartialEvaluator partialEvaluator, boolean runPartialEvaluator, boolean markExternalSideEffects)Creates a new InstructionUsageMarker.- 参数:
partialEvaluator- the evaluator to be used for the analysis.runPartialEvaluator- specifies whether to run this evaluator on every code attribute that is visited.markExternalSideEffects- specifies whether instructions with external side effects should be marked
-
InstructionUsageMarker
public InstructionUsageMarker(proguard.evaluation.PartialEvaluator partialEvaluator, boolean runPartialEvaluator, boolean ensureSafetyForVerifier, boolean markExternalSideEffects)Creates a new InstructionUsageMarker.- 参数:
partialEvaluator- the evaluator to be used for the analysis.runPartialEvaluator- specifies whether to run this evaluator on every code attribute that is visited.ensureSafetyForVerifier- some instructions are not necessary for code correctness but are necessary for the java verifier. This flag determines whether these instructions are visited (default: true).markExternalSideEffects- specifies whether instructions with external side effects should be marked
-
-
方法详细资料
-
isTraced
public boolean isTraced(int instructionOffset)
Returns whether the specified instruction was traced in the most recently analyzed code attribute.
-
tracedInstructionFilter
public proguard.classfile.instruction.visitor.InstructionVisitor tracedInstructionFilter(proguard.classfile.instruction.visitor.InstructionVisitor instructionVisitor)
Returns a filtering version of the given instruction visitor that only visits traced instructions.
-
tracedInstructionFilter
public proguard.classfile.instruction.visitor.InstructionVisitor tracedInstructionFilter(boolean traced, proguard.classfile.instruction.visitor.InstructionVisitor instructionVisitor)Returns a filtering version of the given instruction visitor that only visits traced or untraced instructions.
-
isInstructionNecessary
public boolean isInstructionNecessary(int instructionOffset)
Returns whether the specified instruction is necessary in the most recently analyzed code attribute.
-
isExtraPushPopInstructionNecessary
public boolean isExtraPushPopInstructionNecessary(int instructionOffset)
Returns whether an extra push/pop instruction is required at the given offset in the most recently analyzed code attribute.
-
necessaryInstructionFilter
public proguard.classfile.instruction.visitor.InstructionVisitor necessaryInstructionFilter(proguard.classfile.instruction.visitor.InstructionVisitor instructionVisitor)
Returns a filtering version of the given instruction visitor that only visits necessary instructions.
-
necessaryInstructionFilter
public proguard.classfile.instruction.visitor.InstructionVisitor necessaryInstructionFilter(boolean necessary, proguard.classfile.instruction.visitor.InstructionVisitor instructionVisitor)Returns a filtering version of the given instruction visitor that only visits necessary or unnecessary instructions.
-
getStackBefore
public proguard.evaluation.TracedStack getStackBefore(int instructionOffset)
Returns the stack before execution of the instruction at the given offset.
-
getStackAfter
public proguard.evaluation.TracedStack getStackAfter(int instructionOffset)
Returns the stack after execution of the instruction at the given offset.
-
isStackEntryUnwantedBefore
public boolean isStackEntryUnwantedBefore(int instructionOffset, int stackIndex)Returns whether the specified stack entry before the given offset is unwanted, e.g. because it was intended as a method parameter that has been removed.
-
isStackEntriesPresentBefore
public boolean isStackEntriesPresentBefore(int instructionOffset, int stackIndex1, int stackIndex2)Returns whether the stack specified entries before the given offset are present.
-
isStackEntryPresentBefore
public boolean isStackEntryPresentBefore(int instructionOffset, int stackIndex)Returns whether the specified stack entry before the given offset is present.- 参数:
instructionOffset- the offset of the stack entry to be checked.stackIndex- the index of the stack entry to be checked (counting from the bottom).
-
isStackEntriesNecessaryAfter
public boolean isStackEntriesNecessaryAfter(int instructionOffset, int stackIndex1, int stackIndex2)Returns whether the stack specified entries after the given offset are necessary.
-
isAnyStackEntryNecessaryAfter
public boolean isAnyStackEntryNecessaryAfter(proguard.evaluation.value.InstructionOffsetValue instructionOffsets, int stackIndex)Returns whether any of the stack entries after the given offsets are necessary.- 参数:
instructionOffsets- the offsets of the stack entries to be checked.stackIndex- the index of the stack entries to be checked (counting from the bottom).
-
isStackEntryNecessaryAfter
public boolean isStackEntryNecessaryAfter(int instructionOffset, int stackIndex)Returns whether the specified stack entry after the given offset is necessary.- 参数:
instructionOffset- the offset of the stack entry to be checked.stackIndex- the index of the stack entry to be checked (counting from the bottom).
-
branchTargets
public proguard.evaluation.value.InstructionOffsetValue branchTargets(int instructionOffset)
Returns the instruction offsets to which the given instruction offset branches in the most recently analyzed code attribute.
-
visitAnyAttribute
public void visitAnyAttribute(proguard.classfile.Clazz clazz, proguard.classfile.attribute.Attribute attribute)- 指定者:
visitAnyAttribute在接口中proguard.classfile.attribute.visitor.AttributeVisitor
-
visitCodeAttribute
public void visitCodeAttribute(proguard.classfile.Clazz clazz, proguard.classfile.Method method, proguard.classfile.attribute.CodeAttribute codeAttribute)- 指定者:
visitCodeAttribute在接口中proguard.classfile.attribute.visitor.AttributeVisitor
-
visitCodeAttribute0
public void visitCodeAttribute0(proguard.classfile.Clazz clazz, proguard.classfile.Method method, proguard.classfile.attribute.CodeAttribute codeAttribute)
-
-