Search in sources :

Example 11 with TypeOperand

use of org.jikesrvm.compilers.opt.ir.operand.TypeOperand in project JikesRVM by JikesRVM.

the class ExceptionHandlerBasicBlock method mayCatchException.

/**
 * Return YES/NO/MAYBE values that answer the question is it possible for
 * this handler block to catch an exception of the type et.
 *
 * @param cand the TypeReference of the exception in question.
 * @return YES, NO, MAYBE
 */
public byte mayCatchException(TypeReference cand) {
    boolean seenMaybe = false;
    byte t;
    for (TypeOperand exceptionType : exceptionTypes) {
        t = ClassLoaderProxy.includesType(exceptionType.getTypeRef(), cand);
        if (t == YES)
            return YES;
        seenMaybe |= (t == MAYBE);
        t = ClassLoaderProxy.includesType(cand, exceptionType.getTypeRef());
        if (t == YES)
            return YES;
        seenMaybe |= (t == MAYBE);
    }
    return seenMaybe ? MAYBE : NO;
}
Also used : TypeOperand(org.jikesrvm.compilers.opt.ir.operand.TypeOperand)

Aggregations

TypeOperand (org.jikesrvm.compilers.opt.ir.operand.TypeOperand)11 Instruction (org.jikesrvm.compilers.opt.ir.Instruction)7 RegisterOperand (org.jikesrvm.compilers.opt.ir.operand.RegisterOperand)6 MethodOperand (org.jikesrvm.compilers.opt.ir.operand.MethodOperand)5 Operand (org.jikesrvm.compilers.opt.ir.operand.Operand)5 RVMMethod (org.jikesrvm.classloader.RVMMethod)4 RVMType (org.jikesrvm.classloader.RVMType)4 BasicBlock (org.jikesrvm.compilers.opt.ir.BasicBlock)4 ExceptionHandlerBasicBlock (org.jikesrvm.compilers.opt.ir.ExceptionHandlerBasicBlock)4 RVMClass (org.jikesrvm.classloader.RVMClass)3 TypeReference (org.jikesrvm.classloader.TypeReference)3 BranchProfileOperand (org.jikesrvm.compilers.opt.ir.operand.BranchProfileOperand)3 IntConstantOperand (org.jikesrvm.compilers.opt.ir.operand.IntConstantOperand)3 TrueGuardOperand (org.jikesrvm.compilers.opt.ir.operand.TrueGuardOperand)3 FieldReference (org.jikesrvm.classloader.FieldReference)2 RVMField (org.jikesrvm.classloader.RVMField)2 Operator (org.jikesrvm.compilers.opt.ir.Operator)2 AddressConstantOperand (org.jikesrvm.compilers.opt.ir.operand.AddressConstantOperand)2 ClassConstantOperand (org.jikesrvm.compilers.opt.ir.operand.ClassConstantOperand)2 ConditionOperand (org.jikesrvm.compilers.opt.ir.operand.ConditionOperand)2