[code-reflection] Integrated: Resolving quotable target seems to be broken - this patch fixes HAT

Gary Frost gfrost at openjdk.org
Tue Dec 23 15:08:59 UTC 2025


On Tue, 23 Dec 2025 15:02:44 GMT, Gary Frost <gfrost at openjdk.org> wrote:

> Weird issue showed up when I just synced
> 
> I had to make this patch to correctly locate the lambda target from a quotable..
> 
> @@ -118,7 +119,12 @@ static JavaOp.InvokeOp getTargetInvokeOp(JavaOp.LambdaOp lambdaOp) {
>     return lambdaOp.body().entryBlock().ops().stream()
>             .filter(op -> op instanceof JavaOp.InvokeOp)
>             .map(op -> (JavaOp.InvokeOp) op)
> -           .findFirst().orElseThrow();
> +           .filter(invokeOp -> invokeOp.invokeKind().equals(JavaOp.InvokeOp.InvokeKind.STATIC))
> +           .filter(invokeOp -> invokeOp.operands().get(0).type() instanceof ClassType classType
> +                   && classType.toClassName() instanceof String name
> +                   && (name.equals("hat.ComputeContext")||name.equals("hat.KernelContext")))
> +           .findFirst()
> +           .orElseThrow();
>  }
>  ```
> Previously I did not have to filter the steam, the first invokeOp was the always the target. Possibly this was just a fluke.
> 
> What made this really weird is that the test suite all passed and all examples except 'Lifer'
> 
> Life example gave me an error... but only when I ran with 'MINIMIZE_COPIES' turned on.

This pull request has now been integrated.

Changeset: c86f4a24
Author:    Gary Frost <gfrost at openjdk.org>
URL:       https://git.openjdk.org/babylon/commit/c86f4a240677bb6bef06c597977d2941e3d6cce9
Stats:     26 lines in 5 files changed: 10 ins; 4 del; 12 mod

Resolving quotable target seems to be broken - this patch fixes HAT

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

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


More information about the babylon-dev mailing list