-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mono] Unify invoke code with coreclr (#72717)
* [mono] Add icalls to be used by new invoke machinery * [mono] Fix IsInstanceOfType check * [mono] Reuse most of the managed invoke path used by coreclr * [mono] Implement new version of InternalInvoke icall This version doesn't receive a MonoArray of params as objects, rather a simple array of byrefs. There is also no need for special handling for nullables. The runtime invoke wrapper receives a boxed nullable, this conversion happens in managed code using ReboxFromNullable and ReboxToNullable. This change might have some side effects on other API making use of the runtime invoke wrapper! * [mono] Throw NRE for a null byref parameter Behavior was changed recently. * [tests] Enable reflection invoke tests on mono * [mono] Avoid loading reflection invoke machinery during startup Aside from perf optimization, this allows the usage of LocalAppContextSwitches for invoke tests. Before this change, invoke machinery was initialized before the appcontext properties were set, failing to detect ForceInterpretedInvoke and ForceEmitInvoke properties. CoreCLR also hardcodes string type param. * [mono] Remove nullable handling case This API already receives a boxed nullable now. * [mono] Disable inlining into Invoke stubs CoreCLR achieves this via NextCallReturnAddress. Add another intrinsic to be used for mono. * [mono] Fix handling of nullables when invoking from debugger * [mono] Update code for dyn runtime invokes and llvmonly invoke Remove special handling for nullables and throwing of NullByRefReturnException. * [mono] Remove old invoke code Which was still used only by mono_runtime_invoke_array * [mono] Move invoke code back in object.c * [mono] Simplify nullable ctor case Nullable<T> only has 1 param constructor that creates a boxed vtype * [mono] Extract invoke code to be reused by mono_runtime_invoke_array * [mono] Add back support for the embedding api With same behavior as before, except we have to handle conversions between nullable and boxedvt ourserlves, since it is no longer done by the runtime invoke wrapper. * [mono] Don't trigger ambiguous method exception when having duplicate method overrides Seems to be possible via reflection, ex System.Reflection.Emit.Tests.MethodBuilderDefineMethodOverride.DefineMethodOverride_CalledTwiceWithSameBodies_Works * Disable some warnings * Disable tests on wasm aot since they rely on stacktraces
- Loading branch information
Showing
36 changed files
with
779 additions
and
1,014 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.