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

[GR-59661] Further refine CustomGraalClassLoader support for libgraal building. #10082

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

graalvmbot
Copy link
Collaborator

This PR add the following improvements to the CustomGraalClassLoader support for libgraal building:

  1. Specifying a CustomGraalClassLoader is now using a proper, well documented HostedOption instead of a system property. Using native-image --expert-options-detail CustomGraalClassLoader gives
================================
  -H:CustomGraalClassLoader=""
================================
Specify the FQN of the CustomGraalClassLoader implementation that gets used for building libgraal.

This option is only supported for building the libgraal shared library.
The given fully qualified class name has to be a subtype of
jdk.graal.compiler.hotspot.libgraal.CustomGraalClassLoader.

When building the libgraal shared library, this option is used to specify a custom loader
the builder instantiates via default constructor, that affects image building as follows:

 1. The custom loader is used to lookup Feature implementations passed via the --features option.
 2. All @CEntryPoint definitions from classes managed by the custom loader are processed.
 3. All @TargetClass substitutions in classes managed by the custom loader are processed.
  1. The builder accesses special custom loader implementation methods via a newly added interface
    jdk.graal.compiler.hotspot.libgraal.CustomGraalClassLoader that an implementation needs to implement. The builder now calls those methods via this interface instead of using reflection.
  2. ClassForNameSupport is now again a simple @AutomaticallyRegisteredImageSingleton and ClassForNameSupportFeature is removed again.
  3. Instead of providing CustomGraalClassLoader.forEachClass(...) we require a CustomGraalClassLoader.getAllClassNames() method for CustomGraalClassLoader implementations.
  4. Some minor cleanups in HostedLibGraalClassLoader.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Nov 13, 2024
@graalvmbot graalvmbot force-pushed the paw/GR-59661 branch 5 times, most recently from 8a5e1cb to bfba4ca Compare November 13, 2024 18:52
@graalvmbot graalvmbot changed the title [GR-59661] Futher refine CustomGraalClassLoader support for libgraal building. [GR-59661] Further refine CustomGraalClassLoader support for libgraal building. Nov 14, 2024
@graalvmbot graalvmbot merged commit 48a3929 into master Nov 14, 2024
13 checks passed
@graalvmbot graalvmbot deleted the paw/GR-59661 branch November 14, 2024 21:31
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.

2 participants