diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2016-02-16 23:22:42 +0100 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2016-02-16 23:22:42 +0100 |
commit | 0121102f14dfc8809292949108c21feaa5b9e67a (patch) | |
tree | 33bf94a46a279870e302665a09e627ef19c0d16a | |
parent | 9427f6c620450af16afd7cb95a08a1d846c7c79f (diff) | |
download | coreclr-0121102f14dfc8809292949108c21feaa5b9e67a.tar.gz coreclr-0121102f14dfc8809292949108c21feaa5b9e67a.tar.bz2 coreclr-0121102f14dfc8809292949108c21feaa5b9e67a.zip |
Fix INVALIDGCVALUE on Unix
The INVALIDGCVALUE value loaded into the R11 in the JIT_WriteBarrier_Debug
and JIT_ByRefWriteBarrier is sign extended to 0xFFFFFFFFCCCCCCCD instead of
being the 0x00000000CCCCCCCD.
It was introduced during the early days of CoreCLR porting when I have
misread the error message that I was getting from Clang when compiling
mov R11, 0xCCCCCCCD and didn't know yet that loading 64 bit number requires
using the movabs mnemonics.
-rw-r--r-- | src/pal/inc/unixasmmacros.inc | 2 | ||||
-rw-r--r-- | src/vm/amd64/jithelpers_fast.S | 2 | ||||
-rw-r--r-- | src/vm/amd64/jithelpers_slow.S | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/pal/inc/unixasmmacros.inc b/src/pal/inc/unixasmmacros.inc index 566c282470..b372666d2e 100644 --- a/src/pal/inc/unixasmmacros.inc +++ b/src/pal/inc/unixasmmacros.inc @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#define INVALIDGCVALUE -0x33333333 // 0CCCCCCCDh - the assembler considers it to be a signed integer constant +#define INVALIDGCVALUE 0CCCCCCCDh #if defined(__APPLE__) #define C_FUNC(name) _##name diff --git a/src/vm/amd64/jithelpers_fast.S b/src/vm/amd64/jithelpers_fast.S index 9fa35a913b..22f21bb8de 100644 --- a/src/vm/amd64/jithelpers_fast.S +++ b/src/vm/amd64/jithelpers_fast.S @@ -186,7 +186,7 @@ LEAF_ENTRY JIT_ByRefWriteBarrier, _TEXT mov rax, [r10] cmp rax, r11 je DoneShadow_ByRefWriteBarrier - mov r11, INVALIDGCVALUE + movabs r11, INVALIDGCVALUE mov [r10], r11 jmp DoneShadow_ByRefWriteBarrier diff --git a/src/vm/amd64/jithelpers_slow.S b/src/vm/amd64/jithelpers_slow.S index 5b67d14a60..4d18e4356c 100644 --- a/src/vm/amd64/jithelpers_slow.S +++ b/src/vm/amd64/jithelpers_slow.S @@ -45,7 +45,7 @@ LEAF_ENTRY JIT_WriteBarrier_Debug, _TEXT mov rax, [r10] cmp rax, r11 je DoneShadow - mov r11, INVALIDGCVALUE + movabs r11, INVALIDGCVALUE mov [r10], r11 jmp DoneShadow |