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

Adam Sotona asotona at openjdk.org
Fri Nov 21 04:49:58 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

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 four additional commits since the last revision:

 - TreeTranslatorPrev implementation and ReflectMethods fix
   
 - Merge branch 'code-reflection' into javac-gen-cm
 - removing JCClassDecl.crContext field
   
 - code reflection synthetic class generation moved to JavaCompiler::genCode

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

Changes:
  - all: https://git.openjdk.org/babylon/pull/689/files
  - new: https://git.openjdk.org/babylon/pull/689/files/e4ea6be5..7ece448f

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=babylon&pr=689&range=01
 - incr: https://webrevs.openjdk.org/?repo=babylon&pr=689&range=00-01

  Stats: 1107 lines in 52 files changed: 585 ins; 299 del; 223 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