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

Using jclass objects for metadata #33

Open
dz333 opened this issue Oct 10, 2018 · 0 comments
Open

Using jclass objects for metadata #33

dz333 opened this issue Oct 10, 2018 · 0 comments

Comments

@dz333
Copy link
Collaborator

dz333 commented Oct 10, 2018

Currently our runtime representation for Class<?> objects contains no extra information over the Java-specified Class object information.

We save all of the class metadata (# fields, field names, object size in bytes, etc) in a HashMap<jclass,metadata>.

Therefore every metadata lookup requires a hash map lookup and we need to allocate some extra memory for the map itself.

It is reasonable to store this metadata in the jclass objects themselves, in front of the Class objects so `*jclass == head of metadata` and `*(jclass + sizeof(metadata))` is a reference to the Class object.

This is a performance optimization that requires some compiler and runtime restructuring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant