Class Op02WithProcessedDataAndRefs
java.lang.Object
org.benf.cfr.reader.bytecode.analysis.opgraph.Op02WithProcessedDataAndRefs
- All Implemented Interfaces:
Graph<Op02WithProcessedDataAndRefs>, Dumpable
public class Op02WithProcessedDataAndRefs
extends Object
implements Dumpable, Graph<Op02WithProcessedDataAndRefs>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<ExceptionGroup.Entry> private List<BlockIdentifier> private final ConstantPoolprivate final ConstantPoolEntry[]private List<ExceptionGroup> private booleanprivate InstrIndexprivate JVMInstrprivate final BytecodeLocprivate static final Loggerprivate final intprivate final byte[]private final List<Op02WithProcessedDataAndRefs> private SSAIdentifiers<Slot> private final List<StackEntryHolder> private longprivate longprivate final List<StackEntryHolder> private final List<Op02WithProcessedDataAndRefs> private StackSim -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateOp02WithProcessedDataAndRefs(JVMInstr instr, byte[] rawData, int index, ConstantPool cp, ConstantPoolEntry[] cpEntries, int originalRawOffset, BytecodeLoc loc) Op02WithProcessedDataAndRefs(JVMInstr instr, byte[] rawData, InstrIndex index, ConstantPool cp, ConstantPoolEntry[] cpEntries, int originalRawOffset, BytecodeLoc loc) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidprivate static Op02WithProcessedDataAndRefsadjustOrdering(Map<InstrIndex, List<Op02WithProcessedDataAndRefs.ExceptionTempStatement>> insertions, Op02WithProcessedDataAndRefs infrontOf, ExceptionGroup exceptionGroup, Op02WithProcessedDataAndRefs newNode) private static NavigableMap<Integer, JavaTypeInstance> assignIdentsAndGetMissingMap(SSAIdentifierFactory<Slot, StackType> ssaIdentifierFactory, Method method, List<Op02WithProcessedDataAndRefs> statements, BytecodeMeta bytecodeMeta, boolean useProtoArgs) private static voidassignSSAIdentifiers(SSAIdentifierFactory<Slot, StackType> ssaIdentifierFactory, Method method, DecompilerComments comments, List<Op02WithProcessedDataAndRefs> statements, BytecodeMeta bytecodeMeta) private static voidassignSSAIdentifiersInner(SSAIdentifierFactory<Slot, StackType> ssaIdentifierFactory, Method method, List<Op02WithProcessedDataAndRefs> statements, BytecodeMeta bytecodeMeta, boolean useProtoArgs) private StatementbuildInvoke(Method thisCallerMethod) private List<Expression> buildInvokeBootstrapArgs(MethodPrototype prototype, MethodPrototype dynamicPrototype, MethodHandleBehaviour bootstrapBehaviour, BootstrapMethodInfo bootstrapMethodInfo, ConstantPoolEntryMethodRef methodRef, boolean showBoilerArgs, ClassFile classFile, DCCommonState state, DecompilerComments comments) private StatementbuildInvokeDynamic(ClassFile classFile, DCCommonState dcCommonState, String name, MethodPrototype dynamicPrototype, int idx, boolean showBoilerArgs, DecompilerComments comments) private StatementbuildInvokeDynamic(Method method, DCCommonState dcCommonState, DecompilerComments comments) private List<Expression> buildInvokeDynamicAltMetaFactoryArgs(MethodPrototype prototype, MethodPrototype dynamicPrototype, MethodHandleBehaviour bootstrapBehaviour, BootstrapMethodInfo bootstrapMethodInfo, ConstantPoolEntryMethodRef methodRef, List<JavaTypeInstance> markerTypes) private List<Expression> buildInvokeDynamicMetaFactoryArgs(MethodPrototype prototype, MethodPrototype dynamicPrototype, MethodHandleBehaviour bootstrapBehaviour, BootstrapMethodInfo bootstrapMethodInfo, ConstantPoolEntryMethodRef methodRef) private voidcollectLocallyMutatedVariables(SSAIdentifierFactory<Slot, StackType> ssaIdentifierFactory) static List<Op03SimpleStatement> convertToOp03List(List<Op02WithProcessedDataAndRefs> op2list, Method method, VariableFactory variableFactory, BlockIdentifierFactory blockIdentifierFactory, DCCommonState dcCommonState, DecompilerComments comments, TypeHintRecovery typeHintRecovery) private static List<Op02WithProcessedDataAndRefs> copyBlock(List<Op02WithProcessedDataAndRefs> orig, InstrIndex afterThis) createReverseMap(Map<SSAIdent, Set<SSAIdent>> downMap) private StatementcreateStatement(Method method, DecompilerComments comments, VariableFactory variableFactory, BlockIdentifierFactory blockIdentifierFactory, DCCommonState dcCommonState, TypeHintRecovery typeHintRecovery) private JavaTypeInstancedetermineDynamicGeneric(JavaTypeInstance callsiteReturn, MethodPrototype proto, Expression instantiated, DCCommonState dcCommonState) static voiddiscoverStorageLiveness(Method method, DecompilerComments comments, List<Op02WithProcessedDataAndRefs> op2list, BytecodeMeta bytecodeMeta) private static Expressionprivate static Op02WithProcessedDataAndRefsprivate static TypedLiteralgetBootstrapArg(ConstantPoolEntry[] bootstrapArguments, int x, ConstantPool cp) getCp()private ExpressiongetDynamicLiteral(Method method, ConstantPoolEntryDynamicInfo cpe, DecompilerComments comments) getIndex()getInstr()private intgetInstrArgByte(int index) private intgetInstrArgShort(int index) private intgetInstrArgU1(int index) private static Map<Op02WithProcessedDataAndRefs, List<Op02WithProcessedDataAndRefs>> private static intgetLastIndex(Map<Integer, Integer> lutByOffset, int op2count, long codeLength, int offset) private ExpressiongetLiteralConstantPoolEntry(Method m, ConstantPoolEntry cpe, DecompilerComments comments) private Expressionprivate Expressionprivate List<Expression> getNStackRValuesAsExpressions(int count) getNullsByType(List<Expression> expressions) intprivate ExceptionGroupprivate LValuegetStackLValue(int idx) private StackValuegetStackRValue(int idx) private List<Expression> getVarArgs(JavaTypeInstance last, ConstantPoolEntry[] bootstrapArguments) private static voidinlineJSR(Op02WithProcessedDataAndRefs start, Set<Op02WithProcessedDataAndRefs> nodes, List<Op02WithProcessedDataAndRefs> ops) private static voidstatic List<Op02WithProcessedDataAndRefs> insertExceptionBlocks(List<Op02WithProcessedDataAndRefs> op2list, ExceptionAggregator exceptions, Map<Integer, Integer> lutByOffset, ConstantPool cp, long codeLength, Options options) private static booleanprivate static booleanprivate static List<Op02WithProcessedDataAndRefs> private voidprivate StatementmkAssign(VariableFactory variableFactory) private StatementmkRetrieve(VariableFactory variableFactory) voidnop()static DecompilerCommentpopulateStackInfo(List<Op02WithProcessedDataAndRefs> op2list, Method method) private voidpopulateStackInfo(StackSim stackSim, Method method, Set<DecompilerComment> comments, LinkedList<Pair<StackSim, Op02WithProcessedDataAndRefs>> next) static booleanprivate static voidvoidremoveSource(Op02WithProcessedDataAndRefs oldSource) private voidprivate static voidremoveUnusedSSAIdentifiers(SSAIdentifierFactory<Slot, StackType> ssaIdentifierFactory, Method method, List<Op02WithProcessedDataAndRefs> op2list) static voidreplace(Op02WithProcessedDataAndRefs oldOp, Op02WithProcessedDataAndRefs newOp) voidreplaceInstr(JVMInstr newInstr) voidreplaceSource(Op02WithProcessedDataAndRefs oldSource, Op02WithProcessedDataAndRefs newSource) voidreplaceTarget(Op02WithProcessedDataAndRefs oldTarget, Op02WithProcessedDataAndRefs newTarget) private voidvoidsetIndex(InstrIndex index) private static booleanprivate static voidtidyMultipleInsertionIdentifiers(Collection<List<Op02WithProcessedDataAndRefs.ExceptionTempStatement>> etsList) private static voidtieUpRelations(List<Op02WithProcessedDataAndRefs> out, List<Op02WithProcessedDataAndRefs> in, Map<Op02WithProcessedDataAndRefs, Op02WithProcessedDataAndRefs> map) toString()static void
-
Field Details
-
logger
-
index
-
instr
-
originalRawOffset
private final int originalRawOffset -
loc
-
rawData
private final byte[] rawData -
containedInTheseBlocks
-
exceptionGroups
-
catchExceptionGroups
-
targets
-
sources
-
cp
-
cpEntries
-
stackDepthBeforeExecution
private long stackDepthBeforeExecution -
stackDepthAfterExecution
private long stackDepthAfterExecution -
stackConsumed
-
stackProduced
-
unconsumedJoinedStack
-
hasCatchParent
private boolean hasCatchParent -
ssaIdentifiers
-
localVariablesBySlot
-
-
Constructor Details
-
Op02WithProcessedDataAndRefs
-
Op02WithProcessedDataAndRefs
public Op02WithProcessedDataAndRefs(JVMInstr instr, byte[] rawData, int index, ConstantPool cp, ConstantPoolEntry[] cpEntries, int originalRawOffset, BytecodeLoc loc) -
Op02WithProcessedDataAndRefs
public Op02WithProcessedDataAndRefs(JVMInstr instr, byte[] rawData, InstrIndex index, ConstantPool cp, ConstantPoolEntry[] cpEntries, int originalRawOffset, BytecodeLoc loc)
-
-
Method Details
-
resetStackInfo
private void resetStackInfo() -
getIndex
-
setIndex
-
addTarget
-
removeTarget
-
addSource
-
getInstr
-
replaceTarget
public void replaceTarget(Op02WithProcessedDataAndRefs oldTarget, Op02WithProcessedDataAndRefs newTarget) -
replaceSource
public void replaceSource(Op02WithProcessedDataAndRefs oldSource, Op02WithProcessedDataAndRefs newSource) -
removeSource
-
getInstrArgByte
private int getInstrArgByte(int index) -
getInstrArgU1
private int getInstrArgU1(int index) -
getInstrArgShort
private int getInstrArgShort(int index) -
getTargets
- Specified by:
getTargetsin interfaceGraph<Op02WithProcessedDataAndRefs>
-
getSources
- Specified by:
getSourcesin interfaceGraph<Op02WithProcessedDataAndRefs>
-
getCpEntries
-
populateStackInfo
private void populateStackInfo(StackSim stackSim, Method method, Set<DecompilerComment> comments, LinkedList<Pair<StackSim, Op02WithProcessedDataAndRefs>> next) -
getSingleExceptionGroup
-
dump
-
getNullsByType
-
buildInvoke
-
buildInvokeDynamic
private Statement buildInvokeDynamic(Method method, DCCommonState dcCommonState, DecompilerComments comments) -
buildInvokeDynamic
private Statement buildInvokeDynamic(ClassFile classFile, DCCommonState dcCommonState, String name, MethodPrototype dynamicPrototype, int idx, boolean showBoilerArgs, DecompilerComments comments) -
determineDynamicGeneric
private JavaTypeInstance determineDynamicGeneric(JavaTypeInstance callsiteReturn, MethodPrototype proto, Expression instantiated, DCCommonState dcCommonState) -
getBootstrapArg
private static TypedLiteral getBootstrapArg(ConstantPoolEntry[] bootstrapArguments, int x, ConstantPool cp) -
buildInvokeDynamicAltMetaFactoryArgs
private List<Expression> buildInvokeDynamicAltMetaFactoryArgs(MethodPrototype prototype, MethodPrototype dynamicPrototype, MethodHandleBehaviour bootstrapBehaviour, BootstrapMethodInfo bootstrapMethodInfo, ConstantPoolEntryMethodRef methodRef, List<JavaTypeInstance> markerTypes) -
buildInvokeBootstrapArgs
private List<Expression> buildInvokeBootstrapArgs(MethodPrototype prototype, MethodPrototype dynamicPrototype, MethodHandleBehaviour bootstrapBehaviour, BootstrapMethodInfo bootstrapMethodInfo, ConstantPoolEntryMethodRef methodRef, boolean showBoilerArgs, ClassFile classFile, DCCommonState state, DecompilerComments comments) -
getVarArgs
-
buildInvokeDynamicMetaFactoryArgs
private List<Expression> buildInvokeDynamicMetaFactoryArgs(MethodPrototype prototype, MethodPrototype dynamicPrototype, MethodHandleBehaviour bootstrapBehaviour, BootstrapMethodInfo bootstrapMethodInfo, ConstantPoolEntryMethodRef methodRef) -
getRetrieveType
-
getRetrieveIdx
-
getStorageType
-
getStoreIdx
-
mkAssign
-
mkRetrieve
-
ensureNonBool
-
createStatement
private Statement createStatement(Method method, DecompilerComments comments, VariableFactory variableFactory, BlockIdentifierFactory blockIdentifierFactory, DCCommonState dcCommonState, TypeHintRecovery typeHintRecovery) -
getIincInfo
-
getLiteralConstantPoolEntry
private Expression getLiteralConstantPoolEntry(Method m, ConstantPoolEntry cpe, DecompilerComments comments) -
getMethodTypeLiteral
-
getMethodHandleLiteral
-
getDynamicLiteral
private Expression getDynamicLiteral(Method method, ConstantPoolEntryDynamicInfo cpe, DecompilerComments comments) -
getStackRValue
-
getStackLValue
-
getNStackRValuesAsExpressions
-
toString
-
populateStackInfo
public static DecompilerComment populateStackInfo(List<Op02WithProcessedDataAndRefs> op2list, Method method) -
unlinkUnreachable
-
nop
public void nop() -
replaceInstr
-
collectLocallyMutatedVariables
private void collectLocallyMutatedVariables(SSAIdentifierFactory<Slot, StackType> ssaIdentifierFactory) -
assignSSAIdentifiers
private static void assignSSAIdentifiers(SSAIdentifierFactory<Slot, StackType> ssaIdentifierFactory, Method method, DecompilerComments comments, List<Op02WithProcessedDataAndRefs> statements, BytecodeMeta bytecodeMeta) -
assignIdentsAndGetMissingMap
private static NavigableMap<Integer, JavaTypeInstance> assignIdentsAndGetMissingMap(SSAIdentifierFactory<Slot, StackType> ssaIdentifierFactory, Method method, List<Op02WithProcessedDataAndRefs> statements, BytecodeMeta bytecodeMeta, boolean useProtoArgs) -
assignSSAIdentifiersInner
private static void assignSSAIdentifiersInner(SSAIdentifierFactory<Slot, StackType> ssaIdentifierFactory, Method method, List<Op02WithProcessedDataAndRefs> statements, BytecodeMeta bytecodeMeta, boolean useProtoArgs) -
removeUnusedSSAIdentifiers
private static void removeUnusedSSAIdentifiers(SSAIdentifierFactory<Slot, StackType> ssaIdentifierFactory, Method method, List<Op02WithProcessedDataAndRefs> op2list) -
discoverStorageLiveness
public static void discoverStorageLiveness(Method method, DecompilerComments comments, List<Op02WithProcessedDataAndRefs> op2list, BytecodeMeta bytecodeMeta) -
mapSSASlots
-
getCp
-
getOriginalRawOffset
public int getOriginalRawOffset() -
getBytecodeLoc
-
createReverseMap
-
convertToOp03List
public static List<Op03SimpleStatement> convertToOp03List(List<Op02WithProcessedDataAndRefs> op2list, Method method, VariableFactory variableFactory, BlockIdentifierFactory blockIdentifierFactory, DCCommonState dcCommonState, DecompilerComments comments, TypeHintRecovery typeHintRecovery) -
adjustOrdering
private static Op02WithProcessedDataAndRefs adjustOrdering(Map<InstrIndex, List<Op02WithProcessedDataAndRefs.ExceptionTempStatement>> insertions, Op02WithProcessedDataAndRefs infrontOf, ExceptionGroup exceptionGroup, Op02WithProcessedDataAndRefs newNode) -
tidyMultipleInsertionIdentifiers
private static void tidyMultipleInsertionIdentifiers(Collection<List<Op02WithProcessedDataAndRefs.ExceptionTempStatement>> etsList) -
getLastIndex
-
insertExceptionBlocks
public static List<Op02WithProcessedDataAndRefs> insertExceptionBlocks(List<Op02WithProcessedDataAndRefs> op2list, ExceptionAggregator exceptions, Map<Integer, Integer> lutByOffset, ConstantPool cp, long codeLength, Options options) -
getContainedInTheseBlocks
-
isJSR
-
isRET
-
processJSR
-
justJSRs
-
followNopGoto
-
processJSRs
private static void processJSRs(List<Op02WithProcessedDataAndRefs> jsrs, List<Op02WithProcessedDataAndRefs> ops) -
getJsrsWithCommonTarget
private static Map<Op02WithProcessedDataAndRefs, List<Op02WithProcessedDataAndRefs>> getJsrsWithCommonTarget(List<Op02WithProcessedDataAndRefs> jsrs) -
SimulateJSR
private static boolean SimulateJSR(Op02WithProcessedDataAndRefs start, List<Op02WithProcessedDataAndRefs> ops) -
inlineReplaceJSR
private static void inlineReplaceJSR(Op02WithProcessedDataAndRefs jsrCall, List<Op02WithProcessedDataAndRefs> ops) -
inlineJSR
private static void inlineJSR(Op02WithProcessedDataAndRefs start, Set<Op02WithProcessedDataAndRefs> nodes, List<Op02WithProcessedDataAndRefs> ops) -
copyBlock
private static List<Op02WithProcessedDataAndRefs> copyBlock(List<Op02WithProcessedDataAndRefs> orig, InstrIndex afterThis) -
tieUpRelations
private static void tieUpRelations(List<Op02WithProcessedDataAndRefs> out, List<Op02WithProcessedDataAndRefs> in, Map<Op02WithProcessedDataAndRefs, Op02WithProcessedDataAndRefs> map) -
replace
-