Package gnu.bytecode
Class ExitableBlock
- java.lang.Object
-
- gnu.bytecode.ExitableBlock
-
public class ExitableBlock extends Object
Support for code block that one may be exited. You may optionally exit with a value, and/or run intervening finally blocks.Typical usage::
CodeAttr code = ...; Type retType = ...; // a Type or null ExitableBlock block = code.startExitableBlock(retType, true); ... ... block.exit() ...; // conditionally ... code.endExitableBlock();
The
block.exit()compiles to a transfer to the end of theblock, executing anyfinally-blocks within the block that surround the call toexit.If the
ExitableBlockshould leave a result on the stack, then specify the type of the result as theretType. The block itself must push a result before callingendExitableBlock(unlesscode.reachableHere()is false), and must also push a result beforeblock.exit()..
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexit()Exit this surrounding block, executing finally blocks as needed.LabelexitIsGoto()If an exit is simple, return the label for block end.
-
-
-
Method Detail
-
exit
public void exit()
Exit this surrounding block, executing finally blocks as needed. Return a value as the result of this ExitableBlock.
-
exitIsGoto
public Label exitIsGoto()
If an exit is simple, return the label for block end. The exit is simple if there is no intervening finally blocks.
-
-