Skip to content

[GR-64584] Base-relative code pointers in vtables for non-layered images. #11150

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

Merged
merged 8 commits into from
May 13, 2025

Conversation

graalvmbot
Copy link
Collaborator

Relocation entries for pointers in the virtual dispatch tables (vtables) of DynamicHub objects require additional space in position-independent executables and shared libraries, cause delays during startup when processed at runtime by the dynamic linker, and decrease sharing between instances of the same image because memory pages must be copied (by the OS) when adjusting pointers. This is magnified with layered images where the base layer(s) in particular are expected to contain large number of methods which may be used in virtual dispatch.

The task at hand is to, as a first step, eliminate relocation entries in vtables for non-layered images, by introducing the notion of a code base and changing vtable entries to be offsets relative to that code base. Therefore, for dispatching a virtual call, it becomes necessary to add the code base to the vtable entry each time.

For prudence and because there will be some initial limitations (PLT/GOT dispatch, LLVM backend, layers), this is an option that is turned off by default.

This will also not eliminate relocation entries outside of vtables, such as in reflection accessors or JNI dispatch records. However, these can typically be assumed to be few compared to those in vtables.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label May 7, 2025
@graalvmbot graalvmbot merged commit fb645b6 into master May 13, 2025
12 of 13 checks passed
@graalvmbot graalvmbot deleted the ph/GR-64584 branch May 13, 2025 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants