summaryrefslogtreecommitdiff
path: root/src/vm/amd64/jithelpers_singleappdomain.S
diff options
context:
space:
mode:
Diffstat (limited to 'src/vm/amd64/jithelpers_singleappdomain.S')
-rw-r--r--src/vm/amd64/jithelpers_singleappdomain.S49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/vm/amd64/jithelpers_singleappdomain.S b/src/vm/amd64/jithelpers_singleappdomain.S
new file mode 100644
index 0000000000..307d86b7fe
--- /dev/null
+++ b/src/vm/amd64/jithelpers_singleappdomain.S
@@ -0,0 +1,49 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+.intel_syntax noprefix
+#include "unixasmmacros.inc"
+#include "asmconstants.h"
+
+//
+// JIT Static access helpers when coreclr host specifies single
+// appdomain flag
+//
+
+LEAF_ENTRY JIT_GetSharedNonGCStaticBase_SingleAppDomain, _TEXT
+ // If class is not initialized, bail to C++ helper
+ test byte ptr [rdi + OFFSETOF__DomainLocalModule__m_pDataBlob + rsi], 1
+ jz CallHelper
+ mov rax, rdi
+ rep ret
+
+.balign 16
+CallHelper:
+ // Tail call JIT_GetSharedNonGCStaticBase_Helper
+ jmp C_FUNC(JIT_GetSharedNonGCStaticBase_Helper)
+LEAF_END_MARKED JIT_GetSharedNonGCStaticBase_SingleAppDomain, _TEXT
+
+LEAF_ENTRY JIT_GetSharedNonGCStaticBaseNoCtor_SingleAppDomain, _TEXT
+ mov rax, rdi
+ ret
+LEAF_END JIT_GetSharedNonGCStaticBaseNoCtor_SingleAppDomain, _TEXT
+
+LEAF_ENTRY JIT_GetSharedGCStaticBase_SingleAppDomain, _TEXT
+ // If class is not initialized, bail to C++ helper
+ test byte ptr [rdi + OFFSETOF__DomainLocalModule__m_pDataBlob + rsi], 1
+ jz CallHelper1
+
+ mov rax, [rdi + OFFSETOF__DomainLocalModule__m_pGCStatics]
+ rep ret
+
+.balign 16
+CallHelper1:
+ // Tail call Jit_GetSharedGCStaticBase_Helper
+ jmp C_FUNC(JIT_GetSharedGCStaticBase_Helper)
+LEAF_END JIT_GetSharedGCStaticBase_SingleAppDomain, _TEXT
+
+LEAF_ENTRY JIT_GetSharedGCStaticBaseNoCtor_SingleAppDomain, _TEXT
+ mov rax, [rdi + OFFSETOF__DomainLocalModule__m_pGCStatics]
+ ret
+LEAF_END JIT_GetSharedGCStaticBaseNoCtor_SingleAppDomain, _TEXT