Package com.android.dx.dex.code

Examples of com.android.dx.dex.code.TargetInsn


              (regs.size() == 1) &&
              unsignedFitsInByte(regs.get(0).getReg()))) {
            return false;
        }

        TargetInsn ti = (TargetInsn) insn;
        return ti.hasTargetOffset() ? branchFits(ti) : true;
    }
View Full Code Here


              unsignedFitsInNibble(regs.get(0).getReg()) &&
              unsignedFitsInNibble(regs.get(1).getReg()))) {
            return false;
        }

        TargetInsn ti = (TargetInsn) insn;
        return ti.hasTargetOffset() ? branchFits(ti) : true;
    }
View Full Code Here

        if (!((insn instanceof TargetInsn) &&
              (insn.getRegisters().size() == 0))) {
            return false;
        }

        TargetInsn ti = (TargetInsn) insn;
        return ti.hasTargetOffset() ? branchFits(ti) : true;
    }
View Full Code Here

        if (!((insn instanceof TargetInsn) &&
              (insn.getRegisters().size() == 0))) {
            return false;
        }

        TargetInsn ti = (TargetInsn) insn;
        return ti.hasTargetOffset() ? branchFits(ti) : true;
    }
View Full Code Here

    {
      // If the target is generic, we have to assume it might jump into a
      // catch block, so we require splitting.
      if (instructions.get(i) instanceof TargetInsn)
      {
        TargetInsn targetInsn= (TargetInsn) instructions.get(i);
        targets.put(targetInsn.getTargetAddress(), new Target(targetInsn.getTargetAddress(), true));
      }
      else if (instructions.get(i) instanceof SwitchData)
      {
        // If a switch-statement is enclosed by a try-block, we
        // will also require splitting.
View Full Code Here

        }
      }
    }
    else if (instruction instanceof TargetInsn)
    {
      TargetInsn targetInsn= (TargetInsn) instruction;
      String instructionName= targetInsn.getOpcode().getName();
      dexInstruction= new Element(sanitizeInstructionName(instructionName), NS_DEX);
      addRegistersAsAttributes(targetInsn.getRegisters(), dexInstruction);

      if (instructionName.equals("packed-switch") || instructionName.equals("sparse-switch"))
      {
        SwitchData switchData= switchDataBlocks.get(targetInsn.getTargetAddress());
        if (switchData == null)
        {
          Log.error(TAG, "DEXmlvmOutputProcess: Couldn't find SwitchData block.");
          System.exit(-1);
        }
        IntList cases= switchData.getCases();
        CodeAddress[] caseTargets= switchData.getTargets();

        // Sanity check.
        if (cases.size() != caseTargets.length)
        {
          Log.error(TAG, "DEXmlvmOutputProcess: SwitchData size mismatch: cases vs targets.");
          System.exit(-1);
        }

        for (int i= 0; i < cases.size(); ++i)
        {
          Element caseElement= new Element("case", NS_DEX);
          caseElement.setAttribute("key", String.valueOf(cases.get(i)));
          caseElement.setAttribute("label", String.valueOf(caseTargets[i].getAddress()));
          dexInstruction.addContent(caseElement);
        }
      }
      else if (instructionName.equals("fill-array-data"))
      {
        ArrayList<Constant> data= arrayData.get(targetInsn.getTargetAddress()).getValues();
        for (Constant c : data)
        {
          Element constant= new Element("constant", NS_DEX);
          constant.setAttribute("value", c.toHuman());
          dexInstruction.addContent(constant);
        }
      }
      else
      {
        dexInstruction.setAttribute("target", String.valueOf(targetInsn.getTargetAddress()));
      }
    }
    else if (instruction instanceof HighRegisterPrefix)
    {
      HighRegisterPrefix highRegisterPrefix= (HighRegisterPrefix) instruction;
View Full Code Here

TOP

Related Classes of com.android.dx.dex.code.TargetInsn

Copyright © 2018 www.massapicom. 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.