From ca90a97dc4c317499071b3f18ee865815ab07128 Mon Sep 17 00:00:00 2001 From: vsadov <8218165+VSadov@users.noreply.github.com> Date: Tue, 16 Nov 2021 07:45:14 -0800 Subject: [PATCH] a few fixes --- src/coreclr/vm/amd64/JitHelpers_Fast.asm | 8 ++++++++ src/coreclr/vm/amd64/jithelpers_fast.S | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/coreclr/vm/amd64/JitHelpers_Fast.asm b/src/coreclr/vm/amd64/JitHelpers_Fast.asm index 4b2e5ec3521..467129b4dea 100644 --- a/src/coreclr/vm/amd64/JitHelpers_Fast.asm +++ b/src/coreclr/vm/amd64/JitHelpers_Fast.asm @@ -455,6 +455,14 @@ LEAF_ENTRY JIT_WriteBarrier, _TEXT ; this is expected to be rare. RecordEscape: + + ; 4) check if the source is escaped + mov rax, rdx + and rax, 01FFFFFh + shr rax, 3 + bt qword ptr [r8], rax + jb AssignAndMarkCards ; source is already escaped. + ; save rcx, rdx, r8 and have enough stack for the callee push rcx push rdx diff --git a/src/coreclr/vm/amd64/jithelpers_fast.S b/src/coreclr/vm/amd64/jithelpers_fast.S index 52bf8e41b24..ba7597ec645 100644 --- a/src/coreclr/vm/amd64/jithelpers_fast.S +++ b/src/coreclr/vm/amd64/jithelpers_fast.S @@ -358,6 +358,13 @@ LEAF_ENTRY JIT_WriteBarrier, _TEXT ret // this is expected to be rare. + // 4) check if the source is escaped + mov rax, rsi + and rax, 0x1FFFFF + shr rax, 3 + bt qword ptr [rdx], rax + jb AssignAndMarkCards // source is already escaped. + RecordEscape: // save rdi, rsi, rdx and r10 (possibly preadjusted rsi) push rdi