Package com.android.dx.dex.code

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


        if (!(insn instanceof CstInsn)) {
            return false;
        }

        CstInsn ci = (CstInsn) insn;
        Constant cst = ci.getConstant();

        if (!((cst instanceof CstMethodRef) ||
              (cst instanceof CstType))) {
            return false;
        }

        RegisterSpecList regs = ci.getRegisters();
        int sz = regs.size();

        return (regs.size() == 0) ||
            (isRegListSequential(regs) &&
             unsignedFitsInShort(regs.get(0).getReg()) &&
View Full Code Here


        if (!unsignedFitsInShort(reg.getReg())) {
            return false;
        }

        CstInsn ci = (CstInsn) insn;
        Constant cst = ci.getConstant();

        return (cst instanceof CstType) ||
            (cst instanceof CstFieldRef);
    }
View Full Code Here

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

        CstInsn ci = (CstInsn) insn;
        Constant cst = ci.getConstant();

        return (cst instanceof CstType) ||
            (cst instanceof CstFieldRef);
    }
View Full Code Here

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

        CstInsn ci = (CstInsn) insn;
        Constant cst = ci.getConstant();

        if (!(cst instanceof CstLiteralBits)) {
            return false;
        }
View Full Code Here

        if (!unsignedFitsInByte(reg.getReg())) {
            return false;
        }

        CstInsn ci = (CstInsn) insn;
        int cpi = ci.getIndex();

        if (! unsignedFitsInShort(cpi)) {
            return false;
        }

        Constant cst = ci.getConstant();
        return (cst instanceof CstType) ||
            (cst instanceof CstFieldRef) ||
            (cst instanceof CstString);
    }
View Full Code Here

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

        CstInsn ci = (CstInsn) insn;
        Constant cst = ci.getConstant();

        if (!(cst instanceof CstLiteralBits)) {
            return false;
        }
View Full Code Here

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

        CstInsn ci = (CstInsn) insn;
        Constant cst = ci.getConstant();

        return (cst instanceof CstLiteral64);
    }
View Full Code Here

  private static void processInstruction(DalvInsn instruction, Dependencies.MethodDeps methodDeps)
  {
    String opname= instruction.getOpcode().getName();
    if (opname.equals("instance-of") || opname.equals("const-class"))
    {
      CstInsn isaInsn= (CstInsn) instruction;
      // TODO: Do we need this?
      // dependencies.add(isaInsn.getConstant().toHuman());
    }

    // TODO: Do we need to add these?
    // RegisterSpecList registers = instruction.getRegisters();
    // for (int i = 0; i < registers.size(); ++i) {
    // RegisterSpec register = registers.get(i);
    // String descriptor = register.getType().getDescriptor();
    // String registerType = register.getType().toHuman();
    // // Sometimes a register type name starts with some info about the
    // // register. We need to cut this out.
    // if (descriptor.startsWith("N")) {
    // registerType = registerType.substring(registerType.indexOf('L') + 1);
    // }
    // methodDeps.addDependency(registerType, "TODO");
    // }

    if (instruction instanceof CstInsn)
    {
      CstInsn cstInsn= (CstInsn) instruction;
      if (isInvokeInstruction(cstInsn))
      {
        // Adds the class that a method references
            CstBaseMethodRef methodRef= (CstBaseMethodRef) cstInsn.getConstant();
        methodDeps.addDependency(methodRef.getDefiningClass().toHuman(), methodRef.getNat().getName().toHuman() + ":" + methodRef.getPrototype().toString());
      }
      else
      {
        Constant constant= cstInsn.getConstant();
        if (constant instanceof CstMemberRef)
        {
          CstMemberRef memberRef= (CstMemberRef) constant;

          methodDeps.addDependency(memberRef.getDefiningClass().getClassType().toHuman(), memberRef.getNat().getName().toHuman());
View Full Code Here

        if (!unsignedFitsInByte(reg.getReg())) {
            return false;
        }

        CstInsn ci = (CstInsn) insn;
        Constant cst = ci.getConstant();

        return ((cst instanceof CstType) ||
                (cst instanceof CstFieldRef) ||
                (cst instanceof CstString));
    }
View Full Code Here

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

        CstInsn ci = (CstInsn) insn;
        int cpi = ci.getIndex();

        if (! unsignedFitsInShort(cpi)) {
            return false;
        }
       
        Constant cst = ci.getConstant();
        return (cst instanceof CstType) ||
            (cst instanceof CstFieldRef);
    }
View Full Code Here

TOP

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

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.