[code-reflection] RFR: Code reflection synthetic class generation moved to JavaCompiler::genCode

Adam Sotona asotona at openjdk.org
Fri Nov 21 03:15:32 UTC 2025


Prototype of code reflection synthetic class generation move to `JavaCompiler::genCode`.

- collected ops are attached to the `ReflectMethods.JCReflectMethodsClassDecl`, an internal extension of `JCTree.JCClassDecl`
- new `genCode` method is added to `CodeReflectionTransformer` interface
- `JavaCompiler` calls `CodeReflectionTransformer::genCode` inside its `genCode` method 
- implementation in `ReflectMethods.Provider` calls `OpBuilder` and `BytecodeGenerator` and generates the synthetic inner class

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

Commit messages:
 - removing JCClassDecl.crContext field
 - code reflection synthetic class generation moved to JavaCompiler::genCode

Changes: https://git.openjdk.org/babylon/pull/689/files
  Webrev: https://webrevs.openjdk.org/?repo=babylon&pr=689&range=00
  Stats: 98 lines in 3 files changed: 59 ins; 38 del; 1 mod
  Patch: https://git.openjdk.org/babylon/pull/689.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/689/head:pull/689

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


More information about the babylon-dev mailing list