[code-reflection] RFR: Lazily invoke lambda op building method

Mourad Abbay mabbay at openjdk.org
Fri Dec 19 16:09:05 UTC 2025


Validation introduced in #738 is causing reflectable lambda creation to fail with an `InternalError`. The reason for this is that we are invoking lambda op building method in the lambda class static initializer, when lambda op building method throws UOE, it causes lambda creation to fail with `InternalError`. What we want is `Op.ofQuotable` to fail but not lambda instantiation. To adress this, we now lazily invoke lambda op building method and as result we lazily compute the `Quoted` instance, while sharing the lambda model across instances of the same lambda class.

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

Commit messages:
 - Test that calls to Op.ofQuotable produce the same instance
 - Move tests to the right directory
 - Lazily invoke lambda op building method

Changes: https://git.openjdk.org/babylon/pull/769/files
  Webrev: https://webrevs.openjdk.org/?repo=babylon&pr=769&range=00
  Stats: 421 lines in 8 files changed: 235 ins; 176 del; 10 mod
  Patch: https://git.openjdk.org/babylon/pull/769.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/769/head:pull/769

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


More information about the babylon-dev mailing list