| |
@@ -0,0 +1,584 @@
|
| |
+ diff --git a/src/debug/ee/amd64/dbghelpers.S b/src/debug/ee/amd64/dbghelpers.S
|
| |
+ index 85ec80c701..864c4dc943 100644
|
| |
+ --- a/src/debug/ee/amd64/dbghelpers.S
|
| |
+ +++ b/src/debug/ee/amd64/dbghelpers.S
|
| |
+ @@ -29,7 +29,7 @@ NESTED_ENTRY FuncEvalHijack, _TEXT, UnhandledExceptionHandlerUnix
|
| |
+ //
|
| |
+ // epilogue
|
| |
+ //
|
| |
+ - add rsp, 20h
|
| |
+ + add rsp, 0x20
|
| |
+ TAILJMP_RAX
|
| |
+ NESTED_END FuncEvalHijack, _TEXT
|
| |
+
|
| |
+ @@ -65,14 +65,14 @@ NESTED_ENTRY ExceptionHijack, _TEXT, UnhandledExceptionHandlerUnix
|
| |
+ // its arguments on the stack. In x64, it gets its arguments in
|
| |
+ // registers (set up for us by DacDbiInterfaceImpl::Hijack),
|
| |
+ // and this stack space may be reused.
|
| |
+ - mov rax, [rsp + 20h]
|
| |
+ + mov rax, [rsp + 0x20]
|
| |
+ mov [rsp], rax
|
| |
+ - mov rax, [rsp + 28h]
|
| |
+ - mov [rsp + 8h], rax
|
| |
+ - mov rax, [rsp + 30h]
|
| |
+ - mov [rsp + 10h], rax
|
| |
+ - mov rax, [rsp + 38h]
|
| |
+ - mov [rsp + 18h], rax
|
| |
+ + mov rax, [rsp + 0x28]
|
| |
+ + mov [rsp + 0x8], rax
|
| |
+ + mov rax, [rsp + 0x30]
|
| |
+ + mov [rsp + 0x10], rax
|
| |
+ + mov rax, [rsp + 0x38]
|
| |
+ + mov [rsp + 0x18], rax
|
| |
+
|
| |
+ // DD Hijack primitive already set the stack. So just make the call now.
|
| |
+ call C_FUNC(ExceptionHijackWorker)
|
| |
+ @@ -93,7 +93,7 @@ NESTED_ENTRY ExceptionHijack, _TEXT, UnhandledExceptionHandlerUnix
|
| |
+ //
|
| |
+ // epilogue
|
| |
+ //
|
| |
+ - add rsp, 20h
|
| |
+ + add rsp, 0x20
|
| |
+ TAILJMP_RAX
|
| |
+
|
| |
+ // Put a label here to tell the debugger where the end of this function is.
|
| |
+ diff --git a/src/pal/inc/unixasmmacros.inc b/src/pal/inc/unixasmmacros.inc
|
| |
+ index e7a5eba898..8a74e3f266 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 0CCCCCCCDh
|
| |
+ +#define INVALIDGCVALUE 0xCCCCCCCD
|
| |
+
|
| |
+ #if defined(__APPLE__)
|
| |
+ #define C_FUNC(name) _##name
|
| |
+ diff --git a/src/vm/amd64/JitHelpers_Fast.asm b/src/vm/amd64/JitHelpers_Fast.asm
|
| |
+ index 83f7132688..5251387408 100644
|
| |
+ --- a/src/vm/amd64/JitHelpers_Fast.asm
|
| |
+ +++ b/src/vm/amd64/JitHelpers_Fast.asm
|
| |
+ @@ -40,7 +40,7 @@ EXTERN g_GCShadow:QWORD
|
| |
+ EXTERN g_GCShadowEnd:QWORD
|
| |
+ endif
|
| |
+
|
| |
+ -INVALIDGCVALUE equ 0CCCCCCCDh
|
| |
+ +INVALIDGCVALUE equ 0xCCCCCCCD
|
| |
+
|
| |
+ ifdef _DEBUG
|
| |
+ extern JIT_WriteBarrier_Debug:proc
|
| |
+ diff --git a/src/vm/amd64/JitHelpers_Slow.asm b/src/vm/amd64/JitHelpers_Slow.asm
|
| |
+ index 0e26ae6dfd..80b7453d4f 100644
|
| |
+ --- a/src/vm/amd64/JitHelpers_Slow.asm
|
| |
+ +++ b/src/vm/amd64/JitHelpers_Slow.asm
|
| |
+ @@ -48,7 +48,7 @@ g_pStringClass equ ?g_pStringClass@@3PEAVMethodTable@@EA
|
| |
+ FramedAllocateString equ ?FramedAllocateString@@YAPEAVStringObject@@K@Z
|
| |
+ JIT_NewArr1 equ ?JIT_NewArr1@@YAPEAVObject@@PEAUCORINFO_CLASS_STRUCT_@@_J@Z
|
| |
+
|
| |
+ -INVALIDGCVALUE equ 0CCCCCCCDh
|
| |
+ +INVALIDGCVALUE equ 0xCCCCCCCD
|
| |
+
|
| |
+ extern JIT_NEW:proc
|
| |
+ extern CopyValueClassUnchecked:proc
|
| |
+ diff --git a/src/vm/amd64/jithelpers_fast.S b/src/vm/amd64/jithelpers_fast.S
|
| |
+ index 6f955b0bee..5f68fc0ebf 100644
|
| |
+ --- a/src/vm/amd64/jithelpers_fast.S
|
| |
+ +++ b/src/vm/amd64/jithelpers_fast.S
|
| |
+ @@ -81,14 +81,14 @@ LEAF_ENTRY JIT_WriteBarrier, _TEXT
|
| |
+ // Update the write watch table if necessary
|
| |
+ mov rax, rdi
|
| |
+ movabs r10, 0xF0F0F0F0F0F0F0F0
|
| |
+ - shr rax, 0Ch // SoftwareWriteWatch::AddressToTableByteIndexShift
|
| |
+ + shr rax, 0xC // SoftwareWriteWatch::AddressToTableByteIndexShift
|
| |
+ NOP_2_BYTE // padding for alignment of constant
|
| |
+ movabs r11, 0xF0F0F0F0F0F0F0F0
|
| |
+ add rax, r10
|
| |
+ - cmp byte ptr [rax], 0h
|
| |
+ + cmp byte ptr [rax], 0x0
|
| |
+ .byte 0x75, 0x06
|
| |
+ // jne CheckCardTable
|
| |
+ - mov byte ptr [rax], 0FFh
|
| |
+ + mov byte ptr [rax], 0xFF
|
| |
+
|
| |
+ NOP_3_BYTE // padding for alignment of constant
|
| |
+
|
| |
+ @@ -112,27 +112,27 @@ LEAF_ENTRY JIT_WriteBarrier, _TEXT
|
| |
+
|
| |
+ // Touch the card table entry, if not already dirty.
|
| |
+ shr rdi, 0x0B
|
| |
+ - cmp byte ptr [rdi + rax], 0FFh
|
| |
+ + cmp byte ptr [rdi + rax], 0xFF
|
| |
+ .byte 0x75, 0x02
|
| |
+ // jne UpdateCardTable
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardTable:
|
| |
+ - mov byte ptr [rdi + rax], 0FFh
|
| |
+ + mov byte ptr [rdi + rax], 0xFF
|
| |
+
|
| |
+ #ifdef FEATURE_MANUALLY_MANAGED_CARD_BUNDLES
|
| |
+ NOP_2_BYTE // padding for alignment of constant
|
| |
+ shr rdi, 0x0A
|
| |
+
|
| |
+ movabs rax, 0xF0F0F0F0F0F0F0F0
|
| |
+ - cmp byte ptr [rdi + rax], 0FFh
|
| |
+ + cmp byte ptr [rdi + rax], 0xFF
|
| |
+
|
| |
+ .byte 0x75, 0x02
|
| |
+ // jne UpdateCardBundle_WriteWatch_PostGrow64
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardBundle_WriteWatch_PostGrow64:
|
| |
+ - mov byte ptr [rdi + rax], 0FFh
|
| |
+ + mov byte ptr [rdi + rax], 0xFF
|
| |
+ #endif
|
| |
+
|
| |
+ ret
|
| |
+ @@ -177,14 +177,14 @@ LEAF_ENTRY JIT_WriteBarrier, _TEXT
|
| |
+ movabs rax, 0xF0F0F0F0F0F0F0F0
|
| |
+
|
| |
+ // Touch the card table entry, if not already dirty.
|
| |
+ - shr rdi, 0Bh
|
| |
+ - cmp byte ptr [rdi + rax], 0FFh
|
| |
+ + shr rdi, 0x0B
|
| |
+ + cmp byte ptr [rdi + rax], 0xFF
|
| |
+ .byte 0x75, 0x02
|
| |
+ // jne UpdateCardTable
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardTable:
|
| |
+ - mov byte ptr [rdi + rax], 0FFh
|
| |
+ + mov byte ptr [rdi + rax], 0x0xFF
|
| |
+
|
| |
+ #ifdef FEATURE_MANUALLY_MANAGED_CARD_BUNDLES
|
| |
+ NOP_6_BYTE // padding for alignment of constant
|
| |
+ @@ -194,14 +194,14 @@ LEAF_ENTRY JIT_WriteBarrier, _TEXT
|
| |
+ // Touch the card bundle, if not already dirty.
|
| |
+ // rdi is already shifted by 0xB, so shift by 0xA more
|
| |
+ shr rdi, 0x0A
|
| |
+ - cmp byte ptr [rdi + rax], 0FFh
|
| |
+ + cmp byte ptr [rdi + rax], 0xFF
|
| |
+
|
| |
+ .byte 0x75, 0x02
|
| |
+ // jne UpdateCardBundle
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardBundle:
|
| |
+ - mov byte ptr [rdi + rax], 0FFh
|
| |
+ + mov byte ptr [rdi + rax], 0xFF
|
| |
+ #endif
|
| |
+
|
| |
+ ret
|
| |
+ @@ -312,15 +312,15 @@ LEAF_ENTRY JIT_ByRefWriteBarrier, _TEXT
|
| |
+ #ifdef FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP
|
| |
+ // Update the write watch table if necessary
|
| |
+ PREPARE_EXTERNAL_VAR g_sw_ww_enabled_for_gc_heap, rax
|
| |
+ - cmp byte ptr [rax], 0h
|
| |
+ + cmp byte ptr [rax], 0x0
|
| |
+ je CheckCardTable_ByRefWriteBarrier
|
| |
+ mov rax, rdi
|
| |
+ - shr rax, 0Ch // SoftwareWriteWatch::AddressToTableByteIndexShift
|
| |
+ + shr rax, 0xC // SoftwareWriteWatch::AddressToTableByteIndexShift
|
| |
+ PREPARE_EXTERNAL_VAR g_sw_ww_table, r10
|
| |
+ add rax, qword ptr [r10]
|
| |
+ - cmp byte ptr [rax], 0h
|
| |
+ + cmp byte ptr [rax], 0x0
|
| |
+ jne CheckCardTable_ByRefWriteBarrier
|
| |
+ - mov byte ptr [rax], 0FFh
|
| |
+ + mov byte ptr [rax], 0xFF
|
| |
+ #endif
|
| |
+
|
| |
+ CheckCardTable_ByRefWriteBarrier:
|
| |
+ @@ -334,8 +334,8 @@ LEAF_ENTRY JIT_ByRefWriteBarrier, _TEXT
|
| |
+
|
| |
+ // move current rdi value into rcx and then increment the pointers
|
| |
+ mov rcx, rdi
|
| |
+ - add rsi, 8h
|
| |
+ - add rdi, 8h
|
| |
+ + add rsi, 0x8
|
| |
+ + add rdi, 0x8
|
| |
+
|
| |
+ // Check if we need to update the card table
|
| |
+ // Calc pCardByte
|
| |
+ @@ -345,13 +345,13 @@ LEAF_ENTRY JIT_ByRefWriteBarrier, _TEXT
|
| |
+ mov rax, [rax]
|
| |
+
|
| |
+ // Check if this card is dirty
|
| |
+ - cmp byte ptr [rcx + rax], 0FFh
|
| |
+ + cmp byte ptr [rcx + rax], 0xFF
|
| |
+
|
| |
+ jne UpdateCardTable_ByRefWriteBarrier
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardTable_ByRefWriteBarrier:
|
| |
+ - mov byte ptr [rcx + rax], 0FFh
|
| |
+ + mov byte ptr [rcx + rax], 0xFF
|
| |
+
|
| |
+ #ifdef FEATURE_MANUALLY_MANAGED_CARD_BUNDLES
|
| |
+ // Shift rcx by 0x0A more to get the card bundle byte (we shifted by 0x0B already)
|
| |
+ @@ -361,13 +361,13 @@ LEAF_ENTRY JIT_ByRefWriteBarrier, _TEXT
|
| |
+ add rcx, [rax]
|
| |
+
|
| |
+ // Check if this bundle byte is dirty
|
| |
+ - cmp byte ptr [rcx], 0FFh
|
| |
+ + cmp byte ptr [rcx], 0xFF
|
| |
+
|
| |
+ jne UpdateCardBundle_ByRefWriteBarrier
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardBundle_ByRefWriteBarrier:
|
| |
+ - mov byte ptr [rcx], 0FFh
|
| |
+ + mov byte ptr [rcx], 0xFF
|
| |
+ #endif
|
| |
+
|
| |
+ ret
|
| |
+ @@ -383,8 +383,8 @@ LEAF_ENTRY JIT_ByRefWriteBarrier, _TEXT
|
| |
+ #endif
|
| |
+ Exit_ByRefWriteBarrier:
|
| |
+ // Increment the pointers before leaving
|
| |
+ - add rdi, 8h
|
| |
+ - add rsi, 8h
|
| |
+ + add rdi, 0x8
|
| |
+ + add rsi, 0x8
|
| |
+ ret
|
| |
+ LEAF_END_MARKED JIT_ByRefWriteBarrier, _TEXT
|
| |
+
|
| |
+ diff --git a/src/vm/amd64/jithelpers_fastwritebarriers.S b/src/vm/amd64/jithelpers_fastwritebarriers.S
|
| |
+ index 23c1115165..0fe0e57472 100644
|
| |
+ --- a/src/vm/amd64/jithelpers_fastwritebarriers.S
|
| |
+ +++ b/src/vm/amd64/jithelpers_fastwritebarriers.S
|
| |
+ @@ -38,13 +38,13 @@ PATCH_LABEL JIT_WriteBarrier_PreGrow64_Patch_Label_CardTable
|
| |
+
|
| |
+ // Touch the card table entry, if not already dirty.
|
| |
+ shr rdi, 0x0B
|
| |
+ - cmp byte ptr [rdi + rax], 0FFh
|
| |
+ + cmp byte ptr [rdi + rax], 0xFF
|
| |
+ .byte 0x75, 0x02
|
| |
+ // jne UpdateCardTable_PreGrow64
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardTable_PreGrow64:
|
| |
+ - mov byte ptr [rdi + rax], 0FFh
|
| |
+ + mov byte ptr [rdi + rax], 0xFF
|
| |
+
|
| |
+ #ifdef FEATURE_MANUALLY_MANAGED_CARD_BUNDLES
|
| |
+ NOP_6_BYTE // padding for alignment of constant
|
| |
+ @@ -55,14 +55,14 @@ PATCH_LABEL JIT_WriteBarrier_PreGrow64_Patch_Label_CardBundleTable
|
| |
+ // Touch the card bundle, if not already dirty.
|
| |
+ // rdi is already shifted by 0xB, so shift by 0xA more
|
| |
+ shr rdi, 0x0A
|
| |
+ - cmp byte ptr [rdi + rax], 0FFh
|
| |
+ + cmp byte ptr [rdi + rax], 0xFF
|
| |
+
|
| |
+ .byte 0x75, 0x02
|
| |
+ // jne UpdateCardBundle_PreGrow64
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardBundle_PreGrow64:
|
| |
+ - mov byte ptr [rdi + rax], 0FFh
|
| |
+ + mov byte ptr [rdi + rax], 0xFF
|
| |
+ #endif
|
| |
+
|
| |
+ ret
|
| |
+ @@ -123,13 +123,13 @@ PATCH_LABEL JIT_WriteBarrier_PostGrow64_Patch_Label_CardTable
|
| |
+
|
| |
+ // Touch the card table entry, if not already dirty.
|
| |
+ shr rdi, 0x0B
|
| |
+ - cmp byte ptr [rdi + rax], 0FFh
|
| |
+ + cmp byte ptr [rdi + rax], 0xFF
|
| |
+ .byte 0x75, 0x02
|
| |
+ // jne UpdateCardTable_PostGrow64
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardTable_PostGrow64:
|
| |
+ - mov byte ptr [rdi + rax], 0FFh
|
| |
+ + mov byte ptr [rdi + rax], 0xFF
|
| |
+
|
| |
+ #ifdef FEATURE_MANUALLY_MANAGED_CARD_BUNDLES
|
| |
+ NOP_6_BYTE // padding for alignment of constant
|
| |
+ @@ -140,14 +140,14 @@ PATCH_LABEL JIT_WriteBarrier_PostGrow64_Patch_Label_CardBundleTable
|
| |
+ // Touch the card bundle, if not already dirty.
|
| |
+ // rdi is already shifted by 0xB, so shift by 0xA more
|
| |
+ shr rdi, 0x0A
|
| |
+ - cmp byte ptr [rdi + rax], 0FFh
|
| |
+ + cmp byte ptr [rdi + rax], 0xFF
|
| |
+
|
| |
+ .byte 0x75, 0x02
|
| |
+ // jne UpdateCardBundle_PostGrow64
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardBundle_PostGrow64:
|
| |
+ - mov byte ptr [rdi + rax], 0FFh
|
| |
+ + mov byte ptr [rdi + rax], 0xFF
|
| |
+ #endif
|
| |
+
|
| |
+ ret
|
| |
+ @@ -182,13 +182,13 @@ PATCH_LABEL JIT_WriteBarrier_SVR64_PatchLabel_CardTable
|
| |
+
|
| |
+ shr rdi, 0x0B
|
| |
+
|
| |
+ - cmp byte ptr [rdi + rax], 0FFh
|
| |
+ + cmp byte ptr [rdi + rax], 0xFF
|
| |
+ .byte 0x75, 0x02
|
| |
+ // jne UpdateCardTable_SVR64
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardTable_SVR64:
|
| |
+ - mov byte ptr [rdi + rax], 0FFh
|
| |
+ + mov byte ptr [rdi + rax], 0xFF
|
| |
+
|
| |
+ #ifdef FEATURE_MANUALLY_MANAGED_CARD_BUNDLES
|
| |
+ NOP_6_BYTE // padding for alignment of constant
|
| |
+ @@ -198,14 +198,14 @@ PATCH_LABEL JIT_WriteBarrier_SVR64_PatchLabel_CardBundleTable
|
| |
+
|
| |
+ // Shift the address by 0xA more since already shifted by 0xB
|
| |
+ shr rdi, 0x0A
|
| |
+ - cmp byte ptr [rdi + rax], 0FFh
|
| |
+ + cmp byte ptr [rdi + rax], 0xFF
|
| |
+
|
| |
+ .byte 0x75, 0x02
|
| |
+ // jne UpdateCardBundle_SVR64
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardBundle_SVR64:
|
| |
+ - mov byte ptr [rdi + rax], 0FFh
|
| |
+ + mov byte ptr [rdi + rax], 0xFF
|
| |
+ #endif
|
| |
+
|
| |
+ ret
|
| |
+ @@ -236,15 +236,15 @@ LEAF_ENTRY JIT_WriteBarrier_WriteWatch_PreGrow64, _TEXT
|
| |
+ mov rax, rdi
|
| |
+ PATCH_LABEL JIT_WriteBarrier_WriteWatch_PreGrow64_Patch_Label_WriteWatchTable
|
| |
+ movabs r10, 0xF0F0F0F0F0F0F0F0
|
| |
+ - shr rax, 0Ch // SoftwareWriteWatch::AddressToTableByteIndexShift
|
| |
+ + shr rax, 0xC // SoftwareWriteWatch::AddressToTableByteIndexShift
|
| |
+ NOP_2_BYTE // padding for alignment of constant
|
| |
+ PATCH_LABEL JIT_WriteBarrier_WriteWatch_PreGrow64_Patch_Label_Lower
|
| |
+ movabs r11, 0xF0F0F0F0F0F0F0F0
|
| |
+ add rax, r10
|
| |
+ - cmp byte ptr [rax], 0h
|
| |
+ + cmp byte ptr [rax], 0x0
|
| |
+ .byte 0x75, 0x03
|
| |
+ // jne CheckCardTable_WriteWatch_PreGrow64
|
| |
+ - mov byte ptr [rax], 0FFh
|
| |
+ + mov byte ptr [rax], 0xFF
|
| |
+
|
| |
+ CheckCardTable_WriteWatch_PreGrow64:
|
| |
+ // Check the lower ephemeral region bound.
|
| |
+ @@ -263,13 +263,13 @@ PATCH_LABEL JIT_WriteBarrier_WriteWatch_PreGrow64_Patch_Label_Lower
|
| |
+ NOP_2_BYTE // padding for alignment of constant
|
| |
+ PATCH_LABEL JIT_WriteBarrier_WriteWatch_PreGrow64_Patch_Label_CardTable
|
| |
+ movabs rax, 0xF0F0F0F0F0F0F0F0
|
| |
+ - cmp byte ptr [rdi + rax], 0FFh
|
| |
+ + cmp byte ptr [rdi + rax], 0xFF
|
| |
+ .byte 0x75, 0x02
|
| |
+ // jne UpdateCardTable_WriteWatch_PreGrow64
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardTable_WriteWatch_PreGrow64:
|
| |
+ - mov byte ptr [rdi + rax], 0FFh
|
| |
+ + mov byte ptr [rdi + rax], 0xFF
|
| |
+
|
| |
+ #ifdef FEATURE_MANUALLY_MANAGED_CARD_BUNDLES
|
| |
+ NOP_2_BYTE // padding for alignment of constant
|
| |
+ @@ -277,14 +277,14 @@ PATCH_LABEL JIT_WriteBarrier_WriteWatch_PreGrow64_Patch_Label_CardBundleTable
|
| |
+ movabs rax, 0xF0F0F0F0F0F0F0F0
|
| |
+
|
| |
+ shr rdi, 0x0A
|
| |
+ - cmp byte ptr [rdi + rax], 0FFh
|
| |
+ + cmp byte ptr [rdi + rax], 0xFF
|
| |
+
|
| |
+ .byte 0x75, 0x02
|
| |
+ // jne UpdateCardBundle_WriteWatch_PreGrow64
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardBundle_WriteWatch_PreGrow64:
|
| |
+ - mov byte ptr [rdi + rax], 0FFh
|
| |
+ + mov byte ptr [rdi + rax], 0xFF
|
| |
+ #endif
|
| |
+
|
| |
+ ret
|
| |
+ @@ -314,15 +314,15 @@ LEAF_ENTRY JIT_WriteBarrier_WriteWatch_PostGrow64, _TEXT
|
| |
+ mov rax, rdi
|
| |
+ PATCH_LABEL JIT_WriteBarrier_WriteWatch_PostGrow64_Patch_Label_WriteWatchTable
|
| |
+ movabs r10, 0xF0F0F0F0F0F0F0F0
|
| |
+ - shr rax, 0Ch // SoftwareWriteWatch::AddressToTableByteIndexShift
|
| |
+ + shr rax, 0xC // SoftwareWriteWatch::AddressToTableByteIndexShift
|
| |
+ NOP_2_BYTE // padding for alignment of constant
|
| |
+ PATCH_LABEL JIT_WriteBarrier_WriteWatch_PostGrow64_Patch_Label_Lower
|
| |
+ movabs r11, 0xF0F0F0F0F0F0F0F0
|
| |
+ add rax, r10
|
| |
+ - cmp byte ptr [rax], 0h
|
| |
+ + cmp byte ptr [rax], 0x0
|
| |
+ .byte 0x75, 0x06
|
| |
+ // jne CheckCardTable_WriteWatch_PostGrow64
|
| |
+ - mov byte ptr [rax], 0FFh
|
| |
+ + mov byte ptr [rax], 0xFF
|
| |
+
|
| |
+ NOP_3_BYTE // padding for alignment of constant
|
| |
+
|
| |
+ @@ -358,13 +358,13 @@ PATCH_LABEL JIT_WriteBarrier_WriteWatch_PostGrow64_Patch_Label_CardTable
|
| |
+
|
| |
+ // Touch the card table entry, if not already dirty.
|
| |
+ shr rdi, 0x0B
|
| |
+ - cmp byte ptr [rdi + rax], 0FFh
|
| |
+ + cmp byte ptr [rdi + rax], 0xFF
|
| |
+ .byte 0x75, 0x02
|
| |
+ // jne UpdateCardTable_WriteWatch_PostGrow64
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardTable_WriteWatch_PostGrow64:
|
| |
+ - mov byte ptr [rdi + rax], 0FFh
|
| |
+ + mov byte ptr [rdi + rax], 0xFF
|
| |
+
|
| |
+ #ifdef FEATURE_MANUALLY_MANAGED_CARD_BUNDLES
|
| |
+ NOP_2_BYTE // padding for alignment of constant
|
| |
+ @@ -372,14 +372,14 @@ PATCH_LABEL JIT_WriteBarrier_WriteWatch_PostGrow64_Patch_Label_CardTable
|
| |
+
|
| |
+ PATCH_LABEL JIT_WriteBarrier_WriteWatch_PostGrow64_Patch_Label_CardBundleTable
|
| |
+ movabs rax, 0xF0F0F0F0F0F0F0F0
|
| |
+ - cmp byte ptr [rdi + rax], 0FFh
|
| |
+ + cmp byte ptr [rdi + rax], 0xFF
|
| |
+
|
| |
+ .byte 0x75, 0x02
|
| |
+ // jne UpdateCardBundle_WriteWatch_PostGrow64
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardBundle_WriteWatch_PostGrow64:
|
| |
+ - mov byte ptr [rdi + rax], 0FFh
|
| |
+ + mov byte ptr [rdi + rax], 0xFF
|
| |
+ #endif
|
| |
+
|
| |
+ ret
|
| |
+ @@ -417,25 +417,25 @@ LEAF_ENTRY JIT_WriteBarrier_WriteWatch_SVR64, _TEXT
|
| |
+ mov rax, rdi
|
| |
+ PATCH_LABEL JIT_WriteBarrier_WriteWatch_SVR64_PatchLabel_WriteWatchTable
|
| |
+ movabs r10, 0xF0F0F0F0F0F0F0F0
|
| |
+ - shr rax, 0Ch // SoftwareWriteWatch::AddressToTableByteIndexShift
|
| |
+ + shr rax, 0xC // SoftwareWriteWatch::AddressToTableByteIndexShift
|
| |
+ NOP_2_BYTE // padding for alignment of constant
|
| |
+ PATCH_LABEL JIT_WriteBarrier_WriteWatch_SVR64_PatchLabel_CardTable
|
| |
+ movabs r11, 0xF0F0F0F0F0F0F0F0
|
| |
+ add rax, r10
|
| |
+ - cmp byte ptr [rax], 0h
|
| |
+ + cmp byte ptr [rax], 0x0
|
| |
+ .byte 0x75, 0x03
|
| |
+ // jne CheckCardTable_WriteWatch_SVR64
|
| |
+ - mov byte ptr [rax], 0FFh
|
| |
+ + mov byte ptr [rax], 0xFF
|
| |
+
|
| |
+ CheckCardTable_WriteWatch_SVR64:
|
| |
+ shr rdi, 0x0B
|
| |
+ - cmp byte ptr [rdi + r11], 0FFh
|
| |
+ + cmp byte ptr [rdi + r11], 0xFF
|
| |
+ .byte 0x75, 0x02
|
| |
+ // jne UpdateCardTable_WriteWatch_SVR64
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardTable_WriteWatch_SVR64:
|
| |
+ - mov byte ptr [rdi + r11], 0FFh
|
| |
+ + mov byte ptr [rdi + r11], 0xFF
|
| |
+
|
| |
+ #ifdef FEATURE_MANUALLY_MANAGED_CARD_BUNDLES
|
| |
+ NOP // padding for alignment of constant
|
| |
+ @@ -444,13 +444,13 @@ PATCH_LABEL JIT_WriteBarrier_WriteWatch_SVR64_PatchLabel_CardBundleTable
|
| |
+ movabs r11, 0xF0F0F0F0F0F0F0F0
|
| |
+
|
| |
+ shr rdi, 0x0A
|
| |
+ - cmp byte ptr [rdi + r11], 0FFh
|
| |
+ + cmp byte ptr [rdi + r11], 0xFF
|
| |
+ .byte 0x75, 0x02
|
| |
+ // jne UpdateCardBundle_WriteWatch_SVR64
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardBundle_WriteWatch_SVR64:
|
| |
+ - mov byte ptr [rdi + r11], 0FFh
|
| |
+ + mov byte ptr [rdi + r11], 0xFF
|
| |
+ #endif
|
| |
+
|
| |
+ ret
|
| |
+ diff --git a/src/vm/amd64/jithelpers_slow.S b/src/vm/amd64/jithelpers_slow.S
|
| |
+ index f61b42afc7..aa2e8cc064 100644
|
| |
+ --- a/src/vm/amd64/jithelpers_slow.S
|
| |
+ +++ b/src/vm/amd64/jithelpers_slow.S
|
| |
+ @@ -71,15 +71,15 @@ LEAF_ENTRY JIT_WriteBarrier_Debug, _TEXT
|
| |
+ #ifdef FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP
|
| |
+ // Update the write watch table if necessary
|
| |
+ PREPARE_EXTERNAL_VAR g_sw_ww_enabled_for_gc_heap, r10
|
| |
+ - cmp byte ptr [r10], 0h
|
| |
+ + cmp byte ptr [r10], 0x0
|
| |
+ je CheckCardTable_Debug
|
| |
+ mov r10, rdi
|
| |
+ - shr r10, 0Ch // SoftwareWriteWatch::AddressToTableByteIndexShift
|
| |
+ + shr r10, 0xC // SoftwareWriteWatch::AddressToTableByteIndexShift
|
| |
+ PREPARE_EXTERNAL_VAR g_sw_ww_table, r11
|
| |
+ add r10, qword ptr [r11]
|
| |
+ - cmp byte ptr [r10], 0h
|
| |
+ + cmp byte ptr [r10], 0x0
|
| |
+ jne CheckCardTable_Debug
|
| |
+ - mov byte ptr [r10], 0FFh
|
| |
+ + mov byte ptr [r10], 0xFF
|
| |
+ #endif
|
| |
+
|
| |
+ CheckCardTable_Debug:
|
| |
+ @@ -99,13 +99,13 @@ LEAF_ENTRY JIT_WriteBarrier_Debug, _TEXT
|
| |
+ mov r10, [r10]
|
| |
+
|
| |
+ // Check if this card is dirty
|
| |
+ - cmp byte ptr [rdi + r10], 0FFh
|
| |
+ + cmp byte ptr [rdi + r10], 0xFF
|
| |
+
|
| |
+ jne UpdateCardTable_Debug
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardTable_Debug:
|
| |
+ - mov byte ptr [rdi + r10], 0FFh
|
| |
+ + mov byte ptr [rdi + r10], 0xFF
|
| |
+
|
| |
+ #ifdef FEATURE_MANUALLY_MANAGED_CARD_BUNDLES
|
| |
+ // Shift rdi by 0x0A more to get the card bundle byte (we shifted by 0x0B already)
|
| |
+ @@ -115,13 +115,13 @@ LEAF_ENTRY JIT_WriteBarrier_Debug, _TEXT
|
| |
+ add rdi, [r10]
|
| |
+
|
| |
+ // Check if this bundle byte is dirty
|
| |
+ - cmp byte ptr [rdi], 0FFh
|
| |
+ + cmp byte ptr [rdi], 0xFF
|
| |
+
|
| |
+ jne UpdateCardBundle_Debug
|
| |
+ REPRET
|
| |
+
|
| |
+ UpdateCardBundle_Debug:
|
| |
+ - mov byte ptr [rdi], 0FFh
|
| |
+ + mov byte ptr [rdi], 0xFF
|
| |
+ #endif
|
| |
+
|
| |
+ ret
|
| |
+ diff --git a/src/vm/amd64/virtualcallstubamd64.S b/src/vm/amd64/virtualcallstubamd64.S
|
| |
+ index 59b5b77dba..38c33d498e 100644
|
| |
+ --- a/src/vm/amd64/virtualcallstubamd64.S
|
| |
+ +++ b/src/vm/amd64/virtualcallstubamd64.S
|
| |
+ @@ -59,19 +59,19 @@ LEAF_ENTRY ResolveWorkerChainLookupAsmStub, _TEXT
|
| |
+ jnz Fail_RWCLAS // If the BACKPATCH_FLAGS is set we will go directly to the ResolveWorkerAsmStub
|
| |
+
|
| |
+ MainLoop_RWCLAS:
|
| |
+ - mov rax, [rax+18h] // get the next entry in the chain (don't bother checking the first entry again)
|
| |
+ + mov rax, [rax+0x18] // get the next entry in the chain (don't bother checking the first entry again)
|
| |
+ test rax,rax // test if we hit a terminating NULL
|
| |
+ jz Fail_RWCLAS
|
| |
+
|
| |
+ - cmp rdx, [rax+00h] // compare our MT with the one in the ResolveCacheElem
|
| |
+ + cmp rdx, [rax+0x0] // compare our MT with the one in the ResolveCacheElem
|
| |
+ jne MainLoop_RWCLAS
|
| |
+ - cmp r10, [rax+08h] // compare our DispatchToken with one in the ResolveCacheElem
|
| |
+ + cmp r10, [rax+0x8] // compare our DispatchToken with one in the ResolveCacheElem
|
| |
+ jne MainLoop_RWCLAS
|
| |
+ Success_RWCLAS:
|
| |
+ PREPARE_EXTERNAL_VAR CHAIN_SUCCESS_COUNTER, rdx
|
| |
+ sub qword ptr [rdx],1 // decrement success counter
|
| |
+ jl Promote_RWCLAS
|
| |
+ - mov rax, [rax+10h] // get the ImplTarget
|
| |
+ + mov rax, [rax+0x10] // get the ImplTarget
|
| |
+ pop rdx
|
| |
+ jmp rax
|
| |
+
|
| |
Also update optflags patch to pass -D_GNU_SOURCE to make sure our
build-time flags match the configure-time flags. Otherwise some
functions like strerror_r() get different definitions.
Add a new patch to fix builds against newer versions of clang. Recent
versions of clang refuse to compile assembly code that use hex constants
with
0..h
prefix + suffix to mean a hex char. This syntax is alsorejected by newer versions of GCC. Use plain
0x..
instead.Renumber patches to make a little more sense: corefx is 100-series,
coreclr is 200-series, core-setup is 300-series and cli is 400-series.
Add some scripts to automate the update-to-a-new-upstream-release
process.
Sync spec file with other releases.
Build: https://copr.fedorainfracloud.org/coprs/g/dotnet-sig/dotnet/build/882655/