Exception_infopublic final class Exception_info extends Object implements Cloneable, com.vladium.jcd.compiler.IClassFormatOutputAn Exception_info is an entry layout format for {@link ExceptionHandlerTable}. Each
entry contains the following items:
start_pc, end_pc
The values of the two items start_pc and end_pc indicate the ranges in the code
array at which the exception handler is active. The value of start_pc must be
a valid index into the code array of the opcode of an instruction. The value of
end_pc either must be a valid index into the code array of the opcode of an
instruction, or must be equal to code_length , the length of the code array.
The value of start_pc must be less than the value of end_pc.
The start_pc is inclusive and end_pc is exclusive; that is, the exception handler
must be active while the program counter is within the interval [start_pc, end_pc).
handler_pc
The value of the handler_pc item indicates the start of the exception handler.
The value of the item must be a valid index into the code array, must be the index
of the opcode of an instruction, and must be less than the value of the code_length
item.
catch_type
If the value of the catch_type item is nonzero, it must be a valid index into the
constant_pool table. The constant_pool entry at that index must be a
{@link com.vladium.jcd.cls.constant.CONSTANT_Class_info} structure representing
a class of exceptions that this exception handler is designated to catch.
This class must be the class Throwable or one of its subclasses. The exception
handler will be called only if the thrown exception is an instance of the given
class or one of its subclasses.
If the value of the catch_type item is zero, this exception handler is called for
all exceptions. This is used to implement finally. |
Fields Summary |
---|
public int | m_start_pc | public int | m_end_pc | public int | m_handler_pc | public int | m_catch_type |
Constructors Summary |
---|
public Exception_info(int start_pc, int end_pc, int handler_pc, int catch_type)
m_start_pc = start_pc;
m_end_pc = end_pc;
m_handler_pc = handler_pc;
m_catch_type = catch_type;
| Exception_info(com.vladium.jcd.lib.UDataInputStream bytes)
m_start_pc = bytes.readU2 ();
m_end_pc = bytes.readU2 ();
m_handler_pc = bytes.readU2 ();
m_catch_type = bytes.readU2 ();
|
Methods Summary |
---|
public java.lang.Object | clone()Performs a deep copy.
try
{
return super.clone ();
}
catch (CloneNotSupportedException e)
{
throw new InternalError (e.toString ());
}
| public java.lang.String | toString()
return "exception_info: [start_pc/end_pc = " + m_start_pc + '/" + m_end_pc +
", handler_pc = " + m_handler_pc +
", catch_type = " + m_catch_type + ']";
| public void | writeInClassFormat(com.vladium.jcd.lib.UDataOutputStream out)
out.writeU2 (m_start_pc);
out.writeU2 (m_end_pc);
out.writeU2 (m_handler_pc);
out.writeU2 (m_catch_type);
|
|