final class ObjectReplacer extends Object implements AggregateReplacer
Modifier and Type | Field and Description |
---|---|
private IR |
ir
the IR
|
private RVMClass |
klass
type of the object
|
private Register |
reg
the register holding the object reference
|
Modifier | Constructor and Description |
---|---|
private |
ObjectReplacer(Register r,
RVMClass _klass,
IR i) |
Modifier and Type | Method and Description |
---|---|
private static boolean |
containsUnsupportedUse(IR ir,
Register reg,
RVMClass klass,
Set<Register> visited)
Some cases we don't handle yet.
|
private static ArrayList<RVMField> |
getFieldsAsArrayList(RVMClass klass)
Returns the instance fields of the object.
|
static ObjectReplacer |
getReplacer(Instruction inst,
IR ir)
Return an object representing this transformation for a given
allocation site
|
private void |
scalarReplace(RegisterOperand use,
RegisterOperand[] scalars,
ArrayList<RVMField> fields,
Set<Register> visited)
Replace a given use of a object with its scalar equivalent
|
void |
transform()
Perform the transformation
|
private void |
transform2(Register reg,
Instruction defI,
RegisterOperand[] scalars,
ArrayList<RVMField> fields,
Set<Register> visited) |
private ObjectReplacer(Register r, RVMClass _klass, IR i)
r
- the register holding the object reference_klass
- the type of the object to replacei
- the IRpublic static ObjectReplacer getReplacer(Instruction inst, IR ir)
inst
- the allocation siteir
- the governing IRpublic void transform()
AggregateReplacer
transform
in interface AggregateReplacer
private void transform2(Register reg, Instruction defI, RegisterOperand[] scalars, ArrayList<RVMField> fields, Set<Register> visited)
private static ArrayList<RVMField> getFieldsAsArrayList(RVMClass klass)
klass
- the type of the objectprivate void scalarReplace(RegisterOperand use, RegisterOperand[] scalars, ArrayList<RVMField> fields, Set<Register> visited)
use
- the use to replacescalars
- an array of scalar register operands to replace
the object's fields withfields
- the object's fieldsvisited
- the registers that were already seenprivate static boolean containsUnsupportedUse(IR ir, Register reg, RVMClass klass, Set<Register> visited)
ir
- the IR to checkreg
- the register whose uses are being checkedklass
- the class of the newly created objectvisited
- registers that were already seentrue
if the IR contains a case that we don't handle yet