Fixes to static field offsets (#699)
authorFadi Hanna <fadim@microsoft.com>
Thu, 12 Dec 2019 22:38:16 +0000 (17:38 -0500)
committerGitHub <noreply@github.com>
Thu, 12 Dec 2019 22:38:16 +0000 (17:38 -0500)
commiteae85a02786fb2c49b72578f2b0305d38f50da69
treea3c45f3d21efc87c174f5f29330731df031c9941
parent4a7a2a81deaa85a854bdd84fef7f8b4b52295aa0
Fixes to static field offsets (#699)

* Fixes to static field offsets

1) Stop counting offsets for RVA fields (this messes up the offsets of all statics)
2) Small fix to the size computation of nonGC statics (we were counting some GC statics as non-gc statics)
3) Bringing a small optimization we had with crossgen1 (safe static byref return)
4) Tiny micro-optimization: avoid allocation while looking up a field in one of the Typesystem hashtables (introduced with determinism work)

* Count the sizes of RVA statics in module field layout to match coreclr TypeSystem
src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs
src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunMetadataFieldLayoutAlgorithm.cs