This repository was archived by the owner on Nov 13, 2026. It is now read-only.
Repository navigation
Extend EETypes with information about generic composition - #1171
Merged
MichalStrehovsky merged 2 commits intoApr 22, 2016
Merged
Conversation
In CoreRT we will not be using the `GenericInstanceDesc` mechanism from Redhawk/Project N. Instead, generic composition (the generic type definition, generic type arguments, arity, and variance) will be directly available from the EEType by following two new rare fields. The rare fields being added: * `ETF_GenericDefinition`: pointer to the EEType of the generic type definition * `ETF_GenericComposition`: pointer to a variable sized stream of data with the following grammar: ARITY | GENERIC_TYPE_ARGUMENT+ | GENERIC_VARIANCE*. Generic variance is present only when GenericVarianceFlag is set on the EEType.
Member
Author
|
@jkotas @davidwrighton PTAL I'm also thinking about putting all the uses of GenericInstanceDesc within the runtime under an |
MichalStrehovsky
added a commit
to MichalStrehovsky/corert
that referenced
this pull request
Apr 20, 2016
Depends on the updated runtime data structure from dotnet#1171. This change is to emit the new rare fields within the EEType so that at runtime, we can perform variant interface calls (example: call `IEnumerable<object>.GetEnumerator()` on `string[]`).
| ASSERT(IsGeneric()); | ||
| return cbOffset; | ||
| } | ||
| if (IsGeneric()) |
Member
There was a problem hiding this comment.
Do open generics have the IsGeneric flag set? Also, the new code must be under #ifdef CORERT
Member
Author
There was a problem hiding this comment.
Do open generics have the IsGeneric flag set
Nope, the only bits the binder sets are: EEType::GenericTypeDefEEType, EEType::ValueTypeFlag, and EEType::IsInterfaceFlag.
Member
|
LGTM |
| #if CORERT | ||
| *pArity = pEEType->get_GenericArity(); | ||
| *ppInstantiation = pEEType->get_GenericArguments(); | ||
| if (pEEType->HasGenericVariance()) |
There was a problem hiding this comment.
Suggestion, just do pEEType->get_GenericVariance() and have the implementation return NULL when it has no variance mark.
Also adding an ASSERT that pEEType is indeed generic would be useful.
MichalStrehovsky
added a commit
to MichalStrehovsky/corert
that referenced
this pull request
Apr 23, 2016
Depends on the updated runtime data structure from dotnet#1171. This change is to emit the new rare fields within the EEType so that at runtime, we can perform variant interface calls (example: call `IEnumerable<object>.GetEnumerator()` on `string[]`).
MichalStrehovsky
added a commit
to MichalStrehovsky/corert
that referenced
this pull request
Apr 25, 2016
Depends on the updated runtime data structure from dotnet#1171. This change is to emit the new rare fields within the EEType so that at runtime, we can perform variant interface calls (example: call `IEnumerable<object>.GetEnumerator()` on `string[]`).
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
In CoreRT we will not be using the
GenericInstanceDescmechanism fromRedhawk/Project N. Instead, generic composition (the generic type
definition, generic type arguments, arity, and variance) will be
directly available from the EEType by following two new rare fields.
The rare fields being added:
ETF_GenericDefinition: pointer to the EEType of the generic typedefinition
ETF_GenericComposition: pointer to a variable sized stream of datawith the following grammar: ARITY | GENERIC_TYPE_ARGUMENT+ |
GENERIC_VARIANCE*. Generic variance is present only when
GenericVarianceFlag is set on the EEType.