summaryrefslogtreecommitdiff
path: root/src/vm/amd64/JitHelpers_Slow.asm
diff options
context:
space:
mode:
Diffstat (limited to 'src/vm/amd64/JitHelpers_Slow.asm')
-rw-r--r--src/vm/amd64/JitHelpers_Slow.asm68
1 files changed, 32 insertions, 36 deletions
diff --git a/src/vm/amd64/JitHelpers_Slow.asm b/src/vm/amd64/JitHelpers_Slow.asm
index 7deed49d98..293e447540 100644
--- a/src/vm/amd64/JitHelpers_Slow.asm
+++ b/src/vm/amd64/JitHelpers_Slow.asm
@@ -467,13 +467,9 @@ NESTED_END JIT_NewArr1OBJ_MP, _TEXT
-; <TODO> this m_GCLock should be a size_t so we don't have a store-forwarding penalty in the code below.
-; Unfortunately, the compiler intrinsic for InterlockedExchangePointer seems to be broken and we
-; get bad code gen in gc.cpp on IA64. </TODO>
-M_GCLOCK equ ?m_GCLock@@3HC
-extern M_GCLOCK:dword
-extern generation_table:qword
+extern g_global_alloc_lock:dword
+extern g_global_alloc_context:qword
LEAF_ENTRY JIT_TrialAllocSFastSP, _TEXT
@@ -481,20 +477,20 @@ LEAF_ENTRY JIT_TrialAllocSFastSP, _TEXT
; m_BaseSize is guaranteed to be a multiple of 8.
- inc [M_GCLOCK]
+ inc [g_global_alloc_lock]
jnz JIT_NEW
- mov rax, [generation_table + 0] ; alloc_ptr
- mov r10, [generation_table + 8] ; limit_ptr
+ mov rax, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr] ; alloc_ptr
+ mov r10, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_limit] ; limit_ptr
add r8, rax
cmp r8, r10
ja AllocFailed
- mov qword ptr [generation_table + 0], r8 ; update the alloc ptr
+ mov qword ptr [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr], r8 ; update the alloc ptr
mov [rax], rcx
- mov [M_GCLOCK], -1
+ mov [g_global_alloc_lock], -1
ifdef _DEBUG
call DEBUG_TrialAllocSetAppDomain_NoScratchArea
@@ -503,7 +499,7 @@ endif ; _DEBUG
ret
AllocFailed:
- mov [M_GCLOCK], -1
+ mov [g_global_alloc_lock], -1
jmp JIT_NEW
LEAF_END JIT_TrialAllocSFastSP, _TEXT
@@ -520,11 +516,11 @@ NESTED_ENTRY JIT_BoxFastUP, _TEXT
; m_BaseSize is guaranteed to be a multiple of 8.
- inc [M_GCLOCK]
+ inc [g_global_alloc_lock]
jnz JIT_Box
- mov rax, [generation_table + 0] ; alloc_ptr
- mov r10, [generation_table + 8] ; limit_ptr
+ mov rax, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr] ; alloc_ptr
+ mov r10, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_limit] ; limit_ptr
add r8, rax
@@ -532,9 +528,9 @@ NESTED_ENTRY JIT_BoxFastUP, _TEXT
ja NoAlloc
- mov qword ptr [generation_table + 0], r8 ; update the alloc ptr
+ mov qword ptr [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr], r8 ; update the alloc ptr
mov [rax], rcx
- mov [M_GCLOCK], -1
+ mov [g_global_alloc_lock], -1
ifdef _DEBUG
call DEBUG_TrialAllocSetAppDomain_NoScratchArea
@@ -574,7 +570,7 @@ endif ; _DEBUG
ret
NoAlloc:
- mov [M_GCLOCK], -1
+ mov [g_global_alloc_lock], -1
jmp JIT_Box
NESTED_END JIT_BoxFastUP, _TEXT
@@ -602,20 +598,20 @@ LEAF_ENTRY AllocateStringFastUP, _TEXT
lea r8d, [r8d + ecx*2 + 7]
and r8d, -8
- inc [M_GCLOCK]
+ inc [g_global_alloc_lock]
jnz FramedAllocateString
- mov rax, [generation_table + 0] ; alloc_ptr
- mov r10, [generation_table + 8] ; limit_ptr
+ mov rax, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr] ; alloc_ptr
+ mov r10, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_limit] ; limit_ptr
add r8, rax
cmp r8, r10
ja AllocFailed
- mov qword ptr [generation_table + 0], r8 ; update the alloc ptr
+ mov qword ptr [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr], r8 ; update the alloc ptr
mov [rax], r11
- mov [M_GCLOCK], -1
+ mov [g_global_alloc_lock], -1
mov [rax + OFFSETOF__StringObject__m_StringLength], ecx
@@ -626,7 +622,7 @@ endif ; _DEBUG
ret
AllocFailed:
- mov [M_GCLOCK], -1
+ mov [g_global_alloc_lock], -1
jmp FramedAllocateString
LEAF_END AllocateStringFastUP, _TEXT
@@ -668,11 +664,11 @@ LEAF_ENTRY JIT_NewArr1VC_UP, _TEXT
add r8d, 7
and r8d, -8
- inc [M_GCLOCK]
+ inc [g_global_alloc_lock]
jnz JIT_NewArr1
- mov rax, [generation_table + 0] ; alloc_ptr
- mov r10, [generation_table + 8] ; limit_ptr
+ mov rax, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr] ; alloc_ptr
+ mov r10, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_limit] ; limit_ptr
add r8, rax
jc AllocFailed
@@ -680,9 +676,9 @@ LEAF_ENTRY JIT_NewArr1VC_UP, _TEXT
cmp r8, r10
ja AllocFailed
- mov qword ptr [generation_table + 0], r8 ; update the alloc ptr
+ mov qword ptr [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr], r8 ; update the alloc ptr
mov [rax], r9
- mov [M_GCLOCK], -1
+ mov [g_global_alloc_lock], -1
mov dword ptr [rax + OFFSETOF__ArrayBase__m_NumComponents], edx
@@ -693,7 +689,7 @@ endif ; _DEBUG
ret
AllocFailed:
- mov [M_GCLOCK], -1
+ mov [g_global_alloc_lock], -1
jmp JIT_NewArr1
LEAF_END JIT_NewArr1VC_UP, _TEXT
@@ -731,20 +727,20 @@ LEAF_ENTRY JIT_NewArr1OBJ_UP, _TEXT
; No need for rounding in this case - element size is 8, and m_BaseSize is guaranteed
; to be a multiple of 8.
- inc [M_GCLOCK]
+ inc [g_global_alloc_lock]
jnz JIT_NewArr1
- mov rax, [generation_table + 0] ; alloc_ptr
- mov r10, [generation_table + 8] ; limit_ptr
+ mov rax, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr] ; alloc_ptr
+ mov r10, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_limit] ; limit_ptr
add r8, rax
cmp r8, r10
ja AllocFailed
- mov qword ptr [generation_table + 0], r8 ; update the alloc ptr
+ mov qword ptr [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr], r8 ; update the alloc ptr
mov [rax], r9
- mov [M_GCLOCK], -1
+ mov [g_global_alloc_lock], -1
mov dword ptr [rax + OFFSETOF__ArrayBase__m_NumComponents], edx
@@ -755,7 +751,7 @@ endif ; _DEBUG
ret
AllocFailed:
- mov [M_GCLOCK], -1
+ mov [g_global_alloc_lock], -1
OversizedArray:
jmp JIT_NewArr1