Package com.android.dx.dex.code

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


        }

        EncodedMethod toEncodedMethod(DexOptions dexOptions) {
            RopMethod ropMethod = new RopMethod(code.toBasicBlocks(), 0);
            LocalVariableInfo locals = null;
            DalvCode dalvCode = RopTranslator.translate(
                    ropMethod, PositionList.NONE, locals, code.paramSize(), dexOptions);
            return new EncodedMethod(method.constant, flags, dalvCode, StdTypeList.EMPTY);
        }
View Full Code Here


    ConcreteMethod concrete= new ConcreteMethod(method, classFile, false, false);
    TranslationAdvice advice= DexTranslationAdvice.THE_ONE;
    RopMethod rmeth= Ropper.convert(concrete, advice);
    CstMethodRef meth= new CstMethodRef(method.getDefiningClass(), method.getNat());
    int paramSize= meth.getParameterWordCount(isStatic);
    DalvCode code= RopTranslator.translate(rmeth, PositionList.NONE, null, paramSize);
    DalvCode.AssignIndicesCallback callback= new DalvCode.AssignIndicesCallback()
    {
      public int getIndex(Constant cst)
      {
        // Everything is at index 0!
        return 0;
      }
    };
    code.assignIndices(callback);
    return code;
  }
View Full Code Here

                boolean isPrivate = AccessFlags.isPrivate(accessFlags);
                boolean isNative = AccessFlags.isNative(accessFlags);
                boolean isAbstract = AccessFlags.isAbstract(accessFlags);
                boolean isConstructor = meth.isInstanceInit() ||
                    meth.isClassInit();
                DalvCode code;

                if (isNative || isAbstract) {
                    // There's no code for native or abstract methods.
                    code = null;
                } else {
View Full Code Here

         * since converting the "real" method getting added to the
         * file would corrupt it (by messing with its constant pool
         * indices).
         */

        DalvCode optCode = RopTranslator.translate(optRmeth,
                args.positionInfo, locals, paramSize);
        DalvCode nonOptCode = RopTranslator.translate(nonOptRmeth,
                args.positionInfo, locals, paramSize);

        /*
         * Fake out the indices, so code.getInsns() can work well enough
         * for the current purpose.
         */

        DalvCode.AssignIndicesCallback callback =
            new DalvCode.AssignIndicesCallback() {
                public int getIndex(Constant cst) {
                    // Everything is at index 0!
                    return 0;
                }
            };

        optCode.assignIndices(callback);
        nonOptCode.assignIndices(callback);

        CodeStatistics.updateDexStatistics(nonOptCode, optCode);
        CodeStatistics.updateOriginalByteCount(originalByteCount);
    }
View Full Code Here

    if (localInfo)
    {
      locals= LocalVariableExtractor.extract(rmeth);
    }

    DalvCode code= RopTranslator.translate(rmeth, positionInfo, locals, paramSize);
    DalvCode.AssignIndicesCallback callback= new DalvCode.AssignIndicesCallback()
    {
      public int getIndex(Constant cst)
      {
        // Everything is at index 0!
        return 0;
      }
    };
    code.assignIndices(callback);

    DalvInsnList instructions= code.getInsns();
    codeElement.setAttribute("register-size", String.valueOf(instructions.getRegistersSize()));
    processLocals(instructions.getRegistersSize(), isStatic, parseClassName(cf.getThisClass().getClassType().getClassName()).toString(), meth.getPrototype().getParameterTypes(), codeElement);
    Map<Integer, SwitchData> switchDataBlocks= extractSwitchData(instructions);
    Map<Integer, ArrayData> arrayData= extractArrayData(instructions);
    CatchTable catches= code.getCatches();
    processCatchTable(catches, codeElement);
    Map<Integer, Target> targets= extractTargets(instructions, catches);

    // For each entry in the catch table, we create a try-catch element,
    // including the try and all the catch children and append it to the
View Full Code Here

TOP

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

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.