joeq.Compiler.Quad
Class ExceptionHandler

java.lang.Object
  extended by joeq.Compiler.Quad.ExceptionHandler

public class ExceptionHandler
extends Object

Exception handler for basic blocks. Each exception handler handles a type of exception. When an exception is raised at run time, a routine looks up the list of exception handlers that guard the location where the exception was raised. It checks each of the exception handlers in order. Control flow branches to the first exception handler whose type matches the type of the raised exception. Note that the type check is a Java "assignable" type check, and therefore inheritance and interface checks may be necessary.

Version:
$Id: ExceptionHandler.java 1712 2004-04-28 17:36:13Z joewhaley $
Author:
John Whaley
See Also:
ExceptionHandlerList, TypeCheck

Constructor Summary
ExceptionHandler(jq_Class ex_type, int numOfHandledBlocks, BasicBlock entry)
          Creates new ExceptionHandler.
 
Method Summary
 BasicBlock getEntry()
          Returns the entry point for this exception handler.
 jq_Class getExceptionType()
          Returns the type of exception that this exception handler catches.
 List.BasicBlock getHandledBasicBlocks()
          Returns an iteration of the handled basic blocks.
 boolean mayCatch(jq_Class exType)
           
 boolean mustCatch(jq_Class exType)
           
 void setEntry(BasicBlock entry)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExceptionHandler

public ExceptionHandler(jq_Class ex_type,
                        int numOfHandledBlocks,
                        BasicBlock entry)
Creates new ExceptionHandler.

Parameters:
ex_type - type of exception to catch.
numOfHandledBlocks - estimated number of handled basic blocks.
entry - exception handler entry point.
Method Detail

getExceptionType

public jq_Class getExceptionType()
Returns the type of exception that this exception handler catches.

Returns:
the type of exception that this exception handler catches.

getHandledBasicBlocks

public List.BasicBlock getHandledBasicBlocks()
Returns an iteration of the handled basic blocks.

Returns:
an iteration of the handled basic blocks.

getEntry

public BasicBlock getEntry()
Returns the entry point for this exception handler.

Returns:
the entry point for this exception handler.

setEntry

public void setEntry(BasicBlock entry)

mustCatch

public boolean mustCatch(jq_Class exType)

mayCatch

public boolean mayCatch(jq_Class exType)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2008 John Whaley. All Rights Reserved.