This repository was archived by the owner on Nov 13, 2026. It is now read-only.
Repository navigation
Add support for variant interface dispatch - #1172
Merged
MichalStrehovsky merged 5 commits intoApr 25, 2016
Merged
Conversation
| for (int j = 0; j < _variantInterfacesImplemented.Count; j++) | ||
| { | ||
| // TODO: this should really use CanCastTo/IsAssignable | ||
| if (targetInterface.GetTypeDefinition() == _variantInterfacesImplemented[j].GetTypeDefinition()) |
Member
Author
There was a problem hiding this comment.
I'll make CanCastTo a separate pull request to keep things clean. I'll start on it tomorrow in parallel.
MichalStrehovsky
force-pushed
the
variantDispatch
branch
2 times, most recently
from
April 23, 2016 22:28
9826cea to
df4e178
Compare
Member
Author
|
Two more things are remaining so I'm keeping the WIP tag:
|
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[]`).
Do not try to optimize variant interfaces to just emitting them if they're used. Determining if they're used is expensive.
MichalStrehovsky
force-pushed
the
variantDispatch
branch
from
April 25, 2016 16:57
df4e178 to
663b684
Compare
Member
Author
|
@jkotas @davidwrighton Pushed an updated version that removes the attempt to optimize the number of interface methods we end up implementing, and makes CppCodegen limp along for the moment (the real fix for that is to make it use the ObjectNode structures for EEType and friends). The size on disk impact on Hello world is:
Pretty damn big. Pretty much all the cost comes from arrays. |
Member
|
Sigh. Well, its no real surprise. LGTM, although this is more ammunition for wanting to come up with a way to decide to use the USG for most of these. |
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.
Depends on the updated runtime data structure from #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()onstring[]).