Skip to content

[GR-80646] Move method references into guest staging - #14794

Merged
graalvmbot merged 8 commits into
masterfrom
je/methodref-guest-staging-GR-80646
Oct 28, 2026
Merged

graalvmbot merged 8 commits into
masterfrom
je/methodref-guest-staging-GR-80646

Conversation

@graalvmbot

Copy link
Copy Markdown
Collaborator

Move MethodRef, MethodPointer, and MethodOffset into guest staging while keeping their ResolvedJavaMethod targets in the builder. Creation and target lookup go through MethodRefSupport; default selection and flag validation remain in the guest classes.

Switching builder access to JavaConstant / GuestAccess is intentionally left for a follow-up.

Explicit ObjectCopier handling

SVMImageLayerSnapshotUtil registers 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 through MethodRefSupport, registering them in the current build. This manual handling, including the hosted-to-analysis decoding policy, deserves particular attention.

Method association: open design question

MethodRefSupport currently owns a build-scoped EconomicMap<MethodRef, ResolvedJavaMethod>. It uses identity comparison with system identity hashing, since word objects cannot generally use normal equals() / 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.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Oct 28, 2026
@graalvmbot
graalvmbot merged commit 9ac3823 into master Oct 28, 2026
3 checks passed
@graalvmbot
graalvmbot deleted the je/methodref-guest-staging-GR-80646 branch October 28, 2026 15:40
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