[code-reflection] RFR: New Examples: Dialects and Dynamic Function Builds [v4]
Juan Fumero
jfumero at openjdk.org
Thu Sep 11 12:13:15 UTC 2025
> - `DialectSample`: Example of how to extends the code reflection `Op` to create a new dialect.
> - `DynamicFunctionBuild`: Example of how to create a new function dynamically to compute the inverse of a square root. The code model is built dynamically for a new method and it is evaluated in the `Interpreter`.
>
> How to run?
>
> ##### Run DialectWithInvoke
>
>
> java --enable-preview -cp target/crsamples-1.0-SNAPSHOT.jar oracle.code.samples.DialectWithInvoke
>
>
> ##### Run DialectFMAOp
>
>
> java --enable-preview -cp target/crsamples-1.0-SNAPSHOT.jar oracle.code.samples.DialectFMAOp
>
>
> ##### Run DynamicFunctionBuild
>
>
> java --enable-preview -cp target/crsamples-1.0-SNAPSHOT.jar oracle.code.samples.DynamicFunctionBuild
Juan Fumero 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 10 additional commits since the last revision:
- [examples][suite] Two more examples for creating dialects with code reflection
- Merge branch 'code-reflection' into cr/examples/suite
- Dialect example to replace a specific function as an intrinsic
- Merge branch 'code-reflection' into cr/examples/suite
- minor clean up
- minor comment
- trip extra spaces
- New example: building new functions dynamically with code reflection
- [example] Fix printing for dialects
- Code Reflection sample for creating new Ops for a dialect
-------------
Changes:
- all: https://git.openjdk.org/babylon/pull/549/files
- new: https://git.openjdk.org/babylon/pull/549/files/bafb4a11..2df4a704
Webrevs:
- full: https://webrevs.openjdk.org/?repo=babylon&pr=549&range=03
- incr: https://webrevs.openjdk.org/?repo=babylon&pr=549&range=02-03
Stats: 2547 lines in 30 files changed: 2193 ins; 293 del; 61 mod
Patch: https://git.openjdk.org/babylon/pull/549.diff
Fetch: git fetch https://git.openjdk.org/babylon.git pull/549/head:pull/549
PR: https://git.openjdk.org/babylon/pull/549
More information about the babylon-dev
mailing list