summaryrefslogtreecommitdiff
path: root/src/jit/codegenarmarch.cpp
diff options
context:
space:
mode:
authorAndy Ayers <andya@microsoft.com>2019-02-12 08:22:47 -0800
committerGitHub <noreply@github.com>2019-02-12 08:22:47 -0800
commit6cd9e3ab6cae4aaf2a70fe1e59173b998932601d (patch)
tree3f2a3d950833174af1128ce040cf7fb899422659 /src/jit/codegenarmarch.cpp
parent3397472200fc7b2b5db3dfd27a652a12831c37ee (diff)
downloadcoreclr-6cd9e3ab6cae4aaf2a70fe1e59173b998932601d.tar.gz
coreclr-6cd9e3ab6cae4aaf2a70fe1e59173b998932601d.tar.bz2
coreclr-6cd9e3ab6cae4aaf2a70fe1e59173b998932601d.zip
JIT: change how we block gc refs from callee saves for inline pinvokes (#22477)
Add a new marker instruction that we emit once we've enabled preepmtive gc in the inline pinvoke method prolog. Use that to kill off callee saves registers with GC references, instead of waiting until the call. This closes a window of vulnerability we see in GC stress where if a stress interrupt happens between the point at which we enable preeemptive GC and the point at which we make the call, we may report callee saves as GC live when they're actually dead. Closes #19211.
Diffstat (limited to 'src/jit/codegenarmarch.cpp')
-rw-r--r--src/jit/codegenarmarch.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/jit/codegenarmarch.cpp b/src/jit/codegenarmarch.cpp
index 0682f609e6..e8f38b7b81 100644
--- a/src/jit/codegenarmarch.cpp
+++ b/src/jit/codegenarmarch.cpp
@@ -71,6 +71,13 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode)
getEmitter()->emitDisableGC();
break;
+ case GT_START_PREEMPTGC:
+ // Kill callee saves GC registers, and create a label
+ // so that information gets propagated to the emitter.
+ gcInfo.gcMarkRegSetNpt(RBM_INT_CALLEE_SAVED);
+ genDefineTempLabel(genCreateTempLabel());
+ break;
+
case GT_PROF_HOOK:
// We should be seeing this only if profiler hook is needed
noway_assert(compiler->compIsProfilerHookNeeded());