-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic generic dictionary expansion feature #32270
Merged
fadimounir
merged 11 commits into
dotnet:master
from
fadimounir:MakeDictionaryLayoutDynamic
Feb 25, 2020
Merged
Dynamic generic dictionary expansion feature #32270
fadimounir
merged 11 commits into
dotnet:master
from
fadimounir:MakeDictionaryLayoutDynamic
Feb 25, 2020
Conversation
This file contains 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
jkotas
requested changes
Feb 14, 2020
Overall, I like this much better than the original version. Thanks! |
2 tasks
Couple of interesting benchmark numbers I tried:
|
jkotas
reviewed
Feb 16, 2020
jkotas
reviewed
Feb 16, 2020
jkotas
reviewed
Feb 16, 2020
jkotas
reviewed
Feb 16, 2020
jkotas
reviewed
Feb 16, 2020
jkotas
reviewed
Feb 16, 2020
jkotas
reviewed
Feb 16, 2020
fadimounir
force-pushed
the
MakeDictionaryLayoutDynamic
branch
from
February 19, 2020 21:41
c2564a9
to
a2467cb
Compare
jkotas
reviewed
Feb 20, 2020
jkotas
reviewed
Feb 20, 2020
jkotas
reviewed
Feb 21, 2020
1) Separate dictionary layout expansion from dictionary expansions on types and methods 2) Dictionary expansions on types and methods done on-demand, after size checks by codegen (uses new JIT feature) 3) Update dependency tracking to only track derived types of base types with dictionaries 4) Update the R2R dictionary access stubs to perform size checks (and major cleanup there) 5) Fix loader allocator issue with the dependency tracking (bug in original implementation) 6) Add unit test 7) Update documentation
Update JIT interface guid
fadimounir
force-pushed
the
MakeDictionaryLayoutDynamic
branch
from
February 24, 2020 19:40
e884297
to
447ea44
Compare
jkotas
reviewed
Feb 24, 2020
jkotas
approved these changes
Feb 24, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
fadimounir
pushed a commit
to fadimounir/runtime
that referenced
this pull request
Mar 6, 2020
This reverts commit 7182559.
fadimounir
pushed a commit
that referenced
this pull request
Mar 7, 2020
fadimounir
pushed a commit
to fadimounir/runtime
that referenced
this pull request
Mar 7, 2020
…otnet#33310) This reverts commit 7182559. (cherry picked from commit dca3429)
jkotas
added a commit
that referenced
this pull request
Mar 9, 2020
ghost
locked as resolved and limited conversation to collaborators
Dec 10, 2020
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.
TODO:
These changes introduce dynamic size expansion for generic dictionary layouts when we run out of slots.
The original implementation allowed for an expansion, but using a linked list structure, which made it
impossible to use fast lookup slots once we're out of slots in the first bucket.
This new implementation allows for the usage of fast lookup slots always, for all generic lookups.
This also removes the constraint we had on R2R, where we disabled the usage of fast slots all-together.
NOTE:
This is a much simpler implementation than the original commit which got reverted due to failures related to collectible assemblies (dotnet/coreclr#26262). The difference between these changes and the original ones is that dictionary expansion for types and methods is now done lazily, on-demand, whenever we attempt to read a value beyond the size of a given dictionary. This makes uses of the newly added JIT support from #31957. The bug with collectible assemblies have been also fixed, and I added a test to cover various interesting aspects of the feature.
BONUS:
Part of these changes is some cleanup work to really simplify the R2R dictionary access stubs. These stubs are now much more compact with fewer instructions and better registry usage (many #ifdef UNIX_AMD64_ABI blocks removed from the amd64 stub)
cc @dotnet/crossgen-contrib