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 class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<ExceptionGroup.Entry>
private List<BlockIdentifier>
private final ConstantPool
private final ConstantPoolEntry[]
private List<ExceptionGroup>
private boolean
private InstrIndex
private JVMInstr
private final BytecodeLoc
private static final Logger
private final int
private final byte[]
private final List<Op02WithProcessedDataAndRefs>
private SSAIdentifiers<Slot>
private final List<StackEntryHolder>
private long
private long
private final List<StackEntryHolder>
private final List<Op02WithProcessedDataAndRefs>
private StackSim
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Op02WithProcessedDataAndRefs
(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 TypeMethodDescriptionvoid
void
private static Op02WithProcessedDataAndRefs
adjustOrdering
(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 void
assignSSAIdentifiers
(SSAIdentifierFactory<Slot, StackType> ssaIdentifierFactory, Method method, DecompilerComments comments, List<Op02WithProcessedDataAndRefs> statements, BytecodeMeta bytecodeMeta) private static void
assignSSAIdentifiersInner
(SSAIdentifierFactory<Slot, StackType> ssaIdentifierFactory, Method method, List<Op02WithProcessedDataAndRefs> statements, BytecodeMeta bytecodeMeta, boolean useProtoArgs) private Statement
buildInvoke
(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 Statement
buildInvokeDynamic
(ClassFile classFile, DCCommonState dcCommonState, String name, MethodPrototype dynamicPrototype, int idx, boolean showBoilerArgs, DecompilerComments comments) private Statement
buildInvokeDynamic
(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 void
collectLocallyMutatedVariables
(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 Statement
createStatement
(Method method, DecompilerComments comments, VariableFactory variableFactory, BlockIdentifierFactory blockIdentifierFactory, DCCommonState dcCommonState, TypeHintRecovery typeHintRecovery) private JavaTypeInstance
determineDynamicGeneric
(JavaTypeInstance callsiteReturn, MethodPrototype proto, Expression instantiated, DCCommonState dcCommonState) static void
discoverStorageLiveness
(Method method, DecompilerComments comments, List<Op02WithProcessedDataAndRefs> op2list, BytecodeMeta bytecodeMeta) private static Expression
private static Op02WithProcessedDataAndRefs
private static TypedLiteral
getBootstrapArg
(ConstantPoolEntry[] bootstrapArguments, int x, ConstantPool cp) getCp()
private Expression
getDynamicLiteral
(Method method, ConstantPoolEntryDynamicInfo cpe, DecompilerComments comments) getIndex()
getInstr()
private int
getInstrArgByte
(int index) private int
getInstrArgShort
(int index) private int
getInstrArgU1
(int index) private static Map<Op02WithProcessedDataAndRefs,
List<Op02WithProcessedDataAndRefs>> private static int
getLastIndex
(Map<Integer, Integer> lutByOffset, int op2count, long codeLength, int offset) private Expression
getLiteralConstantPoolEntry
(Method m, ConstantPoolEntry cpe, DecompilerComments comments) private Expression
private Expression
private List<Expression>
getNStackRValuesAsExpressions
(int count) getNullsByType
(List<Expression> expressions) int
private ExceptionGroup
private LValue
getStackLValue
(int idx) private StackValue
getStackRValue
(int idx) private List<Expression>
getVarArgs
(JavaTypeInstance last, ConstantPoolEntry[] bootstrapArguments) private static void
inlineJSR
(Op02WithProcessedDataAndRefs start, Set<Op02WithProcessedDataAndRefs> nodes, List<Op02WithProcessedDataAndRefs> ops) private static void
static List<Op02WithProcessedDataAndRefs>
insertExceptionBlocks
(List<Op02WithProcessedDataAndRefs> op2list, ExceptionAggregator exceptions, Map<Integer, Integer> lutByOffset, ConstantPool cp, long codeLength, Options options) private static boolean
private static boolean
private static List<Op02WithProcessedDataAndRefs>
private void
private Statement
mkAssign
(VariableFactory variableFactory) private Statement
mkRetrieve
(VariableFactory variableFactory) void
nop()
static DecompilerComment
populateStackInfo
(List<Op02WithProcessedDataAndRefs> op2list, Method method) private void
populateStackInfo
(StackSim stackSim, Method method, Set<DecompilerComment> comments, LinkedList<Pair<StackSim, Op02WithProcessedDataAndRefs>> next) static boolean
private static void
void
removeSource
(Op02WithProcessedDataAndRefs oldSource) private void
private static void
removeUnusedSSAIdentifiers
(SSAIdentifierFactory<Slot, StackType> ssaIdentifierFactory, Method method, List<Op02WithProcessedDataAndRefs> op2list) static void
replace
(Op02WithProcessedDataAndRefs oldOp, Op02WithProcessedDataAndRefs newOp) void
replaceInstr
(JVMInstr newInstr) void
replaceSource
(Op02WithProcessedDataAndRefs oldSource, Op02WithProcessedDataAndRefs newSource) void
replaceTarget
(Op02WithProcessedDataAndRefs oldTarget, Op02WithProcessedDataAndRefs newTarget) private void
void
setIndex
(InstrIndex index) private static boolean
private static void
tidyMultipleInsertionIdentifiers
(Collection<List<Op02WithProcessedDataAndRefs.ExceptionTempStatement>> etsList) private static void
tieUpRelations
(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:
getTargets
in interfaceGraph<Op02WithProcessedDataAndRefs>
-
getSources
- Specified by:
getSources
in 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
-
getStorageType
-
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
-