[GR-49965] [GR-51573] [GR-52422] Persist and reload analysis universe and shadow heap #8744
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.
Adds the
PersistImageLayer
option, which allows to save information of theAnalysisUniverse
of an image in alayer-snapshot-{image-name}.json
file that is stored in the artifacts path. The file format can be found at the top ofImageLayerLoader
. The information currently persisted consists of theAnalysisType
s,AnalysisMethod
s,AnalysisField
s and all theImageHeapConstant
s from the shadow heap.The information can then be reloaded in a subsequent image build using the option
LoadImageLayer
.The type, method and field ids in the second image are the same as the first image. A part of the persisted constants are relinked, meaning they get matched to the corresponding hosted object in place of the constant that would be created in the new image. Those are the
DynamicHub
, internedString
andEnum
constants. All their child constants are also persisted constants, but most of them are not backed by an hosted object. Only a predefined subset of fields are relinked as well, using the value of the hosted object of the parent constant.The field flags from the base image need to be persisted and loaded in the extension image as we will skip the analysis for most types and methods of the base image.