Class Op04StructuredStatement
java.lang.Object
org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement
- All Implemented Interfaces:
Graph<Op04StructuredStatement>, MutableGraph<Op04StructuredStatement>, StatementContainer<StructuredStatement>, Dumpable, TypeUsageCollectable
public class Op04StructuredStatement
extends Object
implements MutableGraph<Op04StructuredStatement>, Dumpable, StatementContainer<StructuredStatement>, TypeUsageCollectable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Set<BlockIdentifier> private static final Set<BlockIdentifier> private InstrIndexprivate static final Loggerprivate List<Op04StructuredStatement> private StructuredStatementprivate List<Op04StructuredStatement> -
Constructor Summary
ConstructorsConstructorDescriptionOp04StructuredStatement(InstrIndex instrIndex, Collection<BlockIdentifier> blockMembership, StructuredStatement structuredStatement) Op04StructuredStatement(StructuredStatement justStatement) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSource(Op04StructuredStatement source) voidaddTarget(Op04StructuredStatement target) static voidapplyChecker(Op04Checker checker, Op04StructuredStatement root, DecompilerComments comments) private static voidapplyLValueReplacer(Map<LValue, LValue> replacements, Op04StructuredStatement root) static voidapplyTypeAnnotations(AttributeCode code, Op04StructuredStatement root, SortedMap<Integer, Integer> instrsByOffset, DecompilerComments comments) private static Set<BlockIdentifier> (package private) static Op04StructuredStatementbuildNestedBlocks(List<Op04StructuredStatement> containers) static booleancheckTypeClashes(Op04StructuredStatement block, BytecodeMeta bytecodeMeta) private booleanclaimBlock(Op04StructuredStatement innerBlock, BlockIdentifier thisBlock, Vector<BlockIdentifier> currentlyIn) voidcollectTypeUsages(TypeUsageCollector collector) static voidvoidvoidstatic voiddiscoverLocalClassScopes(Method method, Op04StructuredStatement root, VariableFactory variableFactory, Options options) static voiddiscoverVariableScopes(Method method, Op04StructuredStatement root, VariableFactory variableFactory, Options options, ClassFileVersion classFileVersion, BytecodeMeta bytecodeMeta) static FieldVariablefindInnerClassOuterThis(Method method, Op04StructuredStatement root) static voidfixInnerClassConstructorSyntheticOuterArgs(ClassFile classFile, Method method, Op04StructuredStatement root, Set<MethodPrototype> processed) static voidprivate static Set<BlockIdentifier> getEndingBlocks(Stack<BlockIdentifier> wasIn, Set<BlockIdentifier> nowIn) getIndex()private static StringgetInnerClassOuterArgName(Method method, LValue lValueArg) getLabel()private static BlockIdentifiergetStartingBlocks(Stack<BlockIdentifier> wasIn, Set<BlockIdentifier> nowIn) getTargetLabel(int idx) getTargetStatement(int idx) private booleanprivate static voidhideField(Op04StructuredStatement root, MethodPrototype prototype, ClassFile classFile, int x, LocalVariable protoVar, LValue lValueArg, String overrideName) voidinformBlockMembership(Vector<BlockIdentifier> currentlyIn) static voidstatic voidinlineSyntheticAccessors(DCCommonState state, Method method, Op04StructuredStatement root) static voidbooleanbooleanstatic booleanvoidstatic voidmiscKeyholeTransforms(VariableFactory variableFactory, Op04StructuredStatement root) voidnopOut()voidstatic voidnormalizeInstanceOf(Op04StructuredStatement root, Options options, ClassFileVersion classFileVersion) static voidprivate static voidprocessEndingBlocks(Set<BlockIdentifier> endOfTheseBlocks, Stack<BlockIdentifier> blocksCurrentlyIn, Stack<Op04StructuredStatement.StackedBlock> stackedBlocks, Op04StructuredStatement.MutableProcessingBlockState mutableProcessingBlockState) static voidreduceClashDeclarations(Op04StructuredStatement root, BytecodeMeta bytecodeMeta) private static voidremoveAnonymousSyntheticConstructorOuterArgs(Method method, Op04StructuredStatement root, boolean isInstance) static voidstatic voidremoveEndResource(ClassFile classFile, Op04StructuredStatement root) static voidremoveInnerClassOuterThis(Method method, Op04StructuredStatement root) voidvoidprivate static voidremoveMethodScopedSyntheticConstructorOuterArgs(Method method, Op04StructuredStatement root, Set<MethodPrototype> processed) static voidstatic voidstatic voidstatic voidremovePrimitiveDeconversion(Options options, Method method, Op04StructuredStatement root) static voidstatic voidstatic voidremoveUnnecessaryVarargArrays(Options options, Method method, Op04StructuredStatement root) private voidstatic voidreplaceInSources(Op04StructuredStatement original, Op04StructuredStatement replacement) static voidreplaceInTargets(Op04StructuredStatement original, Op04StructuredStatement replacement) static voidvoidvoidreplaceStatement(StructuredStatement newTarget) voidreplaceStatementWithNOP(String comment) voidstatic voidrewriteBadCastChains(Options options, Method method, Op04StructuredStatement root) static voidrewriteExplicitTypeUsages(Method method, Op04StructuredStatement block, AnonymousClassUsage anonymousClassUsage, ClassFile classFile) static voidrewriteLambdas(DCCommonState state, Method method, Op04StructuredStatement root) static voidrewriteNarrowingAssignments(Options options, Method method, Op04StructuredStatement root) voidsetSources(List<Op04StructuredStatement> sources) voidsetTargets(List<Op04StructuredStatement> targets) static voidswitchExpression(Method method, Op04StructuredStatement root, DecompilerComments comments) static voidstatic voidstatic voidstatic voidtidyObfuscation(Options options, Op04StructuredStatement root) static voidstatic voidstatic voidtidyVariableNames(Method method, Op04StructuredStatement root, BytecodeMeta bytecodeMeta, DecompilerComments comments, ClassCache classCache) toString()voidtransform(StructuredStatementTransformer transformer, StructuredScope scope) private static StructuredStatementtransformStructuredGotoWithScope(StructuredScope scope, StructuredStatement stm, Stack<Triplet<StructuredStatement, BlockIdentifier, Set<Op04StructuredStatement>>> breaktargets)
-
Field Details
-
logger
-
instrIndex
-
sources
-
targets
-
structuredStatement
-
blockMembership
-
EMPTY_BLOCKSET
-
-
Constructor Details
-
Op04StructuredStatement
-
Op04StructuredStatement
public Op04StructuredStatement(InstrIndex instrIndex, Collection<BlockIdentifier> blockMembership, StructuredStatement structuredStatement)
-
-
Method Details
-
blockSet
-
rewriteExplicitTypeUsages
public static void rewriteExplicitTypeUsages(Method method, Op04StructuredStatement block, AnonymousClassUsage anonymousClassUsage, ClassFile classFile) -
flattenNonReferencedBlocks
-
switchExpression
public static void switchExpression(Method method, Op04StructuredStatement root, DecompilerComments comments) -
reduceClashDeclarations
-
normalizeInstanceOf
public static void normalizeInstanceOf(Op04StructuredStatement root, Options options, ClassFileVersion classFileVersion) -
nopThisAndReplace
-
nopOut
public void nopOut()- Specified by:
nopOutin interfaceStatementContainer<StructuredStatement>
-
getStatement
- Specified by:
getStatementin interfaceStatementContainer<StructuredStatement>
-
collectTypeUsages
- Specified by:
collectTypeUsagesin interfaceTypeUsageCollectable
-
getTargetStatement
- Specified by:
getTargetStatementin interfaceStatementContainer<StructuredStatement>
-
getLabel
- Specified by:
getLabelin interfaceStatementContainer<StructuredStatement>
-
getIndex
- Specified by:
getIndexin interfaceStatementContainer<StructuredStatement>
-
replaceStatement
- Specified by:
replaceStatementin interfaceStatementContainer<StructuredStatement>
-
nopOutConditional
public void nopOutConditional()- Specified by:
nopOutConditionalin interfaceStatementContainer<StructuredStatement>
-
getSSAIdentifiers
- Specified by:
getSSAIdentifiersin interfaceStatementContainer<StructuredStatement>
-
getBlockIdentifiers
- Specified by:
getBlockIdentifiersin interfaceStatementContainer<StructuredStatement>
-
getBlockStarted
- Specified by:
getBlockStartedin interfaceStatementContainer<StructuredStatement>
-
getBlocksEnded
- Specified by:
getBlocksEndedin interfaceStatementContainer<StructuredStatement>
-
copyBlockInformationFrom
- Specified by:
copyBlockInformationFromin interfaceStatementContainer<StructuredStatement>
-
copyBytecodeInformationFrom
- Specified by:
copyBytecodeInformationFromin interfaceStatementContainer<StructuredStatement>
-
hasUnstructuredSource
private boolean hasUnstructuredSource() -
getBlockMembership
-
dump
-
getSources
- Specified by:
getSourcesin interfaceGraph<Op04StructuredStatement>
-
getTargets
- Specified by:
getTargetsin interfaceGraph<Op04StructuredStatement>
-
addSource
- Specified by:
addSourcein interfaceMutableGraph<Op04StructuredStatement>
-
addTarget
- Specified by:
addTargetin interfaceMutableGraph<Op04StructuredStatement>
-
getTargetLabel
-
isEmptyInitialiser
public boolean isEmptyInitialiser() -
replaceAsSource
-
replaceTarget
-
replaceSource
-
setSources
-
setTargets
-
replaceInSources
public static void replaceInSources(Op04StructuredStatement original, Op04StructuredStatement replacement) -
replaceInTargets
public static void replaceInTargets(Op04StructuredStatement original, Op04StructuredStatement replacement) -
linearizeStatementsInto
-
removeLastContinue
-
removeLastGoto
public void removeLastGoto() -
removeLastEndWhile
-
informBlockMembership
-
toString
-
replaceStatementWithNOP
-
claimBlock
private boolean claimBlock(Op04StructuredStatement innerBlock, BlockIdentifier thisBlock, Vector<BlockIdentifier> currentlyIn) -
getEndingBlocks
private static Set<BlockIdentifier> getEndingBlocks(Stack<BlockIdentifier> wasIn, Set<BlockIdentifier> nowIn) -
getStartingBlocks
private static BlockIdentifier getStartingBlocks(Stack<BlockIdentifier> wasIn, Set<BlockIdentifier> nowIn) -
processEndingBlocks
private static void processEndingBlocks(Set<BlockIdentifier> endOfTheseBlocks, Stack<BlockIdentifier> blocksCurrentlyIn, Stack<Op04StructuredStatement.StackedBlock> stackedBlocks, Op04StructuredStatement.MutableProcessingBlockState mutableProcessingBlockState) -
isFullyStructured
public boolean isFullyStructured() -
buildNestedBlocks
-
transformStructuredGotoWithScope
private static StructuredStatement transformStructuredGotoWithScope(StructuredScope scope, StructuredStatement stm, Stack<Triplet<StructuredStatement, BlockIdentifier, Set<Op04StructuredStatement>>> breaktargets) -
transform
-
insertLabelledBlocks
-
tidyEmptyCatch
-
tidyTryCatch
-
inlinePossibles
-
convertUnstructuredIf
-
tidyVariableNames
public static void tidyVariableNames(Method method, Op04StructuredStatement root, BytecodeMeta bytecodeMeta, DecompilerComments comments, ClassCache classCache) -
applyTypeAnnotations
public static void applyTypeAnnotations(AttributeCode code, Op04StructuredStatement root, SortedMap<Integer, Integer> instrsByOffset, DecompilerComments comments) -
removePointlessReturn
-
removeEndResource
-
removePointlessControlFlow
-
tidyTypedBooleans
-
miscKeyholeTransforms
public static void miscKeyholeTransforms(VariableFactory variableFactory, Op04StructuredStatement root) -
tidyObfuscation
-
prettifyBadLoops
-
removeStructuredGotos
-
removeUnnecessaryLabelledBreaks
-
removePointlessBlocks
-
discoverVariableScopes
public static void discoverVariableScopes(Method method, Op04StructuredStatement root, VariableFactory variableFactory, Options options, ClassFileVersion classFileVersion, BytecodeMeta bytecodeMeta) -
discoverLocalClassScopes
public static void discoverLocalClassScopes(Method method, Op04StructuredStatement root, VariableFactory variableFactory, Options options) -
tidyInstanceMatches
-
checkTypeClashes
-
findInnerClassOuterThis
-
removeInnerClassOuterThis
-
removeMethodScopedSyntheticConstructorOuterArgs
private static void removeMethodScopedSyntheticConstructorOuterArgs(Method method, Op04StructuredStatement root, Set<MethodPrototype> processed) -
removeAnonymousSyntheticConstructorOuterArgs
private static void removeAnonymousSyntheticConstructorOuterArgs(Method method, Op04StructuredStatement root, boolean isInstance) -
getInnerClassOuterArgName
-
hideField
private static void hideField(Op04StructuredStatement root, MethodPrototype prototype, ClassFile classFile, int x, LocalVariable protoVar, LValue lValueArg, String overrideName) -
applyLValueReplacer
private static void applyLValueReplacer(Map<LValue, LValue> replacements, Op04StructuredStatement root) -
fixInnerClassConstructorSyntheticOuterArgs
public static void fixInnerClassConstructorSyntheticOuterArgs(ClassFile classFile, Method method, Op04StructuredStatement root, Set<MethodPrototype> processed) -
tidyAnonymousConstructors
-
inlineSyntheticAccessors
public static void inlineSyntheticAccessors(DCCommonState state, Method method, Op04StructuredStatement root) -
removeConstructorBoilerplate
-
rewriteLambdas
-
removeUnnecessaryVarargArrays
public static void removeUnnecessaryVarargArrays(Options options, Method method, Op04StructuredStatement root) -
removePrimitiveDeconversion
public static void removePrimitiveDeconversion(Options options, Method method, Op04StructuredStatement root) -
rewriteBadCastChains
public static void rewriteBadCastChains(Options options, Method method, Op04StructuredStatement root) -
rewriteNarrowingAssignments
public static void rewriteNarrowingAssignments(Options options, Method method, Op04StructuredStatement root) -
replaceNestedSyntheticOuterRefs
-
applyChecker
public static void applyChecker(Op04Checker checker, Op04StructuredStatement root, DecompilerComments comments) -
isTryWithResourceSynthetic
-