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

Clean up managed dependencies for Mono's domain/loader context #46323

Merged
merged 17 commits into from
Dec 27, 2020

Conversation

marek-safar
Copy link
Contributor

No description provided.

Comment on lines -1661 to -1671
MonoObject *unload_lock;
MonoEvent *resolving_unmaned_dll;
MonoEvent *resolving;
MonoEvent *unloading;
MonoString *name;
MonoAssemblyLoadContext *native_assembly_load_context;
gint64 id;
gint32 internal_state;
MonoBoolean is_collectible;
Copy link
Member

Choose a reason for hiding this comment

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

@CoffeeFlux are any of these fields going to be necessary for future collectible ALC work?

Copy link
Member

@lambdageek lambdageek left a comment

Choose a reason for hiding this comment

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

Good idea

  1. all the places where we use MONO_STATIC_POINTER_INIT need an additional inited flag now, so that we don't look for the method on every invocation when the pointer is allowed to be NULL
  2. There are a few more uses of mono_class_get_appdomain_class etc that are visible that will break. mono_class_get_appdomain_class is generated by GENERATE_GET_CLASS_WITH_CACHE which will assert if the class isn't found. There's a GENERATE_TRY_GET_CLASS_WITH_CACHE_DECL that makes a getter that can return null, but in this case I think it's just easier to put all the uses under an ifdef.

src/mono/mono/metadata/appdomain.c Outdated Show resolved Hide resolved
src/mono/mono/metadata/appdomain.c Outdated Show resolved Hide resolved
src/mono/mono/metadata/assembly-load-context.c Outdated Show resolved Hide resolved
src/mono/mono/metadata/assembly-load-context.c Outdated Show resolved Hide resolved
src/mono/mono/metadata/icall.c Show resolved Hide resolved
src/mono/mono/metadata/native-library.c Outdated Show resolved Hide resolved
src/mono/mono/metadata/object.c Outdated Show resolved Hide resolved
src/mono/mono/metadata/object.c Outdated Show resolved Hide resolved
src/mono/mono/metadata/class-internals.h Show resolved Hide resolved
marek-safar and others added 9 commits December 22, 2020 18:05
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
@@ -358,6 +358,7 @@ mono_print_method_from_ip (void *ip)
*/
gboolean mono_method_same_domain (MonoJitInfo *caller, MonoJitInfo *callee)
{
#ifndef ENABLE_NETCORE
Copy link
Member

Choose a reason for hiding this comment

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

(Same problem in #46346 ) this #ifndef should be lower, before the line cmethod = jinfo_get_method (caller); - we still want to return FALSE for trampolines and other edge cases

Copy link
Member

@lambdageek lambdageek Dec 23, 2020

Choose a reason for hiding this comment

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

Fix like this: fed6bcc f31ccde

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, will wait for you to land that first and rebase this PR

@marek-safar marek-safar merged commit 5078dd6 into dotnet:master Dec 27, 2020
@marek-safar marek-safar deleted the desc branch December 27, 2020 08:11
marek-safar added a commit to marek-safar/runtime that referenced this pull request Jan 13, 2021
monojenkins pushed a commit to monojenkins/mono that referenced this pull request Jan 13, 2021
marek-safar added a commit that referenced this pull request Jan 13, 2021
lambdageek pushed a commit to mono/mono that referenced this pull request Jan 13, 2021
…0743)

Follow up change missing in dotnet/runtime#46323

Fixes dotnet/runtime#46908

Co-authored-by: marek-safar <marek-safar@users.noreply.github.com>
@ghost ghost locked as resolved and limited conversation to collaborators Jan 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants