[code-reflection] RFR: Onnx direct reflection over records as tuples [v7]

Adam Sotona asotona at openjdk.org
Tue Apr 1 05:02:32 UTC 2025


> This PR removes `ExplicitOnnxOps.LoopReturn` and reflects directly on Records.
> 
> Unfortunately in some situations `new LoopReturn` cause javac crashing with IOOBE  at `jdk.incubator.code/jdk.incubator.code.internal.ReflectMethods$BodyScanner.thisValue(ReflectMethods.java:689)`.
> 
> Problematic use cases are at `WalkTheMazeTest::turnRight` and `WalkTheMazeTest::turnLeftWhileWall`.
> While seamlessly working use cases are at `WalkTheMazeTest::walkAroundTheMaze` and `SimpleTest::forLoopAdd`.
> 
> As a temporary workaround any static factory method returning a record is also treated as a tuple constructor.
> 
> Please review.
> 
> Thanks,
> Adam

Adam Sotona has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 11 additional commits since the last revision:

 - recommended changes applied
   
 - debuf prints removal
   
 - LoopReturn rename to LoopResult
   
 - Cleanup after #376 fix. Thank you!
   
 - Merge remote-tracking branch 'babylon/code-reflection' into loops-cont5
 - main loop in WalkTheMazeTest use tuple with three tensors
   
 - fixed model for tuples in loop
   
 - fixed test
   
 - support for record arguments
   
 - support for list and record return types
   
 - ... and 1 more: https://git.openjdk.org/babylon/compare/aae7db14...ff5fbbbc

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

Changes:
  - all: https://git.openjdk.org/babylon/pull/375/files
  - new: https://git.openjdk.org/babylon/pull/375/files/a4e9c5dc..ff5fbbbc

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=babylon&pr=375&range=06
 - incr: https://webrevs.openjdk.org/?repo=babylon&pr=375&range=05-06

  Stats: 477 lines in 16 files changed: 333 ins; 37 del; 107 mod
  Patch: https://git.openjdk.org/babylon/pull/375.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/375/head:pull/375

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


More information about the babylon-dev mailing list