RFR: 8301703: java.base jdk.internal.foreign.abi.BindingSpecializer uses ASM to generate classes [v4]

Jorn Vernee jvernee at openjdk.org
Fri Apr 28 01:26:53 UTC 2023


> 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?

Jorn Vernee has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 28 commits:

 - Merge branch 'master' into CFA_JDK
 - Re-add PERFORM_VERIFICATION flag
 - use existing MTD_void constant
 - use ifThen to release scopes
 - use TypeKind.from
 - Translate BindingSpecializer to new classfile API
 - Merge with master
 - Make fallbacklinker.c consistent with downcallLinker.cpp
 - Add bug number
 - Use @return
 - ... and 18 more: https://git.openjdk.org/jdk/compare/b827ce83...851739a2

-------------

Changes: https://git.openjdk.org/jdk/pull/13247/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13247&range=03
  Stats: 406 lines in 1 file changed: 23 ins; 146 del; 237 mod
  Patch: https://git.openjdk.org/jdk/pull/13247.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13247/head:pull/13247

PR: https://git.openjdk.org/jdk/pull/13247


More information about the core-libs-dev mailing list