[code-reflection] RFR: A transformer of code models to models that build them.
Paul Sandoz
psandoz at openjdk.org
Tue Mar 12 16:39:01 UTC 2024
A building code model when executed will construct the same code model it was transformed from. Such a building code model could be transformed to bytecode and stored in class files. This may be a better cross platform alternative than storing the textual form in class files (the form of which would need to be specified).
The implementation is using the operation factory and type factory to construct operations and types from their more general definitions (similarly to how they are used by the parser).
It would be interesting to compare the size of class files with the embedded textual form of a code model and the generated bytecode to build the code model. We could be more efficient but the implementation cost is not worth it, at least for now and would require further evaluation of that cost.
-------------
Commit messages:
- Update exception message
- Update test.
- Support more attribute values.
- A transformer of code models to models that build them.
Changes: https://git.openjdk.org/babylon/pull/37/files
Webrev: https://webrevs.openjdk.org/?repo=babylon&pr=37&range=00
Stats: 515 lines in 4 files changed: 513 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/babylon/pull/37.diff
Fetch: git fetch https://git.openjdk.org/babylon.git pull/37/head:pull/37
PR: https://git.openjdk.org/babylon/pull/37
More information about the babylon-dev
mailing list