[GR-72910] Move registerBuildTimeBootstrapIndy/Condy to the public API - #14254
Merged
Conversation
graalvmbot
force-pushed
the
scoppey/GR-72910
branch
from
August 18, 2026 10:26
1065657 to
84423b9
Compare
graalvmbot
force-pushed
the
scoppey/GR-72910
branch
from
August 19, 2026 11:45
84423b9 to
3628b1a
Compare
Collaborator
|
Thanks for the heads up @Zeavee |
graalvmbot
force-pushed
the
scoppey/GR-72910
branch
from
August 24, 2026 14:47
3628b1a to
4b89f78
Compare
graalvmbot
force-pushed
the
scoppey/GR-72910
branch
from
August 24, 2026 16:16
4b89f78 to
e7dc307
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change exposes the existing build-time bootstrap-method registration mechanism through the public Native Image
FeatureAPI.By default,
invokedynamicandconstantdynamicbootstrap methods are executed at run time. Feature authors can now explicitly allow selected bootstrap methods to execute during image generation:DuringSetupAccess.registerBuildTimeBootstrapIndyExecutable)DuringSetupAccess.registerBuildTimeBootstrapCondy(Executable)When Native Image encounters an
invokedynamicorconstantdynamicinstruction using a registered bootstrap method, it executes that bootstrap method at build time and constant-folds the resulting call site or dynamic constant into the image. Bootstrap methods that are not registered retain the default run-time behavior.This is useful for frameworks and language implementations that generate bytecode with custom bootstrap methods and know that those methods are safe and deterministic during image generation.
Usage
Register the bootstrap methods from a Native Image feature during
duringSetup:The feature can then be enabled when building the native image:
Registration does not invoke the method immediately. It allows Native Image to invoke it when a corresponding dynamic call site or constant is encountered. Because any side effects occur during image generation, callers should only register bootstrap methods that are suitable for build-time execution.