Use VM helper for unresolved fields with value type flattening - #24624
Draft
hzongaro wants to merge 1 commit into
Draft
Use VM helper for unresolved fields with value type flattening#24624hzongaro wants to merge 1 commit into
hzongaro wants to merge 1 commit into
Conversation
If null-restricted value type support is enabled, the JIT compiler
currently fails to compile or inline methods that contain unresolved
references to reference type fields.
Define the jitResolveFlattenableField VM helper, and a
SymbolReferenceTable method for creating symbol references for it, and
modify IL Generation to generate calls to that helper as well as the
jit{Get|Put}FlattenableField helpers to load from or store to unresolved
reference fields. Note that despite the names, those helpers will be
used even if the field turns out to be an identity field, as the JIT
will not have enough information at compile time.
The jitGetFlattenableField helper is only needed if flattening of null-
restricted value types is enabled. The jitPutFlattenableField helper
is needed if null-restricted values types are enabled, even if
flattening is not enabled, as a check for assigning a null reference to
a null-restricted field might be needed.
As special cases, when generating IL to load a field that is known to be
null-restricted, mark the node as isNonNull. Also, if null-restricted
field flattening is not enabled, and the value that's being stored to an
unresolved field is known to be non-null, there's no need to use VM
helpers to perform the store.
Also remove jitWithFlattenableField helper, as it's no longer needed.
Signed-off-by: Henry Zongaro <zongaro@ca.ibm.com>
Member
Author
It also exposes issues #24505 and #24596, so it can't be merged before those issues have been fixed. |
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.
If null-restricted value type support is enabled, the JIT compiler currently fails to compile or inline methods that contain unresolved references to reference type fields.
Define the
jitResolveFlattenableFieldVM helper, and aSymbolReferenceTablemethod for creating symbol references for it, and modify IL Generation to generate calls to that helper as well as thejit{Get|Put}FlattenableFieldhelpers to load from or store to unresolved reference fields. Note that despite the names, those helpers will be used even if the field turns out to be an identity field, as the JIT will not have enough information at compile time.The
jitGetFlattenableFieldhelper is only needed if flattening of null- restricted value types is enabled. ThejitPutFlattenableFieldhelper is needed if null-restricted values types are enabled, even if flattening is not enabled, as a check for assigning a null reference to a null-restricted field might be needed.As special cases, when generating IL to load a field that is known to be null-restricted, mark the node as isNonNull. Also, if null-restricted field flattening is not enabled, and the value that's being stored to an unresolved field is known to be non-null, there's no need to use VM helpers to perform the store.
Also remove the
jitWithFlattenableFieldhelper, as it's no longer needed.Marking this as a draft pull request as it depends on pull requests #24623 and eclipse-omr/omr#8413.