[runtime] If the initial pinvoke lookup fails, emit some code inside the managed...
authorZoltan Varga <vargaz@gmail.com>
Mon, 10 Aug 2020 23:54:22 +0000 (19:54 -0400)
committerGitHub <noreply@github.com>
Mon, 10 Aug 2020 23:54:22 +0000 (19:54 -0400)
commit095cb1637f4e51ecf4e3d068dd56eb296979c075
tree592932b017d24cdfbd06fc3a246a0662be3667bc
parentb9557bc4e73cf6a25d5674b5704f02b2cabde023
[runtime] If the initial pinvoke lookup fails, emit some code inside the managed-to-native wrapper to retry to lookup on every call until it succeeds.  (#40153)

* [runtime] If the initial pinvoke lookup fails, emit some code inside the managed-to-native wrapper to
retry to lookup on every call until it succeeds. Add a cache to prevent further lookups.
This is needed on netcore where pinvoke resolver callbacks can be added any time.

* Fix AOT support.

* Remove debug printf.

* Fix test failures.

* Fix a c++-ism.
12 files changed:
src/mono/mono/cil/cil-opcodes.xml
src/mono/mono/cil/opcode.def
src/mono/mono/metadata/jit-icall-reg.h
src/mono/mono/metadata/marshal-ilgen.c
src/mono/mono/metadata/marshal.c
src/mono/mono/metadata/marshal.h
src/mono/mono/mini/aot-compiler.c
src/mono/mono/mini/aot-runtime.c
src/mono/mono/mini/interp/transform.c
src/mono/mono/mini/method-to-ir.c
src/mono/mono/mini/mini-runtime.c
src/mono/mono/mini/patch-info.h