public class SwitchReplacer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
SwitchReplacer.NodeReachable |
private static class |
SwitchReplacer.NodesReachedUntil |
Constructor and Description |
---|
SwitchReplacer() |
Modifier and Type | Method and Description |
---|---|
private static boolean |
blockIsContiguous(java.util.List<Op03SimpleStatement> in,
Op03SimpleStatement start,
java.util.Set<Op03SimpleStatement> blockContent) |
private static void |
buildSwitchCases(Op03SimpleStatement swatch,
java.util.List<Op03SimpleStatement> targets,
BlockIdentifier switchBlockIdentifier,
java.util.List<Op03SimpleStatement> in,
boolean forcedOrder) |
private static int |
checkPreSwitchJump(java.util.List<Op03SimpleStatement> statements,
Op03SimpleStatement switchStm,
int idxLastStart,
int idxLastEnd) |
private static Op03SimpleStatement |
examineSwitchContiguity(Op03SimpleStatement switchStatement,
java.util.List<Op03SimpleStatement> statements,
boolean pullCodeIntoCase,
boolean allowMalformedSwitch,
DecompilerComments comments,
BytecodeMeta bytecodeMeta) |
private static int |
getDefault(DecodedSwitch decodedSwitch) |
private static void |
moveInternalJumpsToTerminal(Op03SimpleStatement switchStatement,
java.util.List<Op03SimpleStatement> statements,
Op03SimpleStatement lastTgt,
Op03SimpleStatement following,
java.util.List<Op03SimpleStatement> forwardJumpSources) |
private static void |
moveJumpsToCaseStatements(Op03SimpleStatement switchStatement) |
private static void |
moveJumpsToTerminalIfEmpty(Op03SimpleStatement switchStatement,
java.util.List<Op03SimpleStatement> statements) |
private static Op03SimpleStatement |
moveSwitch(Op03SimpleStatement switchStatement,
java.util.List<Op03SimpleStatement> statements,
Op03SimpleStatement firstCase,
int idxFirstCase,
java.util.List<Op03SimpleStatement> targets) |
static void |
rebuildSwitches(java.util.List<Op03SimpleStatement> statements,
Options options,
DecompilerComments comments,
BytecodeMeta bytecodeMeta) |
private static Op03SimpleStatement |
replaceRawSwitch(Method method,
Op03SimpleStatement swatch,
java.util.List<Op03SimpleStatement> in,
BlockIdentifierFactory blockIdentifierFactory,
Options options) |
static void |
replaceRawSwitches(Method method,
java.util.List<Op03SimpleStatement> in,
BlockIdentifierFactory blockIdentifierFactory,
Options options,
DecompilerComments comments,
BytecodeMeta bytecodeMeta) |
static java.util.List<Op03SimpleStatement> |
rewriteDuff(java.util.List<Op03SimpleStatement> statements,
VariableFactory vf,
DecompilerComments decompilerComments,
Options options) |
private static boolean |
rewriteDuff(Op03SimpleStatement switchStatement,
java.util.List<Op03SimpleStatement> statements,
VariableFactory vf,
DecompilerComments decompilerComments) |
private static void |
tightenJumpsToTerminal(java.util.List<Op03SimpleStatement> statements,
BlockIdentifier switchBlock,
Op03SimpleStatement following,
Op03SimpleStatement followingTrans) |
private static void |
tryInlineRawSwitchContent(Op03SimpleStatement switchStatement,
java.util.List<Op03SimpleStatement> statements) |
public static void replaceRawSwitches(Method method, java.util.List<Op03SimpleStatement> in, BlockIdentifierFactory blockIdentifierFactory, Options options, DecompilerComments comments, BytecodeMeta bytecodeMeta)
public static java.util.List<Op03SimpleStatement> rewriteDuff(java.util.List<Op03SimpleStatement> statements, VariableFactory vf, DecompilerComments decompilerComments, Options options)
private static Op03SimpleStatement replaceRawSwitch(Method method, Op03SimpleStatement swatch, java.util.List<Op03SimpleStatement> in, BlockIdentifierFactory blockIdentifierFactory, Options options)
private static void buildSwitchCases(Op03SimpleStatement swatch, java.util.List<Op03SimpleStatement> targets, BlockIdentifier switchBlockIdentifier, java.util.List<Op03SimpleStatement> in, boolean forcedOrder)
public static void rebuildSwitches(java.util.List<Op03SimpleStatement> statements, Options options, DecompilerComments comments, BytecodeMeta bytecodeMeta)
private static boolean blockIsContiguous(java.util.List<Op03SimpleStatement> in, Op03SimpleStatement start, java.util.Set<Op03SimpleStatement> blockContent)
private static Op03SimpleStatement examineSwitchContiguity(Op03SimpleStatement switchStatement, java.util.List<Op03SimpleStatement> statements, boolean pullCodeIntoCase, boolean allowMalformedSwitch, DecompilerComments comments, BytecodeMeta bytecodeMeta)
private static int checkPreSwitchJump(java.util.List<Op03SimpleStatement> statements, Op03SimpleStatement switchStm, int idxLastStart, int idxLastEnd)
private static Op03SimpleStatement moveSwitch(Op03SimpleStatement switchStatement, java.util.List<Op03SimpleStatement> statements, Op03SimpleStatement firstCase, int idxFirstCase, java.util.List<Op03SimpleStatement> targets)
private static void moveJumpsToCaseStatements(Op03SimpleStatement switchStatement)
private static void moveJumpsToTerminalIfEmpty(Op03SimpleStatement switchStatement, java.util.List<Op03SimpleStatement> statements)
private static void tightenJumpsToTerminal(java.util.List<Op03SimpleStatement> statements, BlockIdentifier switchBlock, Op03SimpleStatement following, Op03SimpleStatement followingTrans)
private static void moveInternalJumpsToTerminal(Op03SimpleStatement switchStatement, java.util.List<Op03SimpleStatement> statements, Op03SimpleStatement lastTgt, Op03SimpleStatement following, java.util.List<Op03SimpleStatement> forwardJumpSources)
private static int getDefault(DecodedSwitch decodedSwitch)
private static void tryInlineRawSwitchContent(Op03SimpleStatement switchStatement, java.util.List<Op03SimpleStatement> statements)
private static boolean rewriteDuff(Op03SimpleStatement switchStatement, java.util.List<Op03SimpleStatement> statements, VariableFactory vf, DecompilerComments decompilerComments)