Package com.android.dx.rop.cst

Examples of com.android.dx.rop.cst.Constant


     * @param insn {@code non-null;} a constant-bearing instruction
     * @return {@code non-null;} the string form of the contained constant
     */
    protected static String cstString(DalvInsn insn) {
        CstInsn ci = (CstInsn) insn;
        Constant cst = ci.getConstant();

        return cst.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

     * Parses an annotation value ({@code element_value}) attribute.
     *
     * @return {@code non-null;} the parsed constant value
     */
    public Constant parseValueAttribute() {
        Constant result;
       
        try {
            result = parseValue();

            if (input.available() != 0) {
View Full Code Here

            parsed(2, "element_name: " + elementName.toHuman());
            parsed(0, "value: ");
            changeIndent(1);
        }

        Constant value = parseValue();

        if (observer != null) {
            changeIndent(-1);
        }
View Full Code Here

     *
     * @return {@code non-null;} the parsed value
     */
    private Constant parseConstant() throws IOException {
        int constValueIndex = input.readUnsignedShort();
        Constant value = (Constant) pool.get(constValueIndex);

        if (observer != null) {
            String human = (value instanceof CstUtf8)
                ? ((CstUtf8) value).toQuoted()
                : value.toHuman();
            parsed(2, "constant_value: " + human);
        }

        return value;
    }
View Full Code Here

            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

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

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

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

         */

        int size = staticFields.size();
        while (size > 0) {
            EncodedField field = staticFields.get(size - 1);
            Constant cst = staticValues.get(field);
            if (cst instanceof CstLiteralBits) {
                // Note: CstKnownNull extends CstLiteralBits.
                if (((CstLiteralBits) cst).getLongBits() != 0) {
                    break;
                }
            } else if (cst != null) {
                break;
            }
            size--;
        }

        if (size == 0) {
            return null;
        }
       
        // There is something worth encoding, so build up a result.
       
        CstArray.List list = new CstArray.List(size);
        for (int i = 0; i < size; i++) {
            EncodedField field = staticFields.get(i);
            Constant cst = staticValues.get(field);
            if (cst == null) {
                cst = Zeroes.zeroFor(field.getRef().getType());
            }
            list.set(i, cst);
        }
View Full Code Here

            if (!(insn instanceof CstInsn)) {
                continue;
            }

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

            if (!(cst instanceof CstBaseMethodRef)) {
                continue;
            }
View Full Code Here

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

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

TOP

Related Classes of com.android.dx.rop.cst.Constant

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.