FileDocCategorySizeDatePackage
Form21h.javaAPI DocAndroid 5.1 API3772Thu Mar 12 22:18:30 GMT 2015com.android.dexgen.dex.code.form

Form21h

public final class Form21h extends com.android.dexgen.dex.code.InsnFormat
Instruction format {@code 21h}. See the instruction format spec for details.

Fields Summary
public static final com.android.dexgen.dex.code.InsnFormat
THE_ONE
{@code non-null;} unique instance of this class
Constructors Summary
private Form21h()
Constructs an instance. This class is not publicly instantiable. Use {@link #THE_ONE}.


                     
      
        // This space intentionally left blank.
    
Methods Summary
public intcodeSize()
{@inheritDoc}

        return 2;
    
public java.lang.StringinsnArgString(com.android.dexgen.dex.code.DalvInsn insn)
{@inheritDoc}

        RegisterSpecList regs = insn.getRegisters();
        CstLiteralBits value = (CstLiteralBits) ((CstInsn) insn).getConstant();

        return regs.get(0).regString() + ", " + literalBitsString(value);
    
public java.lang.StringinsnCommentString(com.android.dexgen.dex.code.DalvInsn insn, boolean noteIndices)
{@inheritDoc}

        RegisterSpecList regs = insn.getRegisters();
        CstLiteralBits value = (CstLiteralBits) ((CstInsn) insn).getConstant();

        return
            literalBitsComment(value,
                    (regs.get(0).getCategory() == 1) ? 32 : 64);
    
public booleanisCompatible(com.android.dexgen.dex.code.DalvInsn insn)
{@inheritDoc}

        RegisterSpecList regs = insn.getRegisters();
        if (!((insn instanceof CstInsn) &&
              (regs.size() == 1) &&
              unsignedFitsInByte(regs.get(0).getReg()))) {
            return false;
        }

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

        if (!(cst instanceof CstLiteralBits)) {
            return false;
        }

        CstLiteralBits cb = (CstLiteralBits) cst;

        // Where the high bits are depends on the category of the target.
        if (regs.get(0).getCategory() == 1) {
            int bits = cb.getIntBits();
            return ((bits & 0xffff) == 0);
        } else {
            long bits = cb.getLongBits();
            return ((bits & 0xffffffffffffL) == 0);
        }
    
public com.android.dexgen.dex.code.InsnFormatnextUp()
{@inheritDoc}

        return Form31i.THE_ONE;
    
public voidwriteTo(com.android.dexgen.util.AnnotatedOutput out, com.android.dexgen.dex.code.DalvInsn insn)
{@inheritDoc}

        RegisterSpecList regs = insn.getRegisters();
        CstLiteralBits cb = (CstLiteralBits) ((CstInsn) insn).getConstant();
        short bits;

        // Where the high bits are depends on the category of the target.
        if (regs.get(0).getCategory() == 1) {
            bits = (short) (cb.getIntBits() >>> 16);
        } else {
            bits = (short) (cb.getLongBits() >>> 48);
        }

        write(out, opcodeUnit(insn, regs.get(0).getReg()), bits);