Repository navigation
Generate field-inject dispatch code - #130
Merged
Merged
Conversation
mcculls
force-pushed
the
mcculls/glue-build-improvements
branch
from
October 2, 2026 08:33
3c711a3 to
031caf6
Compare
mcculls
force-pushed
the
mcculls/field-inject-dispatch
branch
3 times, most recently
from
October 2, 2026 16:27
dfe44f3 to
a0ad0b5
Compare
mcculls
marked this pull request as ready for review
October 2, 2026 16:50
mcculls
requested review from
amarziali and
jbachorik
and removed request for
a team and
jbachorik
October 2, 2026 16:50
mcculls
force-pushed
the
mcculls/field-inject-dispatch
branch
from
October 3, 2026 11:08
b1cbac3 to
37de13a
Compare
mcculls
force-pushed
the
mcculls/field-inject-dispatch
branch
from
October 3, 2026 14:06
37de13a to
0cc4ce6
Compare
amarziali
approved these changes
Oct 5, 2026
amarziali
left a comment
There was a problem hiding this comment.
looks good from my pov. I added a comment to understand better the implication of having different constraints on put wrt to things like getOrPut
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.
What Does This Do
Adds build-time generation of the support bytecode needed for field-injected object-store dispatch:
KeyWithValueinterface exposing indexed get/set accessorsObjectStoreDispatch, which uses injected accessors when available and falls back toGlobalObjectStoreotherwiseweakGet/weakPutentry points so an injected accessor can fall back without recursively re-entering dispatchgetOrPut,getOrCompute, andremovebehavior on the injected fast path with double-checked lockingGlobalObjectStoreimplementation underjava.lang.$Datadog$and packs them as glue for future bootstrap-classpath injectionGlobalObjectStoreandObjectStoreIdsas package-private implementation detailsMotivation
Field injection needs a fast path that stores values directly on instrumented key objects, while retaining the existing weak global store for keys that cannot be injected and for stores without an injected field.
This PR establishes the generated runtime types and bootstrap-safe fallback implementation needed for that dispatch. It is intentionally preparatory: it does not yet switch the public
ObjectStoremethods to the generated dispatcher or add the key-class transformation.Additional Notes
Tests cover:
getOrPutcallsVerified with:
Contributor Checklist
Jira ticket: [PROJ-IDENT]