[GR-50240] Wrap HotSpotObjectConstant directly in ImageHeapConstant. #8374
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.
This PR removes the
SubstrateObjectConstantrepresentation for hosted objects. NowImageHeapConstantwraps theHotSpotObjectConstantdirectly. It removesAnalysisUniverse.toHosted()as there's no need to convert a hostedSubstrateObjectConstantinto aHotSpotObjectConstant. Parts ofAnalysisUniverse.fromHosted()are still kept as we still want the word types and simulatedImageHeapConstantinterception. That logic now lives inSVMHostedValueProvider.interceptHosted().We still transform between the
ImageHeapConstantandSubstrateObjectConstantwhen we encode/decode graphs during image building. SeeSubstrateGraalUtils.forRuntime()/SubstrateGraalUtils.forHosted(). At some point we could try to simply encode the graphs using theImageHeapConstantduring image building and just transform toSubstrateObjectConstantwhen we write out the heap.This PR also adds a proper
IdentityHashCodeProvidermechanism 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:
ImageHeapConstant.SubstrateObjectConstantfromImageHeapConstant.SubstrateObjectConstantfor runtime compiled graphs only.HostedSnippetReflectionProvidercan implementSnippetReflectionProviderdirectly.