Package jadx.core.codegen
Class InsnGen
java.lang.Object
jadx.core.codegen.InsnGen
- Direct Known Subclasses:
ConditionGen,RegionGen
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Set<InsnGen.Flags> private static final Set<InsnGen.Flags> private static final Set<InsnGen.Flags> protected final booleanprivate static final org.slf4j.Loggerprotected final MethodGenprotected final MethodNodeprotected final RootNode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArg(ICodeWriter code, InsnArg arg) voidaddArg(ICodeWriter code, InsnArg arg, boolean wrap) voidaddArg(ICodeWriter code, InsnArg arg, Set<InsnGen.Flags> flags) voidaddArgDot(ICodeWriter code, InsnArg arg) private voidaddLiteralArg(ICodeWriter code, LiteralArg litArg, Set<InsnGen.Flags> flags) private booleanaddOuterClassInstance(ConstructorInsn insn, ICodeWriter code, MethodNode callMth) private voidaddWrappedArg(ICodeWriter code, InsnWrapArg arg, Set<InsnGen.Flags> flags) voidassignVar(ICodeWriter code, InsnNode insn) private voidcallSuper(ICodeWriter code, MethodInfo callMth) voiddeclareVar(ICodeWriter code, CodeVar codeVar) voiddeclareVar(ICodeWriter code, RegisterArg arg) private voiddefVar(ICodeWriter code, CodeVar codeVar) Variable definition without type, only var nameprivate voidfallbackOnlyInsn(InsnNode insn) private voidfillArray(ICodeWriter code, FillArrayInsn arrayNode) In most cases must be combined with new array instructions.private voidfilledNewArray(FilledNewArrayNode insn, ICodeWriter code) (package private) voidgenerateMethodArguments(ICodeWriter code, BaseInvokeNode insn, int startArgNum, @Nullable MethodNode mthNode) private @Nullable ClassInfogetClassForSuperCall(MethodInfo callMth) Search call class in super types of this and all parent classes (needed for inlined synthetic calls)private voidinlineAnonymousConstructor(ICodeWriter code, ClassNode cls, ConstructorInsn insn) private voidinstanceField(ICodeWriter code, FieldInfo field, InsnArg arg) private booleanprivate Stringlit(LiteralArg arg) private voidmakeArith(ArithNode insn, ICodeWriter code, Set<InsnGen.Flags> state) private voidmakeArithOneArg(ArithNode insn, ICodeWriter code) private voidmakeConstructor(ConstructorInsn insn, ICodeWriter code) private voidmakeInlinedLambdaMethod(ICodeWriter code, InvokeCustomNode customNode, MethodNode callMth) voidmakeInsn(InsnNode insn, ICodeWriter code) protected voidmakeInsn(InsnNode insn, ICodeWriter code, InsnGen.Flags flag) private voidmakeInsnBody(ICodeWriter code, InsnNode insn, Set<InsnGen.Flags> state) private voidmakeInvoke(InvokeNode insn, ICodeWriter code) private voidmakeInvokeCustomRaw(InvokeCustomRawNode insn, @Nullable MethodNode callMthNode, ICodeWriter code) private voidmakeInvokeLambda(ICodeWriter code, InvokeCustomNode customNode) private voidmakeRefLambda(ICodeWriter code, InvokeCustomNode customNode) private voidmakeSimpleLambda(ICodeWriter code, InvokeCustomNode customNode) static voidmakeStaticFieldAccess(ICodeWriter code, FieldInfo field, ClassGen clsGen) private static voidmakeStaticFieldAccess(ICodeWriter code, FieldInfo field, @Nullable FieldNode fieldNode, ClassGen clsGen) private voidmakeTernary(TernaryInsn insn, ICodeWriter code, Set<InsnGen.Flags> state) private booleanneedInvokeArg(InsnArg arg) private voidoneArgInsn(ICodeWriter code, InsnNode insn, Set<InsnGen.Flags> state, char op) private booleanprocessVarArg(ICodeWriter code, BaseInvokeNode invokeInsn, InsnArg lastArg) Expand varArgs from filled array.protected voidstaticField(ICodeWriter code, FieldInfo field) voiduseClass(ICodeWriter code, ClassInfo cls) voiduseClass(ICodeWriter code, ArgType type) protected voiduseType(ICodeWriter code, ArgType type)
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
mgen
-
mth
-
root
-
fallback
protected final boolean fallback -
EMPTY_FLAGS
-
BODY_ONLY_FLAG
-
BODY_ONLY_NOWRAP_FLAGS
-
-
Constructor Details
-
InsnGen
-
-
Method Details
-
isFallback
private boolean isFallback() -
addArgDot
- Throws:
CodegenException
-
addArg
- Throws:
CodegenException
-
addArg
- Throws:
CodegenException
-
addArg
- Throws:
CodegenException
-
addLiteralArg
-
addWrappedArg
private void addWrappedArg(ICodeWriter code, InsnWrapArg arg, Set<InsnGen.Flags> flags) throws CodegenException - Throws:
CodegenException
-
assignVar
- Throws:
CodegenException
-
declareVar
-
declareVar
-
defVar
Variable definition without type, only var name -
lit
-
instanceField
- Throws:
CodegenException
-
staticField
- Throws:
CodegenException
-
makeStaticFieldAccess
-
makeStaticFieldAccess
private static void makeStaticFieldAccess(ICodeWriter code, FieldInfo field, @Nullable @Nullable FieldNode fieldNode, ClassGen clsGen) -
useClass
-
useClass
-
useType
-
makeInsn
- Throws:
CodegenException
-
makeInsn
protected void makeInsn(InsnNode insn, ICodeWriter code, InsnGen.Flags flag) throws CodegenException - Throws:
CodegenException
-
makeInsnBody
private void makeInsnBody(ICodeWriter code, InsnNode insn, Set<InsnGen.Flags> state) throws CodegenException - Throws:
CodegenException
-
fillArray
In most cases must be combined with new array instructions. Use one by one array fill (can be replaced with System.arrayCopy)- Throws:
CodegenException
-
oneArgInsn
private void oneArgInsn(ICodeWriter code, InsnNode insn, Set<InsnGen.Flags> state, char op) throws CodegenException - Throws:
CodegenException
-
fallbackOnlyInsn
- Throws:
CodegenException
-
filledNewArray
- Throws:
CodegenException
-
makeConstructor
- Throws:
CodegenException
-
addOuterClassInstance
private boolean addOuterClassInstance(ConstructorInsn insn, ICodeWriter code, MethodNode callMth) throws CodegenException - Throws:
CodegenException
-
inlineAnonymousConstructor
private void inlineAnonymousConstructor(ICodeWriter code, ClassNode cls, ConstructorInsn insn) throws CodegenException - Throws:
CodegenException
-
makeInvoke
- Throws:
CodegenException
-
makeInvokeCustomRaw
private void makeInvokeCustomRaw(InvokeCustomRawNode insn, @Nullable @Nullable MethodNode callMthNode, ICodeWriter code) throws CodegenException - Throws:
CodegenException
-
needInvokeArg
-
makeInvokeLambda
private void makeInvokeLambda(ICodeWriter code, InvokeCustomNode customNode) throws CodegenException - Throws:
CodegenException
-
makeRefLambda
- Throws:
CodegenException
-
makeSimpleLambda
-
makeInlinedLambdaMethod
private void makeInlinedLambdaMethod(ICodeWriter code, InvokeCustomNode customNode, MethodNode callMth) throws CodegenException - Throws:
CodegenException
-
callSuper
-
getClassForSuperCall
Search call class in super types of this and all parent classes (needed for inlined synthetic calls) -
generateMethodArguments
void generateMethodArguments(ICodeWriter code, BaseInvokeNode insn, int startArgNum, @Nullable @Nullable MethodNode mthNode) throws CodegenException - Throws:
CodegenException
-
processVarArg
private boolean processVarArg(ICodeWriter code, BaseInvokeNode invokeInsn, InsnArg lastArg) throws CodegenException Expand varArgs from filled array.- Throws:
CodegenException
-
makeTernary
private void makeTernary(TernaryInsn insn, ICodeWriter code, Set<InsnGen.Flags> state) throws CodegenException - Throws:
CodegenException
-
makeArith
private void makeArith(ArithNode insn, ICodeWriter code, Set<InsnGen.Flags> state) throws CodegenException - Throws:
CodegenException
-
makeArithOneArg
- Throws:
CodegenException
-