[External] : Re: Classfile API cleanup of labelToBci from CodeModel and CodeBuilder and removal of impl.LabelResolver

Adam Sotona adam.sotona at oracle.com
Fri Aug 19 07:58:54 UTC 2022



From: Michael van Acken <michael.van.acken at gmail.com>
I was referring to the part where the code of the finally block is duplicated
into all paths right after their respective handled regions.  Looking at the
CodeBuilder source code, I can't find any of this.

This is an example use case of CodeBuilder::trying:
     codeBuilder.trying(tryBuilder -> {
         // try block code
     }, catchBuilder -> {
         catchBuilder.catching(CD_IOOBE, handlerBuilder -> {
             // catch handler code can
         }).catchingAll(finallyBuilder -> {
             // finally handler code
         });
     });

This method encapsulates a BlockCodeBuilder instance, but does not
provide it to the caller (the `child` below):

This is an example use case of CodeBuilder::block:

     codeBuilder.block(blockBuilder -> {
         // block code

         if( blockBuilder.isEmpty()) …
     });

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/classfile-api-dev/attachments/20220819/f74c7cf3/attachment-0001.htm>


More information about the classfile-api-dev mailing list