Skip to content
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

Open
wants to merge 18 commits into
base: code-reflection
Choose a base branch
from

Conversation

asotona
Copy link
Member

@asotona asotona commented Dec 4, 2024

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

  • Change must not contain extraneous whitespace

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

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 4, 2024

👋 Welcome back asotona! A progress list of the required criteria for merging this PR into code-reflection will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Dec 4, 2024

@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:

Code model attribute hard-coded

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 code-reflection branch:

  • 5deaf0f: Hat add jextract to maven
  • d63c0f7: Added hat nbody opengl example
  • ee2789e: Added hatless nbody example
  • e40d8a3: More jextract prep
  • ae52afe: More bld simplifications. Prep for adding jextract
  • 54f1b92: mkpoms cleanup + .gitignore target dirs
  • 2f2d7d6: Added mkpoms script - updated bldr/XMLNode
  • 52eba9d: Some build fixups after merging hip backend
  • 95445c8: HIP HAT backend
  • 0101fa4: using auto generated poms also a fix for CustomOpTest

Please see this link for an up-to-date comparison between the source branch of this pull request and the code-reflection branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the code-reflection branch, type /integrate in a new comment.

@asotona asotona marked this pull request as ready for review December 4, 2024 10:50
@openjdk openjdk bot added ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 4, 2024
@mlbridge
Copy link

mlbridge bot commented Dec 4, 2024

Webrevs


public class CodeModelAttribute extends CustomAttribute<CodeModelAttribute>{

enum Tag {
Copy link
Collaborator

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Pull request is ready to be integrated rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants