Class LoopIdentifier
- java.lang.Object
-
- org.benf.cfr.reader.bytecode.analysis.opgraph.op3rewriters.LoopIdentifier
-
public class LoopIdentifier extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
LoopIdentifier.LoopResult
-
Constructor Summary
Constructors Constructor Description LoopIdentifier()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static BlockIdentifier
considerAsDoLoopStart(Op03SimpleStatement start, java.util.List<Op03SimpleStatement> statements, BlockIdentifierFactory blockIdentifierFactory, java.util.Map<BlockIdentifier,Op03SimpleStatement> postBlockCache)
private static void
considerAsPathologicalLoop(Op03SimpleStatement start, java.util.List<Op03SimpleStatement> statements)
private static BlockIdentifier
considerAsWhileLoopStart(Method method, Op03SimpleStatement start, java.util.List<Op03SimpleStatement> statements, BlockIdentifierFactory blockIdentifierFactory, java.util.Map<BlockIdentifier,Op03SimpleStatement> postBlockCache)
(package private) static boolean
containsTargetInBlock(Op03SimpleStatement stm, BlockIdentifier block)
private static Op03SimpleStatement
findFirstConditional(Op03SimpleStatement start)
private static void
fixLoopOverlaps(java.util.List<Op03SimpleStatement> statements, java.util.List<LoopIdentifier.LoopResult> loopResults, java.util.Set<BlockIdentifier> relevantBlocks)
(package private) static Op03SimpleStatement
getCloseFwdJumpInto(Op03SimpleStatement start, BlockIdentifier blockIdentifier, java.util.List<Op03SimpleStatement> statements, int startIdx, int lastIdx)
static void
identifyLoops1(Method method, java.util.List<Op03SimpleStatement> statements, BlockIdentifierFactory blockIdentifierFactory)
private static void
rewriteEndLoopOverlapStatement(Op03SimpleStatement oldEnd, BlockIdentifier loopBlock)
private static int
validateAndAssignLoopIdentifier(java.util.List<Op03SimpleStatement> statements, int idxTestStart, int idxAfterEnd, BlockIdentifier blockIdentifier, Op03SimpleStatement start)
-
-
-
Method Detail
-
identifyLoops1
public static void identifyLoops1(Method method, java.util.List<Op03SimpleStatement> statements, BlockIdentifierFactory blockIdentifierFactory)
-
fixLoopOverlaps
private static void fixLoopOverlaps(java.util.List<Op03SimpleStatement> statements, java.util.List<LoopIdentifier.LoopResult> loopResults, java.util.Set<BlockIdentifier> relevantBlocks)
-
rewriteEndLoopOverlapStatement
private static void rewriteEndLoopOverlapStatement(Op03SimpleStatement oldEnd, BlockIdentifier loopBlock)
-
considerAsPathologicalLoop
private static void considerAsPathologicalLoop(Op03SimpleStatement start, java.util.List<Op03SimpleStatement> statements)
-
considerAsDoLoopStart
private static BlockIdentifier considerAsDoLoopStart(Op03SimpleStatement start, java.util.List<Op03SimpleStatement> statements, BlockIdentifierFactory blockIdentifierFactory, java.util.Map<BlockIdentifier,Op03SimpleStatement> postBlockCache)
-
getCloseFwdJumpInto
static Op03SimpleStatement getCloseFwdJumpInto(Op03SimpleStatement start, BlockIdentifier blockIdentifier, java.util.List<Op03SimpleStatement> statements, int startIdx, int lastIdx)
-
containsTargetInBlock
static boolean containsTargetInBlock(Op03SimpleStatement stm, BlockIdentifier block)
-
considerAsWhileLoopStart
private static BlockIdentifier considerAsWhileLoopStart(Method method, Op03SimpleStatement start, java.util.List<Op03SimpleStatement> statements, BlockIdentifierFactory blockIdentifierFactory, java.util.Map<BlockIdentifier,Op03SimpleStatement> postBlockCache)
-
findFirstConditional
private static Op03SimpleStatement findFirstConditional(Op03SimpleStatement start)
-
validateAndAssignLoopIdentifier
private static int validateAndAssignLoopIdentifier(java.util.List<Op03SimpleStatement> statements, int idxTestStart, int idxAfterEnd, BlockIdentifier blockIdentifier, Op03SimpleStatement start)
-
-