Skip to content

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