final class ShortArrayReplacer extends Object implements AggregateReplacer
Modifier and Type | Field and Description |
---|---|
private IR |
ir
the governing IR
|
private Register |
reg
the register holding the array reference
|
private int |
size
number of elements in the array
|
private RVMArray |
vmArray
type of the array
|
Modifier | Constructor and Description |
---|---|
private |
ShortArrayReplacer(Register r,
RVMArray a,
int s,
IR i) |
Modifier and Type | Method and Description |
---|---|
private static boolean |
containsUnsupportedUse(IR ir,
Register reg,
int size,
RVMArray vmArray,
Set<Register> visited)
Some cases we don't handle yet.
|
static ShortArrayReplacer |
getReplacer(Instruction inst,
IR ir)
Returns an object representing this transformation for a given
allocation site.
|
private void |
scalarReplace(RegisterOperand use,
RegisterOperand[] scalars,
Set<Register> visited)
Replace a given use of an array with its scalar equivalent.
|
void |
transform()
Perform the transformation
|
private void |
transform2(Register reg,
Instruction defI,
RegisterOperand[] scalars) |
private final int size
private ShortArrayReplacer(Register r, RVMArray a, int s, IR i)
r
- the register holding the array referencea
- the type of the array to replaces
- the size of the array to replacei
- the IRpublic static ShortArrayReplacer getReplacer(Instruction inst, IR ir)
inst
- the allocation siteir
- the governing IRnull
if illegalpublic void transform()
AggregateReplacer
transform
in interface AggregateReplacer
private void transform2(Register reg, Instruction defI, RegisterOperand[] scalars)
private void scalarReplace(RegisterOperand use, RegisterOperand[] scalars, Set<Register> visited)
use
- the use to replacescalars
- an array of scalar register operands to replace
the array withvisited
- TODO currently useless. Is this parameter
necessary or should it be removed?private static boolean containsUnsupportedUse(IR ir, Register reg, int size, RVMArray vmArray, Set<Register> visited)
ir
- the governing IRreg
- the register in questionsize
- the size of the array to scalar replace.vmArray
- the array to replacevisited
- the registers that were already visited