JIT: handle general indir case for GT_JMP address
authorAndy Ayers <andya@microsoft.com>
Tue, 27 Nov 2018 21:11:02 +0000 (13:11 -0800)
committerAndy Ayers <andya@microsoft.com>
Tue, 27 Nov 2018 21:11:02 +0000 (13:11 -0800)
commitbececa66bea22f941b321c203061afaf9d98cd02
tree178a163e120fc1c16d7436a1de1d8d5b81b48daf
parent12d7b9a19162f6fa11f9a4f49332e41b2a827da7
JIT: handle general indir case for GT_JMP address

Some upcoming changes to reduce tiering overhead require that directly
invoked virtual methods be called indirectly via their slot, so that the
method body can be updated and callers patched up by patching the method
table slot.

Existing code for x64 implicitly assumes that a GT_JMP indirect target address
is near enough to the call site that a 32 bit RIP-relative displacement will
work. We can ensure this is true by always generating a reloc (and hence
potentially a jump stub) -- unless the target happens to fit in 32 bits and
so can be addressed absolutely.

Commit migrated from https://github.com/dotnet/coreclr/commit/8c6a9e003feffbd798d6cdbbb5f89b170d75e05d
src/coreclr/src/jit/codegencommon.cpp