Package com.android.dx.rop.type

Examples of com.android.dx.rop.type.TypeList


    classElement.setAttribute("extends", superClassName);

    processAccessFlags(cf.getAccessFlags(), classElement);

    TypeList interfaces= cf.getInterfaces();
    if (interfaces.size() > 0)
    {
      String interfaceList= "";
      for (int i= 0; i < interfaces.size(); ++i)
      {
        if (i > 0)
        {
          interfaceList+= ",";
        }
        String interfaceName= parseClassName(interfaces.getType(i).getClassName()).toString();
        interfaceList+= interfaceName;
        addReference(referencedTypes, interfaceName, ReferenceKind.INTERFACE);
      }
      classElement.setAttribute("interfaces", interfaceList);
    }
View Full Code Here


        String superClassName= Util.parseClassName(classFile.getSuperclass().getClassType().getClassName()).toString();
        result.addDirectSubType(className, superClassName);
      }

      // Interfaces
      TypeList interfaces= classFile.getInterfaces();
      if (interfaces != null)
      {
        for (int i= 0; i < interfaces.size(); i++)
        {
          String interfaceName= Util.parseClassName(interfaces.getType(i).getClassName()).toString();
          result.addDirectSubType(className, interfaceName);
        }
      }
    }
    return result;
View Full Code Here

        if (length != (count * 2)) {
            throwBadLength((count * 2) + 2);
        }

        TypeList list = cf.makeTypeList(offset, count);
        return new AttExceptions(list);
    }
View Full Code Here

    }   

    /** {@inheritDoc} */
    @Override
    protected int compareTo0(OffsettedItem other) {
        TypeList thisList = this.list;
        TypeList otherList = ((TypeListItem) other).list;

        return StdTypeList.compareContents(thisList, otherList);
    }
View Full Code Here

      superClass.add(superClassName.replace('/', '.'));
      classDeps.getMethodDeps("SUPER").addDependency(superClassName.replace('/', '.'), "");
    }

    // Interfaces
    TypeList interfaces= classFile.getInterfaces();
    if (interfaces.size() > 0)
    {
      Set<String> interfaceList= new HashSet<String>();
      for (int i= 0; i < interfaces.size(); ++i)
      {
        interfaceList.add(Util.parseClassName(interfaces.getType(i).getClassName()).toString());
        classDeps.getMethodDeps("INTERFACES").addDependency(Util.parseClassName(interfaces.getType(i).getClassName()).toString(), "");
      }
    }

    // Methods
    MethodList methods= classFile.getMethods();
View Full Code Here

            label = nextLabel;
        }

        InsnList insns = new InsnList(1);
        TypeList sourceTypes = returnOp.getSources();
        RegisterSpecList sources;

        if (sourceTypes.size() == 0) {
            sources = RegisterSpecList.EMPTY;
        } else {
            RegisterSpec source = RegisterSpec.make(0, sourceTypes.getType(0));
            sources = RegisterSpecList.make(source);
        }

        Insn insn = new PlainInsn(returnOp, returnPos, null, sources);
        insns.set(0, insn);
View Full Code Here

        BasicBlockList blocks = method.getBlocks();
        int size = blocks.size();
       
        for (int i = 0; i < size; i++) {
            BasicBlock block = blocks.get(i);
            TypeList catches = block.getLastInsn().getCatches();
            if (catches.size() != 0) {
                return true;
            }
        }

        return false;
View Full Code Here

        BasicBlockList blocks = method.getBlocks();
        int size = blocks.size();
       
        for (int i = 0; i < size; i++) {
            BasicBlock block = blocks.get(i);
            TypeList catches = block.getLastInsn().getCatches();
            int catchSize = catches.size();

            for (int j = 0; j < catchSize; j++) {
                result.add(catches.getType(j));
            }
        }

        return result;
    }
View Full Code Here

    private static CatchHandlerList handlersFor(BasicBlock block,
            BlockAddresses addresses) {
        IntList successors = block.getSuccessors();
        int succSize = successors.size();
        int primary = block.getPrimarySuccessor();
        TypeList catches = block.getLastInsn().getCatches();
        int catchSize = catches.size();

        if (catchSize == 0) {
            return CatchHandlerList.EMPTY;
        }

        if (((primary == -1) && (succSize != catchSize))
                || ((primary != -1) &&
                        ((succSize != (catchSize + 1))
                                || (primary != successors.get(catchSize))))) {
            /*
             * Blocks that throw are supposed to list their primary
             * successor -- if any -- last in the successors list, but
             * that constraint appears to be violated here.
             */
            throw new RuntimeException(
                    "shouldn't happen: weird successors list");
        }

        /*
         * Reduce the effective catchSize if we spot a catch-all that
         * isn't at the end.
         */
        for (int i = 0; i < catchSize; i++) {
            Type type = catches.getType(i);
            if (type.equals(Type.OBJECT)) {
                catchSize = i + 1;
                break;
            }
        }
       
        CatchHandlerList result = new CatchHandlerList(catchSize);

        for (int i = 0; i < catchSize; i++) {
            CstType oneType = new CstType(catches.getType(i));
            CodeAddress oneHandler = addresses.getStart(successors.get(i));
            result.set(i, oneType, oneHandler.getAddress());
        }

        result.setImmutable();
View Full Code Here

               
                if (isConstructor) {
                    accessFlags |= AccessFlags.ACC_CONSTRUCTOR;
                }

                TypeList exceptions = AttributeTranslator.getExceptions(one);
                EncodedMethod mi =
                    new EncodedMethod(meth, accessFlags, code, exceptions);

                if (meth.isInstanceInit() || meth.isClassInit() ||
                    isStatic || isPrivate) {
View Full Code Here

TOP

Related Classes of com.android.dx.rop.type.TypeList

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.