Top Description Fields Constructors Methods
org.droidparts.dexmaker.dx.ssa

public Class BasicRegisterMapper

extends RegisterMapper
Class Inheritance
Known Direct Subclasses
org.droidparts.dexmaker.dx.ssa.InterferenceRegisterMapper
Imports
org.droidparts.dexmaker.dx.rop.code.RegisterSpec, org.droidparts.dexmaker.dx.util.IntList

This class maps one register space into another, with each mapping built up individually and added via addMapping()

Field Summary

Modifier and TypeField and Description
private IntList
oldToNew

indexed by old register, containing new name

private int
runningCountNewRegisters

running count of used registers in new namespace

Constructor Summary

AccessConstructor and Description
public
BasicRegisterMapper(int
the number of registers in the old name space
countOldRegisters
)

Creates a new OneToOneRegisterMapper.

Method Summary

Modifier and TypeMethod and Description
public void
addMapping(int
>= 0; old register
oldReg
,
int
>= 0; new register
newReg
,
int
1..2; width of reg
category
)

Adds a mapping to the mapper.

public int
getNewRegisterCount()

Implements abstract org.droidparts.dexmaker.dx.ssa.RegisterMapper.getNewRegisterCount.

Gets the count of registers (really, the total register width, since category width is counted) in the new namespace.
public RegisterSpec
map(RegisterSpec
old register
registerSpec
)

Implements abstract org.droidparts.dexmaker.dx.ssa.RegisterMapper.map.

public int

Returns:

new-namespace register or -1 if none
oldToNew
(int
>= 0; old-namespace register
oldReg
)

Returns the new-namespace mapping for the specified old-namespace register, or -1 if one exists.

public String
Inherited from org.droidparts.dexmaker.dx.ssa.RegisterMapper:
map

Field Detail

oldToNewback to summary
private IntList oldToNew

indexed by old register, containing new name

runningCountNewRegistersback to summary
private int runningCountNewRegisters

running count of used registers in new namespace

Constructor Detail

BasicRegisterMapperback to summary
public BasicRegisterMapper(int countOldRegisters)

Creates a new OneToOneRegisterMapper.

Parameters
countOldRegisters:int

the number of registers in the old name space

Method Detail

addMappingback to summary
public void addMapping(int oldReg, int newReg, int category)

Adds a mapping to the mapper. If oldReg has already been mapped, overwrites previous mapping with new mapping.

Parameters
oldReg:int

>= 0; old register

newReg:int

>= 0; new register

category:int

1..2; width of reg

getNewRegisterCountback to summary
public int getNewRegisterCount()

Implements abstract org.droidparts.dexmaker.dx.ssa.RegisterMapper.getNewRegisterCount.

Doc from org.droidparts.dexmaker.dx.ssa.RegisterMapper.getNewRegisterCount.

Gets the count of registers (really, the total register width, since category width is counted) in the new namespace.

Returns:int

>= 0 width of new namespace.

Annotations
@Override
mapback to summary
public RegisterSpec map(RegisterSpec registerSpec)

Implements abstract org.droidparts.dexmaker.dx.ssa.RegisterMapper.map.

Parameters
registerSpec:RegisterSpec

Doc from org.droidparts.dexmaker.dx.ssa.RegisterMapper.map.

old register

Returns:RegisterSpec

Doc from org.droidparts.dexmaker.dx.ssa.RegisterMapper.map.

register in new space

Annotations
@Override
oldToNewback to summary
public int oldToNew(int oldReg)

Returns the new-namespace mapping for the specified old-namespace register, or -1 if one exists.

Parameters
oldReg:int

>= 0; old-namespace register

Returns:int

new-namespace register or -1 if none

toHumanback to summary
public String toHuman()