diff options
author | Faizur Rahman <shrah@microsoft.com> | 2017-03-01 00:00:07 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-03-01 00:00:07 +0300 |
commit | 82b4ca49acfe611d905bc2f7b1c9b8a4e4d76096 (patch) | |
tree | 2931d504ca5c0d90958b9570a3e4428475bd1bb9 /src/Native/Runtime/amd64 | |
parent | c2f57a084f760d7d7b80aee2c36f51daaa689c0b (diff) |
Preserve scratch register r10 in RhpCommonStub (#2850)
INLINE_GET_TLS_VAR can corrupt scratch register r10 which contains the address of thunkData.
This trivial change ensures we preserve it's value.
Diffstat (limited to 'src/Native/Runtime/amd64')
-rw-r--r-- | src/Native/Runtime/amd64/InteropThunksHelpers.S | 14 | ||||
-rw-r--r-- | src/Native/Runtime/amd64/UniversalTransition.S | 2 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/Native/Runtime/amd64/InteropThunksHelpers.S b/src/Native/Runtime/amd64/InteropThunksHelpers.S index 90f36f1a9..136484dd1 100644 --- a/src/Native/Runtime/amd64/InteropThunksHelpers.S +++ b/src/Native/Runtime/amd64/InteropThunksHelpers.S @@ -10,22 +10,22 @@ LEAF_ENTRY RhpCommonStub, _TEXT PUSH_ARGUMENT_REGISTERS + push_register r10 - // +8 for alignment - alloc_stack (SIZEOF_MAX_FP_ARG_SPILL + 8) + alloc_stack SIZEOF_FP_REGS SAVE_FLOAT_ARGUMENT_REGISTERS 0 INLINE_GET_TLS_VAR tls_thunkData - mov r11, [r10] - mov qword ptr [rax], r11 - - RESTORE_FLOAT_ARGUMENT_REGISTERS 0 - free_stack (SIZEOF_MAX_FP_ARG_SPILL + 8) + free_stack SIZEOF_FP_REGS + pop_register r10 POP_ARGUMENT_REGISTERS + mov r11, [r10] + mov qword ptr [rax], r11 + mov rax, [r10 + POINTER_SIZE] jmp rax LEAF_END RhpCommonStub, _TEXT diff --git a/src/Native/Runtime/amd64/UniversalTransition.S b/src/Native/Runtime/amd64/UniversalTransition.S index eda5f0bdf..cde0ba53b 100644 --- a/src/Native/Runtime/amd64/UniversalTransition.S +++ b/src/Native/Runtime/amd64/UniversalTransition.S @@ -16,8 +16,6 @@ #define SIZEOF_RETURN_BLOCK 0x10 // for 16 bytes of conservatively reported space that the callee can // use to manage the return value that the call eventually generates -#define SIZEOF_FP_REGS 0x80 // xmm0-7 - #define SIZEOF_ARGUMENT_REGISTERS 0x30 // Callee register spill // |