Repository navigation
[GR-80646] Move method references into guest staging - #14794
Merged
Merged
Conversation
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.
Move
MethodRef,MethodPointer, andMethodOffsetinto guest staging while keeping theirResolvedJavaMethodtargets in the builder. Creation and target lookup go throughMethodRefSupport; default selection and flag validation remain in the guest classes.Switching builder access to
JavaConstant/GuestAccessis intentionally left for a follow-up.Explicit ObjectCopier handling
SVMImageLayerSnapshotUtilregisters a dedicated builtin for method references. Default field-based copying would bypass the factories and cannot restore the target association once the method is no longer stored in the reference itself.The builtin explicitly encodes the target through the existing analysis/hosted method codecs and preserves the pointer/offset kind and
permitsRewriteToPLT. Decoding reconstructs references throughMethodRefSupport, registering them in the current build. This manual handling, including the hosted-to-analysis decoding policy, deserves particular attention.Method association: open design question
MethodRefSupportcurrently owns a build-scopedEconomicMap<MethodRef, ResolvedJavaMethod>. It uses identity comparison with system identity hashing, since word objects cannot generally use normalequals()/hashCode(). Registration and lookup are synchronized, and the exact supplied method object is retained, including its analysis/hosted representation and variant. The registry is recreated for each build/layer rather than persisted.Is this build-scoped object-identity mapping the right association to keep, or should it be represented differently for the JavaConstant-based follow-up? The mapping strategy is an open point for review, not a settled long-term design.
Reviewer Notes
Please review commit by commit: the preparatory changes, relocation, and mechanical import updates are kept separate.