-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code model attribute hard-coded #290
base: code-reflection
Are you sure you want to change the base?
Code model attribute hard-coded #290
Conversation
👋 Welcome back asotona! A progress list of the required criteria for merging this PR into |
@asotona This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 10 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
|
||
public class CodeModelAttribute extends CustomAttribute<CodeModelAttribute>{ | ||
|
||
enum Tag { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In terms of maintenance, I wonder if there could be a way to connect the tag more directly to the op classes. E.g. so that if an op is added/removed, we may rely on static checks to detect that our reading/writing logic needs updating.
But maybe that works already: after all, the writing logic does a switch on the op
instance - if that switch is made exhaustive, we could prevent mistakes when new ops are added. (when ops are removed, the mistake will be detected more easily, as the serialization code will refer to no longer existing classes).
This is yet another experimental serialization of code model into a custom method attribute.
It is based on #282 with all the ops tagged and hard-coded and a bit better utilization of constant pool.
Compiled size of the BytecodeTest class (with text-encoded code models) is 127531 bytes (30486 bytes as compressed in Jar), CP contains 1612 entries.
Cleaned size of the class (removed text-encoded code models and their static initialization) is 39044 bytes (16108 bytes in Jar), CP contains 1277 entries.
Size with models encoded in custom attributes is 57206 bytes (23114 bytes in Jar), CP contains 1452 entries.
Text-encoded code models add 88487 bytes (14378 bytes in Jar) and 335 CP entries to the class;
CodeModel attributes add only 18162 bytes (7006 bytes in Jar) and 175 CP entries.
Progress
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/babylon.git pull/290/head:pull/290
$ git checkout pull/290
Update a local copy of the PR:
$ git checkout pull/290
$ git pull https://git.openjdk.org/babylon.git pull/290/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 290
View PR using the GUI difftool:
$ git pr show -t 290
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/babylon/pull/290.diff
Using Webrev
Link to Webrev Comment