[code-reflection] Integrated: Beef up reference resolution code and test

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Nov 14 10:02:14 UTC 2025


On Thu, 13 Nov 2025 17:13:31 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

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

This pull request has now been integrated.

Changeset: f4a0eb3e
Author:    Maurizio Cimadamore <mcimadamore at openjdk.org>
URL:       https://git.openjdk.org/babylon/commit/f4a0eb3e05d84c22c99aa2ecb7bdd3485717c44e
Stats:     698 lines in 7 files changed: 467 ins; 220 del; 11 mod

Beef up reference resolution code and test

Reviewed-by: psandoz

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

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


More information about the babylon-dev mailing list