Package proguard.classfile.editor
Class PeepholeEditor
java.lang.Object
proguard.classfile.editor.PeepholeEditor
- All Implemented Interfaces:
AttributeVisitor
This
AttributeVisitor lets a given instruction visitor edit the code attributes that it
visits. The instruction visitor can use a given (optional) branch target finder and code
attribute editor, which this class sets up and applies, for convenience.-
Constructor Summary
ConstructorsConstructorDescriptionPeepholeEditor(CodeAttributeEditor codeAttributeEditor, InstructionVisitor instructionVisitor) Creates a new PeepholeEditor.PeepholeEditor(BranchTargetFinder branchTargetFinder, CodeAttributeEditor codeAttributeEditor, InstructionVisitor instructionVisitor) Creates a new PeepholeEditor. -
Method Summary
Modifier and TypeMethodDescriptionvoidvisitAnyAttribute(Clazz clazz, Attribute attribute) Visits any Attribute instance.voidvisitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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
-
Constructor Details
-
PeepholeEditor
public PeepholeEditor(CodeAttributeEditor codeAttributeEditor, InstructionVisitor instructionVisitor) Creates a new PeepholeEditor.- Parameters:
codeAttributeEditor- the code attribute editor that will be reset and then executed.instructionVisitor- the instruction visitor that performs peephole optimizations using the above code attribute editor.
-
PeepholeEditor
public PeepholeEditor(BranchTargetFinder branchTargetFinder, CodeAttributeEditor codeAttributeEditor, InstructionVisitor instructionVisitor) Creates a new PeepholeEditor.- Parameters:
branchTargetFinder- branch target finder that will be initialized to indicate branch targets in the visited code.codeAttributeEditor- the code attribute editor that will be reset and then executed.instructionVisitor- the instruction visitor that performs peephole optimizations using the above code attribute editor.
-
-
Method Details
-
visitAnyAttribute
Description copied from interface:AttributeVisitorVisits any Attribute instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyAttributein interfaceAttributeVisitor
-
visitCodeAttribute
- Specified by:
visitCodeAttributein interfaceAttributeVisitor
-