use of org.jikesrvm.compilers.opt.dfsolver.DF_LatticeCell in project JikesRVM by JikesRVM.
the class IndexPropagationSystem method processPhi.
/**
* Update the set of dataflow equations to account for the actions
* of Phi instruction.
*
* <p> The instruction has the form A1 = PHI (A2, A3, A4);
* We add the dataflow equation
* L(A1) = MEET(L(A2), L(A3), L(A4))
*
* @param s the Phi instruction
*/
void processPhi(Instruction s) {
Operand result = Phi.getResult(s);
if (!(result instanceof HeapOperand)) {
return;
}
HeapVariable<?> lhs = ((HeapOperand<?>) result).value;
DF_LatticeCell A1 = findOrCreateCell(lhs);
DF_LatticeCell[] rhs = new DF_LatticeCell[Phi.getNumberOfValues(s)];
for (int i = 0; i < rhs.length; i++) {
HeapOperand<?> op = (HeapOperand<?>) Phi.getValue(s, i);
rhs[i] = findOrCreateCell(op.value);
}
newEquation(A1, MEET, rhs);
}
use of org.jikesrvm.compilers.opt.dfsolver.DF_LatticeCell in project JikesRVM by JikesRVM.
the class IndexPropagationSystem method addUpdateObjectUseEquation.
/**
* Add an equation to the system of the form
* <pre>
* L(A1) = updateUse(L(A2), VALNUM(address))
* </pre>
*
* @param A1 variable in the equation
* @param A2 variable in the equation
* @param valueNumber value number of address
*/
void addUpdateObjectUseEquation(HeapVariable<?> A1, HeapVariable<?> A2, int valueNumber) {
DF_LatticeCell cell1 = findOrCreateCell(A1);
DF_LatticeCell cell2 = findOrCreateCell(A2);
UpdateUseObjectOperator op = new UpdateUseObjectOperator(valueNumber);
newEquation(cell1, op, cell2);
}
use of org.jikesrvm.compilers.opt.dfsolver.DF_LatticeCell in project JikesRVM by JikesRVM.
the class IndexPropagationSystem method addUpdateArrayUseEquation.
/**
* Add an equation to the system of the form
* <pre>
* L(A1) = updateUse(L(A2), <VALNUM(array),VALNUM(index)>)
* </pre>
*
* @param A1 variable in the equation
* @param A2 variable in the equation
* @param array variable in the equation
* @param index variable in the equation
*/
void addUpdateArrayUseEquation(HeapVariable<?> A1, HeapVariable<?> A2, Object array, Object index) {
DF_LatticeCell cell1 = findOrCreateCell(A1);
DF_LatticeCell cell2 = findOrCreateCell(A2);
int arrayNumber = valueNumbers.getValueNumber(array);
int indexNumber = valueNumbers.getValueNumber(index);
UpdateUseArrayOperator op = new UpdateUseArrayOperator(arrayNumber, indexNumber);
newEquation(cell1, op, cell2);
}
use of org.jikesrvm.compilers.opt.dfsolver.DF_LatticeCell in project JikesRVM by JikesRVM.
the class IndexPropagationSystem method addUpdateObjectDefEquation.
/**
* Add an equation to the system of the form
* L(A1) = updateDef(L(A2), VALNUM(address))
*
* @param A1 variable in the equation
* @param A2 variable in the equation
* @param valueNumber value number of the address
*/
void addUpdateObjectDefEquation(HeapVariable<?> A1, HeapVariable<?> A2, int valueNumber) {
DF_LatticeCell cell1 = findOrCreateCell(A1);
DF_LatticeCell cell2 = findOrCreateCell(A2);
UpdateDefObjectOperator op = new UpdateDefObjectOperator(valueNumber);
newEquation(cell1, op, cell2);
}
use of org.jikesrvm.compilers.opt.dfsolver.DF_LatticeCell in project JikesRVM by JikesRVM.
the class IndexPropagationSystem method initializeLatticeCells.
/**
* Initialize the lattice variables.
*/
@Override
protected void initializeLatticeCells() {
// set the lattice cells that are exposed on entry to BOTTOM
for (DF_LatticeCell c : cells.values()) {
if (c instanceof ObjectCell) {
ObjectCell c1 = (ObjectCell) c;
HeapVariable<?> key = c1.getKey();
if (key.isExposedOnEntry()) {
c1.setBOTTOM();
}
} else {
ArrayCell c1 = (ArrayCell) c;
HeapVariable<?> key = c1.getKey();
if (key.isExposedOnEntry()) {
c1.setBOTTOM();
}
}
}
}
Aggregations