private void completeExceptionHandlers(boolean isOutermost){
  if (method.isSynchronized() && !options.ESCAPE_INVOKEE_THREAD_LOCAL) {
    ExceptionHandlerBasicBlock rethrow=new ExceptionHandlerBasicBlock(SYNTH_CATCH_BCI,inlineSequence,new TypeOperand(RVMType.JavaLangThrowableType),cfg);
    rethrow.setExceptionHandlers(enclosingHandlers);
    RegisterOperand ceo=temps.makeTemp(TypeReference.JavaLangThrowable);
    Instruction s=Nullary.create(GET_CAUGHT_EXCEPTION,ceo);
    appendInstruction(rethrow,s,SYNTH_CATCH_BCI);
    Operand lockObject=getLockObject();
    RVMMethod target=Entrypoints.unlockAndThrowMethod;
    MethodOperand methodOp=MethodOperand.STATIC(target);
    methodOp.setIsNonReturningCall(true);
    s=Call.create2(CALL,null,new AddressConstantOperand(target.getOffset()),methodOp,lockObject,ceo.copyD2U());
    appendInstruction(rethrow,s,RUNTIME_SERVICES_BCI);
    cfg.insertBeforeInCodeOrder(epilogue,rethrow);
    if (enclosingHandlers != null) {
      for (Enumeration<BasicBlock> e=enclosingHandlers.enumerator(); e.hasMoreElements(); ) {
        BasicBlock eh=e.nextElement();
        rethrow.insertOut(eh);
      }
    }
    rethrow.setCanThrowExceptions();
    rethrow.setMayThrowUncaughtException();
    rethrow.insertOut(exit);
    unlockAndRethrow=rethrow;
    ExceptionHandlerBasicBlock[] sh=new ExceptionHandlerBasicBlock[1];
    sh[0]=rethrow;
    enclosingHandlers=new ExceptionHandlerBasicBlockBag(sh,enclosingHandlers);
    generatedExceptionHandlers=true;
  }
}

private void completeExceptionHandlers ( boolean isOutermost ) { if ( method . isSynchronized ( ) && ! options . ESCAPE_INVOKEE_THREAD_LOCAL ) { ExceptionHandlerBasicBlock rethrow = new ExceptionHandlerBasicBlock ( SYNTH_CATCH_BCI , inlineSequence , new TypeOperand ( RVMType . JavaLangThrowableType ) , cfg ) ; rethrow . setExceptionHandlers ( enclosingHandlers ) ; RegisterOperand ceo = temps . makeTemp ( TypeReference . JavaLangThrowable ) ; Instruction s = Nullary . create ( GET_CAUGHT_EXCEPTION , ceo ) ; appendInstruction ( rethrow , s , SYNTH_CATCH_BCI ) ; Operand lockObject = getLockObject ( ) ; RVMMethod target = Entrypoints . unlockAndThrowMethod ; MethodOperand methodOp = MethodOperand . STATIC ( target ) ; methodOp . setIsNonReturningCall ( true ) ; s = Call . create2 ( CALL , null , new AddressConstantOperand ( target . getOffset ( ) ) , methodOp , lockObject , ceo . copyD2U ( ) ) ; appendInstruction ( rethrow , s , RUNTIME_SERVICES_BCI ) ; cfg . insertBeforeInCodeOrder ( epilogue , rethrow ) ; if ( enclosingHandlers != null ) { for ( Enumeration < BasicBlock > e = enclosingHandlers . enumerator ( ) ; e . hasMoreElements ( ) ; ) { BasicBlock eh = e . nextElement ( ) ; rethrow . insertOut ( eh ) ; } } rethrow . setCanThrowExceptions ( ) ; rethrow . setMayThrowUncaughtException ( ) ; rethrow . insertOut ( exit ) ; unlockAndRethrow = rethrow ; ExceptionHandlerBasicBlock [ ] sh = new ExceptionHandlerBasicBlock [ 1 ] ; sh [ 0 ] = rethrow ; enclosingHandlers = new ExceptionHandlerBasicBlockBag ( sh , enclosingHandlers ) ; generatedExceptionHandlers = true ; } }
if the method is synchronized then we wrap it in a synthetic exception handler that unlocks & amp ; rethrows precondition : cfg , arguments & amp ; temps have been setup / initialized .
