Skip to content

Bind bootstrap object-store dispatch to the original global store - #180

Merged
mcculls merged 2 commits into
mainfrom
mcculls/indy-object-store-dispatch
Dec 3, 2026
Merged

mcculls merged 2 commits into
mainfrom
mcculls/indy-object-store-dispatch

Conversation

@mcculls

@mcculls mcculls commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

What Does This Do

  • Generates bootstrap object-store dispatch that links fallback calls with invokedynamic and ConstantCallSite targets on the original GlobalObjectStore.
  • Links the fallbacks during initialization and tests that the first store binding stays in effect.
  • Adds a JMH benchmark for direct dispatch to a bootstrap copy of the store, final method handles, and constant call sites. The benchmark supplies its own transformer and uses JMH-only dependencies.

Motivation

Keep fallback reads and writes on the original global store when dispatch runs from the bootstrap loader. This avoids generating and injecting a second store with its own state.

Additional Notes

:field-inject:check passed on Java 8, 11, 17, 21, and 25.

Ran ObjectStoreDispatchBenchmark with JMH 1.37 on macOS arm64 using Zulu Java 8 (1.8.0_514), Zulu Java 17 (17.0.21.1), Zulu Java 21 (21.0.13.1). Each case used four forks, one thread, a 512 MiB heap, five one-second warmup iterations, and five one-second measurement iterations. Scores are JMH mean ± reported error in ns/op.

Operation Dispatch Java 8 Java 17 Java 21
getHit direct 11.68 ± 0.06 9.37 ± 0.32 9.07 ± 0.08
getHit finalHandle 11.74 ± 0.04 9.16 ± 0.21 8.94 ± 0.05
getHit indy 11.74 ± 0.05 10.84 ± 1.74 8.98 ± 0.04
getMiss direct 15.18 ± 0.45 8.97 ± 0.55 7.16 ± 0.14
getMiss finalHandle 15.12 ± 0.14 8.53 ± 0.58 6.95 ± 0.05
getMiss indy 15.46 ± 0.23 8.86 ± 0.60 7.15 ± 0.13
putExisting direct 20.07 ± 0.15 20.40 ± 0.16 20.59 ± 0.26
putExisting finalHandle 20.48 ± 0.26 20.96 ± 0.61 20.85 ± 0.32
putExisting indy 20.08 ± 0.24 20.50 ± 0.13 20.97 ± 0.19
putAndRemove direct 55.15 ± 1.96 48.62 ± 0.64 44.25 ± 0.70
putAndRemove finalHandle 56.90 ± 1.32 47.62 ± 3.33 45.86 ± 1.11
putAndRemove indy 55.63 ± 0.74 43.28 ± 0.14 46.20 ± 1.28

JMH used full blackholes on Java 8 and compiler blackholes on Java 17 and 21. The direct baseline also uses a separate store in the bootstrap loader. The benchmark measures the complete fallback path.

On Java 17, the reported error intervals for getMiss overlap across all three variants. The indy variant had the lowest mean for putAndRemove on Java 17, while direct had the lowest mean on Java 21.

Link fallback calls through generated constant call sites and keep
GlobalObjectStore and its nested classes out of bootstrap glue.
Derive fallback argument loads from descriptors and verify local
and bootstrap dispatch signatures.
@mcculls
mcculls marked this pull request as ready for review December 3, 2026 15:06
@mcculls
mcculls requested a review from a team as a code owner December 3, 2026 15:06
@mcculls
mcculls requested review from amarziali and mhlidd and removed request for a team December 3, 2026 15:06

@amarziali amarziali left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it sounds ok. I left a finding codex helped me to spot

@mcculls
mcculls merged commit 63ce71a into main Dec 3, 2026
6 checks passed
@mcculls
mcculls deleted the mcculls/indy-object-store-dispatch branch December 3, 2026 16:14
@github-actions github-actions Bot added this to the 0.1.0 milestone Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants