diff --git a/src/coreclr/pal/inc/unixasmmacrosamd64.inc b/src/coreclr/pal/inc/unixasmmacrosamd64.inc index bc6d770a51824..6c4371e92f693 100644 --- a/src/coreclr/pal/inc/unixasmmacrosamd64.inc +++ b/src/coreclr/pal/inc/unixasmmacrosamd64.inc @@ -186,6 +186,7 @@ C_FUNC(\Name\()_End): .macro PUSH_ARGUMENT_REGISTERS + push_argument_register rax push_argument_register r9 push_argument_register r8 push_argument_register rcx @@ -217,6 +218,7 @@ C_FUNC(\Name\()_End): pop_argument_register rcx pop_argument_register r8 pop_argument_register r9 + pop_argument_register rax .endm @@ -257,6 +259,7 @@ C_FUNC(\Name\()_End): // CalleeSavedRegisters::r14 // CalleeSavedRegisters::r13 // CalleeSavedRegisters::r12 +// TransitionBlock::m_raxSwiftRetBufReg // ArgumentRegisters::r9 // ArgumentRegisters::r8 // ArgumentRegisters::rcx @@ -283,7 +286,7 @@ C_FUNC(\Name\()_End): __PWTB_FloatArgumentRegisters = __PWTB_FloatArgumentRegisters + 8 .endif - __PWTB_StackAlloc = __PWTB_FloatArgumentRegisters + 8 * 16 + 8 // 8 floating point registers + __PWTB_StackAlloc = __PWTB_FloatArgumentRegisters + 8 * 16 // 8 floating point registers __PWTB_TransitionBlock = __PWTB_StackAlloc .if \stackAllocOnEntry >= 4*8 diff --git a/src/coreclr/vm/amd64/theprestubamd64.S b/src/coreclr/vm/amd64/theprestubamd64.S index dd02f70780e2f..0adfc8aab2558 100644 --- a/src/coreclr/vm/amd64/theprestubamd64.S +++ b/src/coreclr/vm/amd64/theprestubamd64.S @@ -14,9 +14,10 @@ NESTED_ENTRY ThePreStub, _TEXT, NoHandler lea rdi, [rsp + __PWTB_TransitionBlock] // pTransitionBlock* mov rsi, METHODDESC_REGISTER call C_FUNC(PreStubWorker) + mov r10, rax EPILOG_WITH_TRANSITION_BLOCK_TAILCALL - TAILJMP_RAX + jmp r10 NESTED_END ThePreStub, _TEXT diff --git a/src/coreclr/vm/amd64/umthunkstub.S b/src/coreclr/vm/amd64/umthunkstub.S index 2abbbd222446c..ad5100ff84edf 100644 --- a/src/coreclr/vm/amd64/umthunkstub.S +++ b/src/coreclr/vm/amd64/umthunkstub.S @@ -10,8 +10,7 @@ // NESTED_ENTRY TheUMEntryPrestub, _TEXT, UnhandledExceptionHandlerUnix PUSH_ARGUMENT_REGISTERS - // +8 for alignment - alloc_stack (SIZEOF_MAX_FP_ARG_SPILL + 8) + alloc_stack (SIZEOF_MAX_FP_ARG_SPILL) SAVE_FLOAT_ARGUMENT_REGISTERS 0 END_PROLOGUE @@ -21,7 +20,7 @@ NESTED_ENTRY TheUMEntryPrestub, _TEXT, UnhandledExceptionHandlerUnix // we're going to tail call to the exec stub that we just setup RESTORE_FLOAT_ARGUMENT_REGISTERS 0 - free_stack (SIZEOF_MAX_FP_ARG_SPILL + 8) + free_stack (SIZEOF_MAX_FP_ARG_SPILL) POP_ARGUMENT_REGISTERS TAILJMP_RAX diff --git a/src/coreclr/vm/amd64/unixasmhelpers.S b/src/coreclr/vm/amd64/unixasmhelpers.S index 77fe1384dcd9e..7c340d159d4bb 100644 --- a/src/coreclr/vm/amd64/unixasmhelpers.S +++ b/src/coreclr/vm/amd64/unixasmhelpers.S @@ -75,7 +75,6 @@ NESTED_ENTRY NDirectImportThunk, _TEXT, NoHandler // PUSH_ARGUMENT_REGISTERS push_register r11 - push_register rax // // Allocate space for XMM parameter registers and alignment @@ -103,7 +102,6 @@ NESTED_ENTRY NDirectImportThunk, _TEXT, NoHandler // // Restore integer parameter registers, r11 and rax // - pop_register rax pop_register r11 POP_ARGUMENT_REGISTERS diff --git a/src/coreclr/vm/callingconvention.h b/src/coreclr/vm/callingconvention.h index 12b935996b1a4..1ae564c0d5b73 100644 --- a/src/coreclr/vm/callingconvention.h +++ b/src/coreclr/vm/callingconvention.h @@ -118,6 +118,7 @@ struct TransitionBlock #elif defined(TARGET_AMD64) #ifdef UNIX_AMD64_ABI ArgumentRegisters m_argumentRegisters; + INT64 m_raxSwiftRetBufReg; #endif CalleeSavedRegisters m_calleeSavedRegisters; TADDR m_ReturnAddress;