ARM64: Fix GC hole in indirect call site
authorKyungwoo Lee <kyulee@microsoft.com>
Mon, 14 Mar 2016 18:06:11 +0000 (11:06 -0700)
committerKyungwoo Lee <kyulee@microsoft.com>
Mon, 14 Mar 2016 19:32:22 +0000 (12:32 -0700)
commit469a324391dc49f92a411c5169145606fd50659b
tree52ffc39a2471ffc8e286442481906ca37a9a1666
parent7fbb95d2eb98f87c7a2563b37eed004df37a3d0a
ARM64: Fix GC hole in indirect call site

This fixes dotnet#3663.
Indirect call (```br``` or ```blr```) target is encoded with a register
which the first operand internally represents.
Unfortunately, call sites use the first two operands to hold GC
callee-save registers.
So, this GC register information was overridden by the call target operand
in the indirect(virtual) call sites.
The fix is to use 3rd/4th operands instead of 1st/2nd operands to hold GC info.
Ideally we should use different field name and also ensure constness when
we set up the operand so that it's never written more than once.
https://github.com/dotnet/coreclr/issues/3693 is filed.
src/jit/emit.cpp
src/jit/emit.h
src/jit/emitinl.h