Skip to content
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

Removing m_hostAssemblyMap and ceremony around it #61292

Merged
merged 3 commits into from
Nov 8, 2021

Conversation

VSadov
Copy link
Member

@VSadov VSadov commented Nov 7, 2021

Since we have only one AppDomain, there is no point in having a per-AppDomain {HostAssembly-->DomainAssembly} map.

Removing this map allows to remove couple locks, including the one taken during GC stack walks, and coordination with EE suspension.

Also removes SHash support for callouts to host in hosted scenario (comments say "hosted", I assume they mean "SQL-hosted").
I do not believe such scenarios exist anymore.

@ghost
Copy link

ghost commented Nov 7, 2021

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details

Since we have only one AppDomain, there is no point in having a per-AppDomain {HostAssembly-->DomainAssembly} map.

This allows to remove a few locks, including the one taken during GC stack walks, and coordination with EE suspension.

Also removes SHash support for callouts to host in hosted scenario. I do not believe such scenarios exist anymore.

Author: VSadov
Assignees: -
Labels:

area-AssemblyLoader-coreclr

Milestone: -

@VSadov
Copy link
Member Author

VSadov commented Nov 8, 2021

Fairly simple change - mostly removing code.

@@ -278,7 +273,7 @@ class EMPTY_BASES_DECL SHash : public TRAITS

// Utility function to allocate new table (does not copy the values into it yet). Returns the size of new table in
// *pcNewTableSize (finds next prime).
// Phase 1 of code:Reallocate - it is split to support code:AddPhases.
// Phase 1 of code:Reallocate
element_t * AllocateNewTable(count_t requestedSize, count_t * pcNewTableSize);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there still any good reason for Reallocate to be split into 3 methods?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are not small/trivial methods and have different responsibilities, so I figured it is ok to leave them as separate.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are also other callers - like AllocateNewTable is also called by Grow_OnlyAllocateNewTable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Others have multiple callers too.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@VSadov
Copy link
Member Author

VSadov commented Nov 8, 2021

Thanks!!

@VSadov VSadov merged commit 2266376 into dotnet:main Nov 8, 2021
@VSadov VSadov deleted the asmLoader4 branch November 8, 2021 19:34
@@ -587,6 +587,8 @@ class DomainAssembly : public DomainFile
void Allocate();
void DeliverSyncEvents();
void DeliverAsyncEvents();
void RegisterWithHostAssembly();
void UnRegisterFromHostAssembly();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UnRegister -> Unregister

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I will do the rename in some other change.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants