Skip to content

[GR-71226] [GR-75039] [GR-75091] Allow class initialization in standalone analysis#13625

Open
graalvmbot wants to merge 4 commits into
masterfrom
d-kozak/GR-71226/class-init-in-standalone
Open

[GR-71226] [GR-75039] [GR-75091] Allow class initialization in standalone analysis#13625
graalvmbot wants to merge 4 commits into
masterfrom
d-kozak/GR-71226/class-init-in-standalone

Conversation

@graalvmbot

Copy link
Copy Markdown
Collaborator

This PR turns standalone analysis into a build-time-heap-driven flow that can safely request class initialization while still degrading cleanly for runtime-only or failed classes. The main implementation work is in the standalone host, constant-reflection, and heap-scanning layers, together with the Espresso VMAccess and worker-thread fixes needed to keep the Espresso-backed path reliable.

It also folds standalone onto one semantic model instead of separate conservative vs build-time-heap modes, expands the standalone test suite substantially, and cleans the large reachability fixture so it contains only entry points that standalone can actually consume in both host and Espresso configurations.

Summary

  • unify standalone analysis around standalone-managed build-time-heap semantics instead of a separate standalone analysis mode
  • move standalone class-initialization policy and outcome tracking into the standalone host, and route graph building through a standalone class-initialization plugin
  • add a standalone-owned field-value availability layer so static field snapshotting uses shadow-heap values only after successful standalone build-time initialization, while runtime-only / denied / failed classes keep original-provider semantics
  • encapsulate unsupported guest metadata constants, notably Espresso static-field-base cookies, so normal object-constant flows approximate them as non-null type-only states instead of materializing them as ordinary standalone heap objects
  • harden Espresso-backed standalone execution by preserving common-pool worker thread locals, validating the common-pool factory for Espresso VMAccess, and tightening standalone VMAccess bootstrap / reuse checks
  • expand standalone coverage with larger entrypoint-driven reachability tests, direct-flow precision tests, runtime-initialized static-field coverage, and the Espresso TruffleSafepoint reproducer
  • prune the reach-20000 entrypoint file to the resolvable roots only and drop the now-unneeded standalone reachability-profile test

Final commit shape

  • Implement standalone build-time heap analysis
    core standalone implementation: host / class-init plugin / VMAccess support / constant reflection / heap scanning / unsupported guest object handling / common-pool fix / timer and reporting hooks
  • Expand standalone analysis coverage and test wiring
    standalone test fixtures, host+espresso wrapper updates, reachability resources, and the extended standalone test suite
  • Refresh standalone workflow guidance
    standalone AGENTS / workflow notes only
  • Refine standalone analysis review follow-ups
    review-driven cleanup of the object-constant hook shape, standalone options/reporting wording, VMAccess bootstrap, and standalone test launcher support for experiment options
  • Prune standalone large reachability fixtures
    remove dead / duplicate / malformed reach-20000 entrypoints and delete the superseded JdkReachabilityProfileTest

Key implementation points

  • PointsToAnalyzer, StandaloneHost, StandalonePointsToAnalysis, and StandaloneClassInitializationPlugin now own the standalone class-initialization flow and root-management behavior
  • StandaloneFieldValueAvailabilitySupport, StandaloneHostedValuesProvider, StandaloneConstantReflectionProvider, and StandaloneImageHeapScanner now share one standalone policy for field-value availability and shadow-heap vs original-provider reads
  • MethodTypeFlowBuilder now asks HostVM for an object-constant handler; standalone plugs in StandaloneObjectConstantHandler together with StandaloneUnsupportedGuestObjectSupport so unsupported guest metadata is intercepted early without forking the SVM / EE builder hierarchy
  • StandaloneVMAccessSupport and StandaloneCommonPoolWorkerThreadFactory carry the Espresso-specific VMAccess / worker setup needed by standalone analysis
  • ObjectScanner and GuestElements were updated so standalone diagnostics use guest-aware identity / toString() handling instead of host unwrapping

Current status

  • standalone host suite passes locally
  • standalone Espresso suite passes locally
  • LargeReachabilityTest#testReachabilityOver20000Methods now reads all listed roots in both backends: 5466/5466 for host and 5466/5466 for Espresso

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label May 27, 2026
@graalvmbot graalvmbot force-pushed the d-kozak/GR-71226/class-init-in-standalone branch 2 times, most recently from 1da35bc to 929e767 Compare June 9, 2026 11:19
@graalvmbot graalvmbot force-pushed the d-kozak/GR-71226/class-init-in-standalone branch from 929e767 to 2a88766 Compare June 9, 2026 12:19
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