Search in sources :

Example 1 with Named

use of jadx.core.dex.instructions.args.Named in project jadx by skylot.

the class InsnGen method addArg.

public void addArg(CodeWriter code, InsnArg arg, boolean wrap) throws CodegenException {
    if (arg.isRegister()) {
        code.add(mgen.getNameGen().useArg((RegisterArg) arg));
    } else if (arg.isLiteral()) {
        code.add(lit((LiteralArg) arg));
    } else if (arg.isInsnWrap()) {
        Flags flag = wrap ? Flags.BODY_ONLY : Flags.BODY_ONLY_NOWRAP;
        makeInsn(((InsnWrapArg) arg).getWrapInsn(), code, flag);
    } else if (arg.isNamed()) {
        code.add(((Named) arg).getName());
    } else if (arg.isField()) {
        FieldArg f = (FieldArg) arg;
        if (f.isStatic()) {
            staticField(code, f.getField());
        } else {
            instanceField(code, f.getField(), f.getInstanceArg());
        }
    } else {
        throw new CodegenException("Unknown arg type " + arg);
    }
}
Also used : Named(jadx.core.dex.instructions.args.Named) RegisterArg(jadx.core.dex.instructions.args.RegisterArg) CodegenException(jadx.core.utils.exceptions.CodegenException) FieldArg(jadx.core.dex.instructions.args.FieldArg)

Aggregations

FieldArg (jadx.core.dex.instructions.args.FieldArg)1 Named (jadx.core.dex.instructions.args.Named)1 RegisterArg (jadx.core.dex.instructions.args.RegisterArg)1 CodegenException (jadx.core.utils.exceptions.CodegenException)1