From: Steve MacLean, Qualcomm Datacenter Technologies, Inc Date: Wed, 22 Feb 2017 22:11:45 +0000 (+0000) Subject: [Arm64] Fix genCodeForCpObj() X-Git-Tag: submit/tizen/20210909.063632~11030^2~7990^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a98ba2eb45f37f6c05623c183282dd02f532329;p=platform%2Fupstream%2Fdotnet%2Fruntime.git [Arm64] Fix genCodeForCpObj() CORINFO_HELP_ASSIGN_BYREF is the functional equivalent to *dst = *src; ++dst; ++src; Note: Description ignores barriers. Since src and dst are incremented the registers are marked dead. In genCodeForCpObj(), the incremented values are will be reused and therefore must be treated as live. Add code to explicitly force them live for this use case. Commit migrated from https://github.com/dotnet/coreclr/commit/a5d464837248bae64845fb3e8207821d29f316d8 --- diff --git a/src/coreclr/src/jit/codegenarm64.cpp b/src/coreclr/src/jit/codegenarm64.cpp index 48d6f76..7cc9622 100644 --- a/src/coreclr/src/jit/codegenarm64.cpp +++ b/src/coreclr/src/jit/codegenarm64.cpp @@ -3626,8 +3626,14 @@ void CodeGen::genCodeForCpObj(GenTreeObj* cpObjNode) break; default: - // We have a GC pointer, call the memory barrier. + // In the case of a GC-Pointer we'll call the ByRef write barrier helper genEmitHelperCall(CORINFO_HELP_ASSIGN_BYREF, 0, EA_PTRSIZE); + + // genEmitHelperCall(CORINFO_HELP_ASSIGN_BYREF...) killed these registers. + // However they are still live references to the structures we are copying. + gcInfo.gcMarkRegPtrVal(REG_WRITE_BARRIER_SRC_BYREF, TYP_BYREF); + gcInfo.gcMarkRegPtrVal(REG_WRITE_BARRIER_DST_BYREF, TYP_BYREF); + gcPtrCount--; break; }