FileDocCategorySizeDatePackage
OddSpacer.javaAPI DocAndroid 5.1 API2155Thu Mar 12 22:18:28 GMT 2015com.android.dexgen.dex.code

OddSpacer

public final class OddSpacer extends VariableSizeInsn
Pseudo-instruction which either turns into a {@code nop} or nothingness, in order to make the subsequent instruction have an even address. This is used to align (subsequent) instructions that require it.

Fields Summary
Constructors Summary
public OddSpacer(com.android.dexgen.rop.code.SourcePosition position)
Constructs an instance. The output address of this instance is initially unknown ({@code -1}).

param
position {@code non-null;} source position

        super(position, RegisterSpecList.EMPTY);
    
Methods Summary
protected java.lang.StringargString()
{@inheritDoc}

        return null;
    
public intcodeSize()
{@inheritDoc}

        return (getAddress() & 1);
    
protected java.lang.StringlistingString0(boolean noteIndices)
{@inheritDoc}

        if (codeSize() == 0) {
            return null;
        }

        return "nop // spacer";
    
public DalvInsnwithRegisters(com.android.dexgen.rop.code.RegisterSpecList registers)
{@inheritDoc}

        return new OddSpacer(getPosition());
    
public voidwriteTo(com.android.dexgen.util.AnnotatedOutput out)
{@inheritDoc}

        if (codeSize() != 0) {
            out.writeShort(InsnFormat.codeUnit(DalvOps.NOP, 0));
        }