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

Add support for standard classes with class data #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dain
Copy link
Member

@dain dain commented Aug 10, 2023

Class data is a powerful abstraction available to hidden classes, that makes linking live objects into constants trivial with condy. Unfortunately the class data system built into Java MethodHandles is currenly only usable by hidden classes. This PR add a similar system to standard classes loaded via the SingleClassGenerator. The design is similar to the existing DynamicClassLoader callsite bindings where the data is held in the classloader (this ensures safe memory visibility). The call site data is typically accessed via a bootstrap method added to the class definition which uses reflection to avoid any code dependencies in the generated class.

This PR adds a new ClassLoader implementation instead of modify the existing DynamicClassLoader. DynamicClassLoader is quite complex because it is designed to load multiple, possibly co-dependent, classes, and this complexity is not need for the SingleClassLoader.

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

Successfully merging this pull request may close these issues.

1 participant