FileDocCategorySizeDatePackage
Form21s.javaAPI DocAndroid 1.5 API3137Wed May 06 22:41:02 BST 2009com.android.dx.dex.code.form

Form21s

public final class Form21s extends com.android.dx.dex.code.InsnFormat
Instruction format 21s. See the instruction format spec for details.

Fields Summary
public static final com.android.dx.dex.code.InsnFormat
THE_ONE
non-null; unique instance of this class
Constructors Summary
private Form21s()
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.dx.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.dx.dex.code.DalvInsn insn, boolean noteIndices)
{@inheritDoc}

        CstLiteralBits value = (CstLiteralBits) ((CstInsn) insn).getConstant();
        return literalBitsComment(value, 16);
    
public booleanisCompatible(com.android.dx.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;

        return cb.fitsInInt() && signedFitsInShort(cb.getIntBits());
    
public com.android.dx.dex.code.InsnFormatnextUp()
{@inheritDoc}

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

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

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