[netcore] Propagate ALCs through reflection functions (#16949)
commit2c22d0de2edb09cfb008e587c40ee525fbe3749c
authorRyan Lucia <rylucia@microsoft.com>
Thu, 7 Nov 2019 20:02:23 +0000 (7 15:02 -0500)
committerGitHub <noreply@github.com>
Thu, 7 Nov 2019 20:02:23 +0000 (7 15:02 -0500)
tree5db888e452e2f5c1131707790c25af502c280a39
parent8cc040296753de641f91aa0cf031b1af90bfe2c5
[netcore] Propagate ALCs through reflection functions (#16949)

* [reflection] Pass assembly load context through mono_reflection_get_type_with_rootimage

The entry points are mono_reflection_type_from_name_checked and
mono_reflection_get_type_checked which for now pass in an ambient ALC, but
should be updated to take an ALC argument.

Internally mono_reflection_get_type_with_rootimage is recursive through a half
dozen helper functions which all get an ALC argument too.

The principle place where the ALC is used is in
_mono_reflection_get_type_from_info which passes it to
mono_assembly_loaded_internal and to replace the call to mono_assembly_load by
a direct call to mono_assembly_request_byname with an explicit ALC set in the
request.

* Mark mono_assembly_load as external only

* Pass an alc through non-static reflection functions

* Fix usage in wasm debugger

* Relax assertions due to wasm
12 files changed:
mono/metadata/assembly.h
mono/metadata/custom-attrs.c
mono/metadata/icall.c
mono/metadata/marshal-ilgen.c
mono/metadata/metadata-verify.c
mono/metadata/reflection-internals.h
mono/metadata/reflection.c
mono/metadata/sre.c
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c
mono/mini/debugger-agent.c
mono/mini/mini-wasm-debugger.c