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

Form31c

public final class Form31c extends com.android.dx.dex.code.InsnFormat
Instruction format 31c. 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 Form31c()
Constructs an instance. This class is not publicly instantiable. Use {@link #THE_ONE}.


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

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

        RegisterSpecList regs = insn.getRegisters();
        return regs.get(0).regString() + ", " + cstString(insn);
    
public java.lang.StringinsnCommentString(com.android.dx.dex.code.DalvInsn insn, boolean noteIndices)
{@inheritDoc}

        if (noteIndices) {
            return cstComment(insn);
        } else {
            return "";
        }
    
public booleanisCompatible(com.android.dx.dex.code.DalvInsn insn)
{@inheritDoc}

        if (!(insn instanceof CstInsn)) {
            return false;
        }

        RegisterSpecList regs = insn.getRegisters();
        RegisterSpec reg;

        switch (regs.size()) {
            case 1: {
                reg = regs.get(0);
                break;
            }
            case 2: {
                /*
                 * This format is allowed for ops that are effectively
                 * 2-arg but where the two args are identical.
                 */
                reg = regs.get(0);
                if (reg.getReg() != regs.get(1).getReg()) {
                    return false;
                }
                break;
            }
            default: {
                return false;
            }
        }

        if (!unsignedFitsInByte(reg.getReg())) {
            return false;
        }

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

        return ((cst instanceof CstType) ||
                (cst instanceof CstFieldRef) ||
                (cst instanceof CstString));
    
public com.android.dx.dex.code.InsnFormatnextUp()
{@inheritDoc}

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

        RegisterSpecList regs = insn.getRegisters();
        int cpi = ((CstInsn) insn).getIndex();

        write(out,
                opcodeUnit(insn, regs.get(0).getReg()),
                (short) cpi,
                (short) (cpi >> 16));