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

[wasm] Don't probe for aot modules unless we were built for AOT #100802

Merged
merged 2 commits into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/mono/mono/mini/aot-runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -1971,6 +1971,12 @@ load_aot_module (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer
if (mono_aot_mode == MONO_AOT_MODE_NONE)
return;

#ifdef HOST_BROWSER
// This indicates that we were not built for AOT, so there's no need to probe for AOT modules.
if (mono_aot_mode == MONO_AOT_MODE_INTERP_ONLY)
return;
Comment on lines +1976 to +1977
Copy link
Member

Choose a reason for hiding this comment

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

I don't remember which AOT mode it is, but I think for some interpreter modes we still need the AOT image for corlib because it contains some trampolines

Copy link
Member

Choose a reason for hiding this comment

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

ah, that's right. But if I remember right, we only need the aot image for corlib?

Copy link
Member

Choose a reason for hiding this comment

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

If I remember correctly, I think wasm is ok here.

#endif

if (assembly->image->aot_module)
/*
* Already loaded. This can happen because the assembly loading code might invoke
Expand Down Expand Up @@ -2480,7 +2486,7 @@ load_container_amodule (MonoAssemblyLoadContext *alc)

mono_loader_lock ();
// There might be several threads that passed the first check
// Adding another check to ensure single load of a container assembly due to race condition
// Adding another check to ensure single load of a container assembly due to race condition
if (!container_amodule) {
ERROR_DECL (error);

Expand Down
Loading