[code-reflection] RFR: Beef up reference resolution code and test [v2]
Maurizio Cimadamore
mcimadamore at openjdk.org
Thu Nov 13 18:36:19 UTC 2025
> This PR improves the code for method/field/constructor resolution. To resolve fields and methods we have to perform two MH lookups, and find if any of them succeds. Since to code to do this is a bit convoluted, I have reimplemented the resolution support to use a more functional style (inspired by `Either` type).
>
> I have also added several tests to make sure we test several lookup combinations, for instance/static method/fields, and also for super method resolution.
>
> We will probably need more tests to cover the entire spectrum, but this should be at least a start.
>
> I found 2 (!!) JDK issues when writing these tests, so some of the new tests contain workarounds.
Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
recordify RecordTypeRef
drop redundant instanceof
-------------
Changes:
- all: https://git.openjdk.org/babylon/pull/682/files
- new: https://git.openjdk.org/babylon/pull/682/files/d2875683..d38a687a
Webrevs:
- full: https://webrevs.openjdk.org/?repo=babylon&pr=682&range=01
- incr: https://webrevs.openjdk.org/?repo=babylon&pr=682&range=00-01
Stats: 33 lines in 2 files changed: 0 ins; 29 del; 4 mod
Patch: https://git.openjdk.org/babylon/pull/682.diff
Fetch: git fetch https://git.openjdk.org/babylon.git pull/682/head:pull/682
PR: https://git.openjdk.org/babylon/pull/682
More information about the babylon-dev
mailing list