[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
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.
-------------
Commit messages:
- Resolving quotable target seems to be broken - this patch fixes HAT
Changes: https://git.openjdk.org/babylon/pull/784/files
Webrev: https://webrevs.openjdk.org/?repo=babylon&pr=784&range=00
Stats: 26 lines in 5 files changed: 10 ins; 4 del; 12 mod
Patch: https://git.openjdk.org/babylon/pull/784.diff
Fetch: git fetch https://git.openjdk.org/babylon.git pull/784/head:pull/784
PR: https://git.openjdk.org/babylon/pull/784
More information about the babylon-dev
mailing list