use of org.jikesrvm.compilers.opt.ir.operand.TrapCodeOperand in project JikesRVM by JikesRVM.
the class BURS_Helpers method TRAP.
// Take the generic LIR trap and coerce into the limited vocabulary
// understand by C trap handler on PPC. See TrapConstants.java.
protected final void TRAP(Instruction s) {
RegisterOperand gRes = Trap.getClearGuardResult(s);
TrapCodeOperand tc = Trap.getClearTCode(s);
switch(tc.getTrapCode()) {
case RuntimeEntrypoints.TRAP_NULL_POINTER:
{
RVMMethod target = Entrypoints.raiseNullPointerException;
mutateTrapToCall(s, target);
}
break;
case RuntimeEntrypoints.TRAP_ARRAY_BOUNDS:
{
RVMMethod target = Entrypoints.raiseArrayBoundsException;
mutateTrapToCall(s, target);
}
break;
case RuntimeEntrypoints.TRAP_DIVIDE_BY_ZERO:
{
RVMMethod target = Entrypoints.raiseArithmeticException;
mutateTrapToCall(s, target);
}
break;
case RuntimeEntrypoints.TRAP_CHECKCAST:
{
EMIT(MIR_Trap.mutate(s, PPC_TWI, gRes, PowerPCTrapOperand.ALWAYS(), I(12), IC(CHECKCAST_TRAP & 0xffff), tc));
}
break;
case RuntimeEntrypoints.TRAP_MUST_IMPLEMENT:
{
EMIT(MIR_Trap.mutate(s, PPC_TWI, gRes, PowerPCTrapOperand.ALWAYS(), I(12), IC(MUST_IMPLEMENT_TRAP & 0xffff), tc));
}
break;
case RuntimeEntrypoints.TRAP_STORE_CHECK:
{
EMIT(MIR_Trap.mutate(s, PPC_TWI, gRes, PowerPCTrapOperand.ALWAYS(), I(12), IC(STORE_CHECK_TRAP & 0xffff), tc));
}
break;
default:
throw new OptimizingCompilerException("Unexpected case of trap_if" + s);
}
}
Aggregations