Disable native image usage for collectible assemblies (#21378)
authorJan Vorlicek <janvorli@microsoft.com>
Thu, 6 Dec 2018 00:21:43 +0000 (01:21 +0100)
committerGitHub <noreply@github.com>
Thu, 6 Dec 2018 00:21:43 +0000 (01:21 +0100)
commitf940ccc633088d657e6d34c1e56bb0f0be4a4a73
treecdd13eba395b41de0fc3aaababda7a8d65a1d0c6
parentf5f19dbbc2612390d145bfa7c896784fbc643436
Disable native image usage for collectible assemblies (#21378)

* Disable native image usage for collectible assemblies

There are couple of issues with using native images as collectible
assemblies. The most important one is that statics handling is different
for collectible and non-collectible classes. Collectible classes have
statics stored in per class allocated blocks while the non-collectible ones
are all stored per module. So the code that accesses them needs to use
different offsets relative to a statics base address in each of these cases.
The crossgen generates just a single form of code that corresponds to the
non-collectible case and so such code cannot be used when a module is
loaded as collectible.
To mitigate that, we disable using the native code from crossgen-ed
assemblies and JIT all the code instead.
We may want to revisit this in the future and e.g. unify the statics
handling for collectible and non-collectible classes.
src/vm/ceeload.cpp
src/vm/ceeload.h
src/vm/readytoruninfo.cpp