org.jikesrvm.classloader
Class ExceptionHandlerMap

java.lang.Object
  extended by org.jikesrvm.classloader.ExceptionHandlerMap

public final class ExceptionHandlerMap
extends Object

A java method's try/catch/finally information.


Field Summary
private  int[] endPCs
          bytecode offset at which i-th try block ends (exclusive) 0-indexed from start of method's bytecodes[]
private  TypeReference[] exceptionTypes
          exception type for which i-th handler is to be invoked - something like "java/lang/IOException".
private  int[] handlerPCs
          bytecode offset at which exception handler for i-th try block begins 0-indexed from start of method's bytecodes[]
private  int[] startPCs
          bytecode offset at which i-th try block begins 0-indexed from start of method's bytecodes[]
 
Constructor Summary
private ExceptionHandlerMap(int[] startPCs, int[] endPCs, int[] handlerPCs, TypeReference[] exceptionTypes)
          Construct the exception handler map
 
Method Summary
(package private)  ExceptionHandlerMap deepCopy()
           
 int[] getEndPC()
           
 TypeReference getExceptionType(int i)
           
 TypeReference[] getExceptionTypes()
           
 int[] getHandlerPC()
           
 int[] getStartPC()
           
(package private) static ExceptionHandlerMap readExceptionHandlerMap(DataInputStream input, int[] constantPool)
          Read the exception handler map
 void setEndPC(int[] newPCs)
           
 void setHandlerPC(int[] newPCs)
           
 void setStartPC(int[] newPCs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startPCs

private int[] startPCs
bytecode offset at which i-th try block begins 0-indexed from start of method's bytecodes[]


endPCs

private int[] endPCs
bytecode offset at which i-th try block ends (exclusive) 0-indexed from start of method's bytecodes[]


handlerPCs

private int[] handlerPCs
bytecode offset at which exception handler for i-th try block begins 0-indexed from start of method's bytecodes[]


exceptionTypes

private final TypeReference[] exceptionTypes
exception type for which i-th handler is to be invoked - something like "java/lang/IOException". NOTE: When constructing the ExceptionHandlerMap we replace 'null' entries (means a finally block that catches everything) with RVMType.JavaLangThrowableType so we don't have to do anything special anywhere else in the VM.

Constructor Detail

ExceptionHandlerMap

private ExceptionHandlerMap(int[] startPCs,
                            int[] endPCs,
                            int[] handlerPCs,
                            TypeReference[] exceptionTypes)
Construct the exception handler map

Parameters:
startPCs -
endPCs -
handlerPCs -
exceptionTypes -
Method Detail

getStartPC

public int[] getStartPC()

getEndPC

public int[] getEndPC()

getHandlerPC

public int[] getHandlerPC()

getExceptionTypes

public TypeReference[] getExceptionTypes()

getExceptionType

public TypeReference getExceptionType(int i)

setStartPC

public void setStartPC(int[] newPCs)

setEndPC

public void setEndPC(int[] newPCs)

setHandlerPC

public void setHandlerPC(int[] newPCs)

readExceptionHandlerMap

static ExceptionHandlerMap readExceptionHandlerMap(DataInputStream input,
                                                   int[] constantPool)
                                            throws IOException
Read the exception handler map

Returns:
an exception handler map or null if none were present
Throws:
IOException

deepCopy

ExceptionHandlerMap deepCopy()