public final class CodeExceptionGen extends Object implements InstructionTargeter, Cloneable
MethodGen
,
CodeException
,
InstructionHandle
Constructor and Description |
---|
CodeExceptionGen(InstructionHandle start_pc,
InstructionHandle end_pc,
InstructionHandle handler_pc,
ObjectType catch_type)
Add an exception handler, i.e., specify region where a handler is active and an
instruction where the actual handling is done.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
boolean |
containsTarget(InstructionHandle ih)
Checks whether this targeter targets the specified instruction handle.
|
ObjectType |
getCatchType()
Gets the type of the Exception to catch, 'null' for ANY.
|
CodeException |
getCodeException(ConstantPoolGen cp)
Get CodeException object.
This relies on that the instruction list has already been dumped to byte code or or that the `setPositions' methods has been called for the instruction list. |
InstructionHandle |
getEndPC() |
InstructionHandle |
getHandlerPC() |
InstructionHandle |
getStartPC() |
void |
setCatchType(ObjectType catch_type)
Sets the type of the Exception to catch.
|
void |
setEndPC(InstructionHandle end_pc) |
void |
setHandlerPC(InstructionHandle handler_pc) |
void |
setStartPC(InstructionHandle start_pc) |
String |
toString() |
void |
updateTarget(InstructionHandle old_ih,
InstructionHandle new_ih)
Replaces the target of this targeter from this old handle to the new handle.
|
public CodeExceptionGen(InstructionHandle start_pc, InstructionHandle end_pc, InstructionHandle handler_pc, ObjectType catch_type)
start_pc
- Start of handled region (inclusive)end_pc
- End of handled region (inclusive)handler_pc
- Where handling is donecatch_type
- which exception is handled, null for ANYpublic CodeException getCodeException(ConstantPoolGen cp)
cp
- constant poolpublic void setStartPC(InstructionHandle start_pc)
public void setEndPC(InstructionHandle end_pc)
public void setHandlerPC(InstructionHandle handler_pc)
public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih)
InstructionTargeter
updateTarget
in interface InstructionTargeter
old_ih
- old target, either start or endnew_ih
- new targetpublic boolean containsTarget(InstructionHandle ih)
InstructionTargeter
containsTarget
in interface InstructionTargeter
public void setCatchType(ObjectType catch_type)
public ObjectType getCatchType()
public InstructionHandle getStartPC()
public InstructionHandle getEndPC()
public InstructionHandle getHandlerPC()
Copyright © 2004–2022 The Apache Software Foundation. All rights reserved.