[code-reflection] RFR: New model store implementation

Adam Sotona asotona at openjdk.org
Mon Nov 3 20:08:42 UTC 2025


This PR adds an alternative code model storage implementation.

With the new implementation compiler attaches a code-model attribute to the synthesized helper method. The method then returns the model by `invokedynamic` of a bootstrap method that reads and materializes the attribute at runtime.

The new implementation can be selected by setting the compiler option `codeModelStorageOption` to `"CODE_MODEL_ATTRIBUTE"`.

Please review.

Thanks,
Adam

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

Commit messages:
 - added javadoc
 - switched default CodeModelStorageOption back to CODE_BUILDER
 - added javadoc
 - caching vs. non-caching callsite construction
 - synth method body refactored to use indy call
 - reducing API surface
 - reducing API surface
 - annotations refactored to the synthetic methods
 - class file footprint optimizations
 - CodeModelSymbols & OpParser work in progress
 - ... and 5 more: https://git.openjdk.org/babylon/compare/b6b09e85...b2be1ee3

Changes: https://git.openjdk.org/babylon/pull/654/files
  Webrev: https://webrevs.openjdk.org/?repo=babylon&pr=654&range=00
  Stats: 839 lines in 6 files changed: 744 ins; 84 del; 11 mod
  Patch: https://git.openjdk.org/babylon/pull/654.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/654/head:pull/654

PR: https://git.openjdk.org/babylon/pull/654


More information about the babylon-dev mailing list