JIT: Fix arm gcstress/jistress issues (#32674)
authorAndy Ayers <andya@microsoft.com>
Sat, 22 Feb 2020 16:30:51 +0000 (08:30 -0800)
committerGitHub <noreply@github.com>
Sat, 22 Feb 2020 16:30:51 +0000 (08:30 -0800)
commit30543a043066689714a24d58206c28153d7fb826
treed6ada8cc2b23c26e5fd359075c86d946c6af5956
parent07632ae1555bedb020f5cd94ddf9fc9580278bd6
JIT: Fix arm gcstress/jistress issues (#32674)

Three fixes for gc liveness and the profile exit hook on arm.

* If we're returning results via the hidden return buffer pointer,
make sure we treat R0 as gc live, as it holds a BYREF and may well be
a gc reference, when the method is invoked via reflection.
* If R0 is otherwise live make sure to check the "native" return type so
we handle struct-wrapped GC ref returns properly.
* If we have a tail call or tail jump, R0 is not the return value, so deducing
GC liveness for it based on method properties is unsound. It turns out in both
cases that R0 is not in use; for tail calls this is ensured by insertion of the
helper call before register allocation; for tail jumps, by spilling the argument
registers in `genJmpMethod`.

Expect this will fix most or all of the failures in #31770.
src/coreclr/src/jit/codegenarm.cpp