use of org.jikesrvm.compilers.opt.ir.operand.Operand in project JikesRVM by JikesRVM.
the class ValueGraph method processPrologue.
/**
* Update the value graph to account for an IR_PROLOGUE instruction
*
* <p><b>PRECONDITION:</b> <code> Prologue.conforms(s); </code>
*
* @param s the instruction in question
*/
private void processPrologue(Instruction s) {
int numArgs = 0;
for (Enumeration<Operand> e = s.getDefs(); e.hasMoreElements(); numArgs++) {
Register formal = ((RegisterOperand) e.nextElement()).getRegister();
ValueGraphVertex v = findOrCreateVertex(formal);
v.setLabel(new ValueGraphParamLabel(numArgs), 0);
}
}
use of org.jikesrvm.compilers.opt.ir.operand.Operand in project JikesRVM by JikesRVM.
the class ValueGraph method processGuardedBinary.
/**
* Update the value graph to account for a given GuardedBinary instruction.
*
* <p><b>PRECONDITION:</b> <code> GuardedBinary.conforms(s); </code>
*
* Careful: we define two Guarded Binaries to be equivalent regardless of
* whether the guards are equivalent!
*
* @param s the instruction in question
*/
private void processGuardedBinary(Instruction s) {
// label the vertex corresponding to the result with the operator
RegisterOperand result = GuardedBinary.getResult(s);
ValueGraphVertex v = findOrCreateVertex(result.getRegister());
v.setLabel(s.operator(), 2);
// link node v to the two operands it uses
// first link the first val
Operand val = GuardedBinary.getVal1(s);
val = bypassMoves(val);
link(v, findOrCreateVertex(val), 0);
Operand val2 = GuardedBinary.getVal2(s);
val2 = bypassMoves(val2);
link(v, findOrCreateVertex(val2), 1);
}
use of org.jikesrvm.compilers.opt.ir.operand.Operand in project JikesRVM by JikesRVM.
the class ValueGraph method processUnary.
/**
* Update the value graph to account for a given Unary instruction.
*
* <p><b>PRECONDITION:</b> <code> Unary.conforms(s); </code>
*
* @param s the instruction in question
*/
private void processUnary(Instruction s) {
// label the vertex corresponding to the result with the operator
RegisterOperand result = Unary.getResult(s);
ValueGraphVertex v = findOrCreateVertex(result.getRegister());
v.setLabel(s.operator(), 1);
// link node v to the operand it uses
Operand val = Unary.getVal(s);
// bypass Move instructions
val = bypassMoves(val);
link(v, findOrCreateVertex(val), 0);
}
use of org.jikesrvm.compilers.opt.ir.operand.Operand in project JikesRVM by JikesRVM.
the class ValueGraph method processAStore.
/**
* Update the value graph to account for a given ASTORE instruction.
*
* <p><b>PRECONDITION:</b> <code> AStore.conforms(s); </code>
*
* Make sure we have value graph nodes for a constant value
*
* @param s the instruction in question
*/
private void processAStore(Instruction s) {
Operand value = AStore.getValue(s);
if (value.isConstant()) {
findOrCreateVertex((ConstantOperand) value);
}
Operand index = AStore.getIndex(s);
if (index.isConstant()) {
findOrCreateVertex((ConstantOperand) index);
}
}
use of org.jikesrvm.compilers.opt.ir.operand.Operand in project JikesRVM by JikesRVM.
the class ValueGraph method processZeroCheck.
/**
* Update the value graph to account for a given NullCheck instruction.
*
* <p><b>PRECONDITION:</b> <code> ZeroCheck.conforms(s); </code>
*
* @param s the instruction in question
*/
private void processZeroCheck(Instruction s) {
// label the vertex corresponding to the result with the operator
RegisterOperand result = ZeroCheck.getGuardResult(s);
ValueGraphVertex v = findOrCreateVertex(result.getRegister());
v.setLabel(s.operator(), 1);
// link node v to the operand it uses
Operand val = ZeroCheck.getValue(s);
// bypass Move instructions
val = bypassMoves(val);
link(v, findOrCreateVertex(val), 0);
}
Aggregations