//
// Copyright (c) Microsoft. All rights reserved.
// Copyright (c) Geoff Norton. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
.intel_syntax noprefix
// It is IMPORANT that the exception handling code is able to find these guys
// on the stack, but on non-windows platforms we can just defer to the platform
// implementation.
-//
+//
LEAF_ENTRY JIT_MemSet, _TEXT
test rdx, rdx
cmp byte ptr [rdi], 0
- jmp C_FUNC(memset)
+ jmp C_PLTFUNC(memset)
Exit_MemSet:
ret
cmp byte ptr [rdi], 0
cmp byte ptr [rsi], 0
- jmp C_FUNC(memcpy)
+ jmp C_PLTFUNC(memset)
Exit_MemCpy:
ret
//
// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
#define INVALIDGCVALUE -0x33333333 // 0CCCCCCCDh - the assembler considers it to be a signed integer constant
-.macro NOP_3_BYTE
+.macro NOP_3_BYTE
nop dword ptr [rax]
.endm
-.macro NOP_2_BYTE
+.macro NOP_2_BYTE
xchg ax, ax
.endm
#define C_FUNC(name) name
#endif
+#if defined(__APPLE__)
+#define C_PLTFUNC(name) _##name
+#else
+#define C_PLTFUNC(name) name@PLT
+#endif
+
.macro PATCH_LABEL Name
.global C_FUNC(\Name)
C_FUNC(\Name):
// this one gives an "unknown directive" error
//
// .savexmm128 \Reg, \Offset
-
+
___STACK_ADJUSTMENT_FORBIDDEN = 1
.endm
.macro restore_xmm128 Reg, ofs
__Offset = \ofs
movdqa \Reg, [rsp + __Offset]
-.endm
+.endm
.macro POP_CALLEE_SAVED_REGISTERS
// CalleeSavedRegisters::r13
// CalleeSavedRegisters::r12
// CalleeSavedRegisters::rbp
-// CalleeSavedRegisters::rbx
+// CalleeSavedRegisters::rbx
// ArgumentRegisters::r9
// ArgumentRegisters::r8
// ArgumentRegisters::rcx
push_nonvol_reg r12
push_nonvol_reg rbp
push_nonvol_reg rbx
-
+
// ArgumentRegisters
PUSH_ARGUMENT_REGISTERS
alloc_stack __PWTB_StackAlloc
SAVE_FLOAT_ARGUMENT_REGISTERS __PWTB_FloatArgumentRegisters
-
+
END_PROLOGUE
.endm
-.macro EPILOG_WITH_TRANSITION_BLOCK_TAILCALL
+.macro EPILOG_WITH_TRANSITION_BLOCK_TAILCALL
RESTORE_FLOAT_ARGUMENT_REGISTERS __PWTB_FloatArgumentRegisters
lea rsp, [rsp + __PWTB_StackAlloc]