Don't generate a runtime lookup for static base if not needed (dotnet/coreclr#9833)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Mon, 27 Feb 2017 23:21:57 +0000 (15:21 -0800)
committerGitHub <noreply@github.com>
Mon, 27 Feb 2017 23:21:57 +0000 (15:21 -0800)
commit8db6217f5c9f4bc467005dcbb45e84935aedccfc
treef07e932262926933c9397c7cbc18f6167da8389c
parent68b10a4c728c8cc9a9f5b8cdcf0dd09af0bbc8f3
Don't generate a runtime lookup for static base if not needed (dotnet/coreclr#9833)

`fgInitThisClass` makes sure that the type initializer for the type that
owns the method being compiled has run. On CoreCLR, the fallthrough code
somehow ends up not doing a runtime lookup if the owning type is not
canonical. We need to avoid it on CoreRT as well.

Commit migrated from https://github.com/dotnet/coreclr/commit/4fb2f0ff574502894ab7657fe89e9f9f99eafe1a
src/coreclr/src/jit/morph.cpp