Top Description Fields Constructors Methods
org.droidparts.dexmaker.dx.dex.code

public final Class HighRegisterPrefix

extends VariableSizeInsn
Class Inheritance
Imports
org.droidparts.dexmaker.dx.rop.code.RegisterSpec, .RegisterSpecList, .SourcePosition, org.droidparts.dexmaker.dx.util.AnnotatedOutput

Combination instruction which turns into a variable number of move* instructions to move a set of registers into registers starting at 0 sequentially. This is used in translating an instruction whose register requirements cannot be met using a straightforward choice of a single opcode.

Field Summary

Modifier and TypeField and Description
private SimpleInsn[]
insns

null-ok; cached instructions, if constructed

Constructor Summary

AccessConstructor and Description
public
HighRegisterPrefix(SourcePosition
non-null; source position
position
,
RegisterSpecList
non-null; source registers
registers
)

Constructs an instance.

Method Summary

Modifier and TypeMethod and Description
protected String
argString()

Implements abstract org.droidparts.dexmaker.dx.dex.code.DalvInsn.argString.

Gets the string form for any arguments to this instance.
private void
calculateInsnsIfNecessary()

Helper for codeSize and writeTo which sets up insns if not already done.

public int
codeSize()

Implements abstract org.droidparts.dexmaker.dx.dex.code.DalvInsn.codeSize.

Gets the size of this instruction, in 16-bit code units.
protected String
listingString0(boolean
whether to include an explicit notation of constant pool indices
noteIndices
)

Implements abstract org.droidparts.dexmaker.dx.dex.code.DalvInsn.listingString0.

Helper for listingString, which returns the string form of this instance suitable for inclusion in a human-oriented listing dump, not including the instruction address and without respect for any output formatting.
private static SimpleInsn

Returns:

non-null; the appropriate move instruction
moveInsnFor
(RegisterSpec
non-null; the source register spec
src
,
int
>= 0; the destination register index
destIndex
)

Returns the proper move instruction for the given source spec and destination index.

public DalvInsn
withRegisters(RegisterSpecList
non-null; new register list
registers
)

Implements abstract org.droidparts.dexmaker.dx.dex.code.DalvInsn.withRegisters.

Returns an instance that is just like this one, except that the register list is replaced by the given one, and its address is reset.
public void
writeTo(AnnotatedOutput
non-null; where to write to
out
)

Implements abstract org.droidparts.dexmaker.dx.dex.code.DalvInsn.writeTo.

Writes this instance to the given output.
Inherited from org.droidparts.dexmaker.dx.dex.code.VariableSizeInsn:
withOpcodewithRegisterOffset

Field Detail

insnsback to summary
private SimpleInsn[] insns

null-ok; cached instructions, if constructed

Constructor Detail

HighRegisterPrefixback to summary
public HighRegisterPrefix(SourcePosition position, RegisterSpecList registers)

Constructs an instance. The output address of this instance is initially unknown (-1).

Parameters
position:SourcePosition

non-null; source position

registers:RegisterSpecList

non-null; source registers

Method Detail

argStringback to summary
protected String argString()

Implements abstract org.droidparts.dexmaker.dx.dex.code.DalvInsn.argString.

Doc from org.droidparts.dexmaker.dx.dex.code.DalvInsn.argString.

Gets the string form for any arguments to this instance. Subclasses must override this.

Returns:String

null-ok; the string version of any arguments or null if there are none

Annotations
@Override
calculateInsnsIfNecessaryback to summary
private void calculateInsnsIfNecessary()

Helper for codeSize and writeTo which sets up insns if not already done.

codeSizeback to summary
public int codeSize()

Implements abstract org.droidparts.dexmaker.dx.dex.code.DalvInsn.codeSize.

Doc from org.droidparts.dexmaker.dx.dex.code.DalvInsn.codeSize.

Gets the size of this instruction, in 16-bit code units.

Returns:int

>= 0; the code size of this instruction

Annotations
@Override
listingString0back to summary
protected String listingString0(boolean noteIndices)

Implements abstract org.droidparts.dexmaker.dx.dex.code.DalvInsn.listingString0.

Doc from org.droidparts.dexmaker.dx.dex.code.DalvInsn.listingString0.

Helper for listingString, which returns the string form of this instance suitable for inclusion in a human-oriented listing dump, not including the instruction address and without respect for any output formatting. This method should return null if this instance should not appear in a listing.

Parameters
noteIndices:boolean

whether to include an explicit notation of constant pool indices

Returns:String

null-ok; the listing string

Annotations
@Override
moveInsnForback to summary
private static SimpleInsn moveInsnFor(RegisterSpec src, int destIndex)

Returns the proper move instruction for the given source spec and destination index.

Parameters
src:RegisterSpec

non-null; the source register spec

destIndex:int

>= 0; the destination register index

Returns:SimpleInsn

non-null; the appropriate move instruction

withRegistersback to summary
public DalvInsn withRegisters(RegisterSpecList registers)

Implements abstract org.droidparts.dexmaker.dx.dex.code.DalvInsn.withRegisters.

Doc from org.droidparts.dexmaker.dx.dex.code.DalvInsn.withRegisters.

Returns an instance that is just like this one, except that the register list is replaced by the given one, and its address is reset.

Parameters
registers:RegisterSpecList

non-null; new register list

Returns:DalvInsn

non-null; an appropriately-constructed instance

Annotations
@Override
writeToback to summary
public void writeTo(AnnotatedOutput out)

Implements abstract org.droidparts.dexmaker.dx.dex.code.DalvInsn.writeTo.

Doc from org.droidparts.dexmaker.dx.dex.code.DalvInsn.writeTo.

Writes this instance to the given output. This method should never annotate the output.

Parameters
out:AnnotatedOutput

non-null; where to write to

Annotations
@Override