On Thu, 30 Mar 2023 17:11:44 GMT, Jorn Vernee <jver...@openjdk.org> wrote:
> Rewrite BindingSpecializer to use the new class file API. > > Note: There is a big try/catch/finally block generated in the `specialize` > method that currently uses labels. I looked at replacing this with a call to > `CodeBuilder::trying` but it would require threading the nested code builders > through all the `emit*` methods, which currently access the 'global' > CodeBuilder instance attached to the BindingSpecializer instance. Since there > didn't really seem to be a big benefit to this, I've kept that > try/catch/finally block as is, using labels. > > The current implementation could also use `CheckClassAdapter` to do > additional verification on the generated bytecode (ahead of the VM's > verifier). I'm not sure if the new API has a replacement for that? This pull request has now been integrated. Changeset: b39a9bff Author: Jorn Vernee <jver...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/b39a9bffda0440b1617a802ceb70bf12e075a779 Stats: 406 lines in 1 file changed: 23 ins; 146 del; 237 mod 8301703: java.base jdk.internal.foreign.abi.BindingSpecializer uses ASM to generate classes Reviewed-by: mcimadamore, asotona ------------- PR: https://git.openjdk.org/jdk/pull/13247