Skip to content

Conversation

@graalvmbot
Copy link
Collaborator

This PR removes the SubstrateObjectConstant representation for hosted objects. Now ImageHeapConstant wraps the HotSpotObjectConstant directly. It removes AnalysisUniverse.toHosted() as there's no need to convert a hosted SubstrateObjectConstant into a HotSpotObjectConstant. Parts of AnalysisUniverse.fromHosted() are still kept as we still want the word types and simulated ImageHeapConstant interception. That logic now lives in SVMHostedValueProvider.interceptHosted().

We still transform between the ImageHeapConstant and SubstrateObjectConstant when we encode/decode graphs during image building. See SubstrateGraalUtils.forRuntime()/SubstrateGraalUtils.forHosted(). At some point we could try to simply encode the graphs using the ImageHeapConstant during image building and just transform to SubstrateObjectConstant when we write out the heap.

This PR also adds a proper IdentityHashCodeProvider mechanism to allow custom manipulation and reuse of identity hash codes during image build in the context of substituted types, e.g., DynamicHub.

See individual commits:

  • Clean-up unnecessary fallback when a constant is not ImageHeapConstant.
  • RemoveSubstrateObjectConstant from ImageHeapConstant.
  • Use SubstrateObjectConstant for runtime compiled graphs only.
  • HostedSnippetReflectionProvider can implement SnippetReflectionProvider directly.
  • Refactor hosted value interception.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 13, 2024
@graalvmbot graalvmbot force-pushed the cs/GR-50240-remove-substrate-object-constant-from-image-heap-constant branch 2 times, most recently from 95a54f7 to 6c47c24 Compare February 14, 2024 19:14
@graalvmbot graalvmbot closed this Feb 15, 2024
@graalvmbot graalvmbot merged commit 450475d into master Feb 15, 2024
@graalvmbot graalvmbot deleted the cs/GR-50240-remove-substrate-object-constant-from-image-heap-constant branch February 15, 2024 15:35
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