use of org.jikesrvm.compilers.opt.ir.operand.TIBConstantOperand in project JikesRVM by JikesRVM.
the class Simplifier method getSuperclassIdsFromTib.
private static DefUseEffect getSuperclassIdsFromTib(Instruction s, OptOptions opts) {
if (opts.SIMPLIFY_TIB_OPS) {
Operand tibOp = Unary.getVal(s);
if (tibOp.isTIBConstant()) {
TIBConstantOperand tib = tibOp.asTIBConstant();
Move.mutate(s, REF_MOVE, Unary.getClearResult(s), new ObjectConstantOperand(tib.value.getSuperclassIds(), Offset.zero()));
return DefUseEffect.MOVE_FOLDED;
}
}
return DefUseEffect.UNCHANGED;
}
use of org.jikesrvm.compilers.opt.ir.operand.TIBConstantOperand in project JikesRVM by JikesRVM.
the class Simplifier method getTypeFromTib.
private static DefUseEffect getTypeFromTib(Instruction s, OptOptions opts) {
if (opts.SIMPLIFY_TIB_OPS) {
Operand tibOp = Unary.getVal(s);
if (tibOp.isTIBConstant()) {
TIBConstantOperand tib = tibOp.asTIBConstant();
Move.mutate(s, REF_MOVE, Unary.getClearResult(s), new ObjectConstantOperand(tib.value, Offset.zero()));
return DefUseEffect.MOVE_FOLDED;
}
}
return DefUseEffect.UNCHANGED;
}
use of org.jikesrvm.compilers.opt.ir.operand.TIBConstantOperand in project JikesRVM by JikesRVM.
the class Simplifier method getDoesImplementFromTib.
private static DefUseEffect getDoesImplementFromTib(Instruction s, OptOptions opts) {
if (opts.SIMPLIFY_TIB_OPS) {
Operand tibOp = Unary.getVal(s);
if (tibOp.isTIBConstant()) {
TIBConstantOperand tib = tibOp.asTIBConstant();
Move.mutate(s, REF_MOVE, Unary.getClearResult(s), new ObjectConstantOperand(tib.value.getDoesImplement(), Offset.zero()));
return DefUseEffect.MOVE_FOLDED;
}
}
return DefUseEffect.UNCHANGED;
}
use of org.jikesrvm.compilers.opt.ir.operand.TIBConstantOperand in project JikesRVM by JikesRVM.
the class Simplifier method getObjTib.
private static DefUseEffect getObjTib(Instruction s, OptOptions opts) {
if (opts.SIMPLIFY_TIB_OPS) {
Operand op = GuardedUnary.getVal(s);
if (op.isNullConstant()) {
// Simplify to an unreachable operand, this instruction is dead code
// guarded by a nullcheck that should already have been simplified
RegisterOperand result = GetField.getClearResult(s);
Move.mutate(s, IRTools.getMoveOp(result.getType()), result, new UnreachableOperand());
return DefUseEffect.MOVE_FOLDED;
} else if (op.isConstant()) {
final TypeReference typeRef = op.getType();
if (typeRef.isResolved()) {
Move.mutate(s, REF_MOVE, GuardedUnary.getClearResult(s), new TIBConstantOperand(op.getType().peekType()));
return DefUseEffect.MOVE_FOLDED;
}
} else {
RegisterOperand rop = op.asRegister();
TypeReference typeRef = rop.getType();
// Is the type of this register only one possible type?
if (typeRef.isResolved() && rop.isPreciseType() && typeRef.resolve().isInstantiated()) {
// before simplifying ensure that the type is instantiated, this stops
// constant propagation potentially moving the TIB constant before the
// runtime call that instantiates it
Move.mutate(s, REF_MOVE, GuardedUnary.getClearResult(s), new TIBConstantOperand(typeRef.peekType()));
return DefUseEffect.MOVE_FOLDED;
}
}
}
return DefUseEffect.UNCHANGED;
}
use of org.jikesrvm.compilers.opt.ir.operand.TIBConstantOperand in project JikesRVM by JikesRVM.
the class Simplifier method getArrayElementTibFromTib.
private static DefUseEffect getArrayElementTibFromTib(Instruction s, OptOptions opts) {
if (opts.SIMPLIFY_TIB_OPS) {
Operand tibOp = Unary.getVal(s);
if (tibOp.isTIBConstant()) {
TIBConstantOperand tib = tibOp.asTIBConstant();
Move.mutate(s, REF_MOVE, Unary.getClearResult(s), new TIBConstantOperand(tib.value.asArray().getElementType()));
return DefUseEffect.MOVE_FOLDED;
}
}
return DefUseEffect.UNCHANGED;
}
Aggregations