Examples of InsnNode


Examples of jadx.core.dex.nodes.InsnNode

        SSAVar sVar = arg.getSVar();
        // allow inline only one use arg or 'this'
        if (sVar.getVariableUseCount() != 1 && !arg.isThis()) {
          continue;
        }
        InsnNode assignInsn = sVar.getAssign().getParentInsn();
        if (assignInsn == null || assignInsn.contains(AFlag.DONT_INLINE)) {
          continue;
        }
        int assignPos = insnList.getIndex(assignInsn);
        if (assignPos != -1) {
          WrapInfo wrapInfo = argsInfo.checkInline(assignPos, arg);
View Full Code Here

Examples of jadx.core.dex.nodes.InsnNode

    throw new JadxRuntimeException("Can't process instruction move : " + assignBlock);
  }

  @Deprecated
  public static InsnArg inlineArgument(MethodNode mth, RegisterArg arg) {
    InsnNode assignInsn = arg.getAssignInsn();
    if (assignInsn == null) {
      return null;
    }
    // recursively wrap all instructions
    List<RegisterArg> list = new ArrayList<RegisterArg>();
    List<RegisterArg> args = mth.getArguments(false);
    int i = 0;
    do {
      list.clear();
      assignInsn.getRegisterArgs(list);
      for (RegisterArg rarg : list) {
        InsnNode ai = rarg.getAssignInsn();
        if (ai != assignInsn && ai != null && ai != rarg.getParentInsn()) {
          rarg.wrapInstruction(ai);
        }
      }
      // remove method args
View Full Code Here

Examples of jadx.core.dex.nodes.InsnNode

      for (int i = start; i < to; i++) {
        ArgsInfo argsInfo = argsList.get(i);
        if (argsInfo.getInlinedInsn() == this) {
          continue;
        }
        InsnNode curInsn = argsInfo.insn;
        if (!curInsn.canReorder() || usedArgAssign(curInsn, movedSet)) {
          return false;
        }
      }
      return true;
    }
View Full Code Here

Examples of jadx.core.dex.nodes.InsnNode

        continue;
      }
      for (PhiInsn phi : phiList.getList()) {
        for (int i = 0; i < phi.getArgsCount(); i++) {
          RegisterArg arg = phi.getArg(i);
          InsnNode parentInsn = arg.getAssignInsn();
          if (parentInsn != null
              && parentInsn.getResult() != null
              && parentInsn.contains(AFlag.TRY_LEAVE)) {
            phi.removeArg(arg);
          }
        }
      }
    }
View Full Code Here

Examples of jadx.core.dex.nodes.InsnNode

  private static boolean removeUselessPhi(MethodNode mth) {
    List<PhiInsn> insnToRemove = new ArrayList<PhiInsn>();
    for (SSAVar var : mth.getSVars()) {
      // phi result not used
      if (var.getUseCount() == 0) {
        InsnNode assignInsn = var.getAssign().getParentInsn();
        if (assignInsn != null && assignInsn.getType() == InsnType.PHI) {
          insnToRemove.add((PhiInsn) assignInsn);
        }
      }
    }
    for (BlockNode block : mth.getBasicBlocks()) {
View Full Code Here

Examples of jadx.core.dex.nodes.InsnNode

      }
      if (!mth.getReturnType().equals(ArgType.VOID)
          && mth.getExitBlocks().size() > 1) {
        // fix debug for splitter 'return' instructions
        for (BlockNode exit : mth.getExitBlocks()) {
          InsnNode ret = exit.getInstructions().get(0);
          InsnNode oldRet = insnArr[ret.getOffset()];
          if (oldRet != ret) {
            RegisterArg oldArg = (RegisterArg) oldRet.getArg(0);
            RegisterArg newArg = (RegisterArg) ret.getArg(0);
            newArg.mergeDebugInfo(oldArg.getType(), oldArg.getName());
            ret.setSourceLine(oldRet.getSourceLine());
          }
        }
      }
    }
    mth.unloadInsnArr();
View Full Code Here

Examples of jadx.core.dex.nodes.InsnNode

  }

  private static void removeInsn(MethodNode mth, BlockNode block, PhiInsn phiInsn) {
    Iterator<InsnNode> it = block.getInstructions().iterator();
    while (it.hasNext()) {
      InsnNode insn = it.next();
      if (insn == phiInsn) {
        it.remove();
        return;
      }
    }
View Full Code Here

Examples of jadx.core.dex.nodes.InsnNode

    BlockProcessingHelper.visit(mth);
    mth.finishBasicBlocks();
  }

  private static void splitBasicBlocks(MethodNode mth) {
    InsnNode prevInsn = null;
    Map<Integer, BlockNode> blocksMap = new HashMap<Integer, BlockNode>();
    BlockNode curBlock = startNewBlock(mth, 0);
    mth.setEnterBlock(curBlock);

    // split into blocks
    for (InsnNode insn : mth.getInstructions()) {
      if (insn == null) {
        continue;
      }
      boolean startNew = false;
      if (prevInsn != null) {
        InsnType type = prevInsn.getType();
        if (type == InsnType.GOTO
            || type == InsnType.THROW
            || SEPARATE_INSNS.contains(type)) {

          if (type == InsnType.RETURN || type == InsnType.THROW) {
View Full Code Here

Examples of jdk.internal.org.objectweb.asm.tree.InsnNode

                // Rather than JSRing, we will jump to the inline version and
                // push NULL for what was once the return value. This hack
                // allows us to avoid doing any sort of data flow analysis to
                // figure out which instructions manipulate the old return value
                // pointer which is now known to be unneeded.
                newInstructions.add(new InsnNode(ACONST_NULL));
                newInstructions.add(new JumpInsnNode(GOTO, startlbl));
                newInstructions.add(newinst.returnLabel);

                // Insert this new instantiation into the queue to be emitted
                // later.
View Full Code Here

Examples of nginx.clojure.asm.tree.InsnNode

                // Rather than JSRing, we will jump to the inline version and
                // push NULL for what was once the return value. This hack
                // allows us to avoid doing any sort of data flow analysis to
                // figure out which instructions manipulate the old return value
                // pointer which is now known to be unneeded.
                newInstructions.add(new InsnNode(ACONST_NULL));
                newInstructions.add(new JumpInsnNode(GOTO, startlbl));
                newInstructions.add(newinst.returnLabel);

                // Insert this new instantiation into the queue to be emitted
                // later.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.