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

Generate right-shaped object subclasses #5171

Closed
1 of 2 tasks
headius opened this issue May 15, 2018 · 2 comments
Closed
1 of 2 tasks

Generate right-shaped object subclasses #5171

headius opened this issue May 15, 2018 · 2 comments
Milestone

Comments

@headius
Copy link
Member

headius commented May 15, 2018

We have been running with the reified instance variable logic for some time, which picks from among a fixed set of "right-shaped" object subtypes that use Java fields instead of instance variables for the first N ivars. However we want to improve and expand this logic as follows:

  • The subtypes should be generated at runtime. Some set may be pre-generated for the jar to avoid having as much type churn.
  • For Decreased performance between JRuby 1.7 and 9.1 #3973 and others we found issues trying to do both reify.variables and reify.classes, the latter of which generates the native Java class name according to the Ruby name for better profiling. That logic should be rolled into the generation of reified variable classes, perhaps with the flag if we are concerned about the load of N generated classes for N Ruby classes instantiated in the system.

This work should proceed in tandem with explorations into Graal JIT's partial escape analysis, which will work better if we can avoid the extra indirection through the instance variable table.

@headius headius added this to the JRuby 9.2.1.0 milestone May 15, 2018
@headius
Copy link
Member Author

headius commented Oct 11, 2018

The first part of this has been implemented for 9.2.1.0: all reified variable classes are now generated at runtime, allowing us to scale them to any size. None are pre-generated yet, but that may come later; the cost is rather low, since early execution will generate only a handful of classes and reuse them for many objects.

@headius
Copy link
Member Author

headius commented Oct 11, 2018

Extensive discussion about the second half of this issue is available in #5266, so I am removing that from this issue and we can call this one resolved. I will also file a separate issue for pregenerating some of the reified variable subclasses.

@headius headius changed the title Generate right-shaped object subclasses and apply reify.classes naming Generate right-shaped object subclasses Oct 11, 2018
@headius headius closed this as completed Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant