[GR-73160] [GR-73874] [GR-74022] [GR-74023] Porting ImageHeapPrimitiveArray for Terminus#13188
Open
graalvmbot wants to merge 1 commit intomasterfrom
Open
Conversation
As a side task, introduce VMAccess#createPrimitiveArray, readPrimitiveArrayUnaligned, and EspressoExternalSnippetReflectionProvider#forObject
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 refactors ImageHeapPrimitiveArray to be Terminus-compliant. The copy of the array created by
PrimitiveArrayDatais now represented by aJavaConstantliving in the guest and the usages have been updated to operate on theJavaConstantinstead of the raw array.As a side task, this PR also introduces
VMAccess.readPrimitiveArrayUnaligned,VMAccess.createPrimitiveArray, andEspressoExternalSnippetReflectionProvider.forObject(Object)for primitive arrays, which were helpful to achieving the goal of the PR and should also be useful in general.Automated PR Summary
This PR ports the
ImageHeapPrimitiveArrayinfrastructure for the Terminus project, refactoring its implementation to store array data asJavaConstantinstead of raw primitive arrays. The changes fully migrate array creation, manipulation, serialization, and deserialization logic to operate on theJavaConstantabstraction, improving consistency and compatibility with shared image heap approaches.Key Changes:
ImageHeapPrimitiveArraywithJavaConstantto represent the snapshot of primitive array data.JavaConstantmethods (readArrayElement,asArrayConstant, etc.).HeapSnapshotVerifier,ImageHeapScanner,NativeImageHeapWriter, andSVMImageLayerLoaderto use the new representation when reading, writing, or patching primitive arrays.JavaConstantrepresentation.Jira Issue Resolution:
The ticket requires refactoring
ImageHeapPrimitiveArray$PrimitiveArrayDatato avoid holding raw array references and switch to usingJavaConstant. This PR fully implements that change, updating all affected array instantiation, access, patching, and serialization logic to work withJavaConstantas the authoritative primitive array data. The migration is completed across platform and image heap infrastructure.Source: System Prompt | User Template