Move MonoError from managed wrappers to native wrappers. (#15894)
commit4b9dc08ac19cfc3c451bba2fa7fefc7e31fc1ecc
authorJay Krell <jaykrell@microsoft.com>
Fri, 1 Nov 2019 21:36:06 +0000 (1 14:36 -0700)
committermonojenkins <jo.shields+jenkins@xamarin.com>
Fri, 1 Nov 2019 21:36:06 +0000 (1 22:36 +0100)
tree0df34196935d76a39e21a16f600f667581af5407
parente9d68e9485611d47c3ad17f3b4d178089e68cab0
Move MonoError from managed wrappers to native wrappers. (#15894)

Move MonoError from managed wrappers to native wrappers.

Move MonoError from managed wrappers (ilgen) to native wrappers (C preprocessor).

Alternative to https://github.com/mono/mono/pull/15869.
Which says: Previously, we would emit a call to memset
since the struct is large (> 100 bytes). Only the error code
field needs to be initialized.
Which that PR and this PR both fix, in different ways.

In the past:
- This did not work due to a possible dependency on precise GC,
  interacting with what gets zeroed or not here.
  That is why I put it on the managed side.
  We'll see if that reproduces.
  (https://github.com/mono/mono/pull/11294/files#diff-efe0070415f3f0c0f24ed0221aa1962aR339
  external/coreclr/tests/src/CoreMangLib/cti/system/weakreference/weakreferenceisaliveb.exe.)

- Some indication that embedding API should expose MonoError
  and not set_pending_exception. This does not seem relevant
  presently, and the code seems better structured and
  more efficient this way. It can revisited if/when new public API
  is the dominant concern, or do it this way for these functions,
  and another way for actual public functions.
  (https://github.com/mono/mono/pull/11294#issuecomment-432443485)
configure.ac
mcs/class/corlib/LinkerDescriptor/mscorlib.xml
mcs/class/corlib/Mono/RuntimeStructs.cs
mono/metadata/icall-table.h
mono/metadata/marshal-ilgen.c
mono/metadata/object-offsets.h
mono/mini/decompose.c
netcore/System.Private.CoreLib/src/LinkerDescriptor/System.Private.CoreLib.xml
tools/offsets-tool-py/offsets-tool.py