Skip to content

Remove some indirection when raising AssemblyResolve event - #142

Merged
elinor-fung merged 2 commits into
dotnet:masterfrom
elinor-fung:collapseRaiseAssemblyResolve
Nov 21, 2019
Merged

elinor-fung merged 2 commits into
dotnet:masterfrom
elinor-fung:collapseRaiseAssemblyResolve

Conversation

@elinor-fung

Copy link
Copy Markdown
Member
  • Stop going through AssemblySpec::ResolveAssemblyFile when raising the AssemblyResolve event (was AppDomain::TryResolveAssembly -> AssemblySpec::ResolveAssemblyFile -> AppDomain::RaiseAssemblyResolveEvent)
  • Delete unused code

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-AssemblyLoader-coreclr only use for closed issues documentation Documentation bug or enhancement, does not impact product or test code labels Nov 20, 2019
@elinor-fung elinor-fung removed the documentation Documentation bug or enhancement, does not impact product or test code label Nov 20, 2019
@elinor-fung

Copy link
Copy Markdown
Member Author

@maryamariyan - any idea why the bot decided that this PR modified a ref cs file? It definitely does not modify a ref .cs file - or any .cs file. (I don't know if you own the auto-labelling, but I saw you had a PR for testing the labeller)

@dotnet dotnet deleted a comment from Dotnet-GitSync-Bot Nov 20, 2019
@maryamariyan

maryamariyan commented Nov 20, 2019 •

Copy link
Copy Markdown
Contributor

Thanks @elinor-fung for the note. yes please ignore it, I will re-enable this feature later once it's been tested a bit further.
I also deleted the comment to reduce future confusion.

FYI, this other PR shows a sample where it should be adding that comment in, but as you said not for your PR: #141

// GenerateFile() will fail later on.
// VerifyBindingString is a Runtime requirement, but StringHasLegalFileNameChars
// is a ngen restriction.
// StringHasLegalFileNameChars is a ngen restriction.

@lpereira lpereira Nov 20, 2019 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a nit, but... is ngen still a thing? Is this a restriction for crossgen?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't think so. I just avoided touching the comment referring to ngen, since I don't actually know / didn't go find out if this is a restriction for crossgen (or for something else) now.


enum {
CONTEXT_INITIALIZED = 0x0001,
LOAD_SYSTEM_ASSEMBLY_EVENT_SENT = 0x0040,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since AppDomain is a public API interface, will removing this enum cause any issues? (I hope not, and in this case: what's the common way of handling removing bitmasks such as this? Just "leaving a hole", or is it common to "defragment" the other constants?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This should be fine, since it is public as in this enum being public on this class, but not as in this enum being exposed through System.AppDomain or some exported API.

I don't know what the common way is, but I would advocate for leaving holes.

Comment thread src/coreclr/src/vm/assemblyspec.cpp Resolved
@elinor-fung
elinor-fung merged commit 5cd7170 into dotnet:master Nov 21, 2019
@elinor-fung
elinor-fung deleted the collapseRaiseAssemblyResolve branch November 21, 2019 18:33
@karelz karelz added this to the 5.0.0 milestone Aug 18, 2020
MichalStrehovsky added a commit to MichalStrehovsky/runtime that referenced this pull request Oct 12, 2020
* Fixes a pretty obvious bug in reverse interface marshalling
* Fixes error case in `SafeHandle` marshaller. The existing code was trying to generate throwing code in a wrong spot, leaving IL that is difficult to compute stack height for with our naive algorithm. `MissingMethodException` is the CLR-compatible behavior.
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-AssemblyLoader-coreclr only use for closed issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants