FileDocCategorySizeDatePackage
OddSpacer.javaAPI DocAndroid 5.1 API2173Thu Mar 12 22:18:30 GMT 2015com.android.dx.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.dx.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.dx.rop.code.RegisterSpecList registers)
{@inheritDoc}

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

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