Search in sources :

Example 1 with MethodStmtNode

use of com.googlecode.d2j.node.insn.MethodStmtNode in project dex2jar by pxb1988.

the class Dex2IrAdapter method convert.

public IrMethod convert(DexCodeNode codeNode) {
    if (codeNode.tryStmts != null) {
        for (TryCatchNode n : codeNode.tryStmts) {
            n.accept(this);
        }
    }
    if (codeNode.debugNode != null) {
        DexDebugVisitor ddv = this.visitDebug();
        if (ddv != null) {
            codeNode.debugNode.accept(ddv);
            ddv.visitEnd();
        }
    }
    lastIsInvokeOrFilledNewArray = false;
    if (codeNode.totalRegister >= 0) {
        this.visitRegister(codeNode.totalRegister);
    }
    for (DexStmtNode n : codeNode.stmts) {
        n.accept(this);
        if (n instanceof FilledNewArrayStmtNode) {
            lastIsInvokeOrFilledNewArray = true;
        } else if (n instanceof MethodStmtNode) {
            lastIsInvokeOrFilledNewArray = !((MethodStmtNode) n).method.getReturnType().equals("V");
        } else if (!(n instanceof DexLabelStmtNode)) {
            lastIsInvokeOrFilledNewArray = false;
        }
    }
    visitEnd();
    return irMethod;
}
Also used : DexDebugVisitor(com.googlecode.d2j.visitors.DexDebugVisitor) MethodStmtNode(com.googlecode.d2j.node.insn.MethodStmtNode) TryCatchNode(com.googlecode.d2j.node.TryCatchNode) DexStmtNode(com.googlecode.d2j.node.insn.DexStmtNode) DexLabelStmtNode(com.googlecode.d2j.node.insn.DexLabelStmtNode) FilledNewArrayStmtNode(com.googlecode.d2j.node.insn.FilledNewArrayStmtNode)

Aggregations

TryCatchNode (com.googlecode.d2j.node.TryCatchNode)1 DexLabelStmtNode (com.googlecode.d2j.node.insn.DexLabelStmtNode)1 DexStmtNode (com.googlecode.d2j.node.insn.DexStmtNode)1 FilledNewArrayStmtNode (com.googlecode.d2j.node.insn.FilledNewArrayStmtNode)1 MethodStmtNode (com.googlecode.d2j.node.insn.MethodStmtNode)1 DexDebugVisitor (com.googlecode.d2j.visitors.DexDebugVisitor)1