[runtime] Use mono_class_load_from_name to load types in mono_defaults.
authorRodrigo Kumpera <kumpera@gmail.com>
Mon, 16 Nov 2015 05:22:56 +0000 (00:22 -0500)
committerRodrigo Kumpera <kumpera@gmail.com>
Sat, 20 Feb 2016 18:23:24 +0000 (13:23 -0500)
commit1da6b7629701e71afed2a28c86e7a9cb0f2c6f07
tree0c2ea1b675ac92ca1803e05c22f9fa87e72fc732
parent29a95bafd87830c430432546af4bf7076ba5542f
[runtime] Use mono_class_load_from_name to load types in mono_defaults.

We can use mono_class_load_from_name in all cases that we previously used to assert after loading.

All optional types have being moved over to use GENERATE_TRY_GET_CLASS_WITH_CACHE.

All but System.Runtime.ConstrainedExecution.CriticalFinalizerObject which is used within
sgen and we must ensure we don't try to lazy load it there.

I'm not 100% sure whether it should be optional, maybe it's a leftover from the 1.0 -> 2.0 timeframe?

The problem is that marking more types as required would be a burden on linkers as they might not force
it to be preserved.

I'm not particularly happy with the current large set of types that are loaded upfront. A significant
number of them could be lazy loaded.
mono/metadata/class-internals.h
mono/metadata/domain.c