diff options
author | Geoff Norton <grompf@gmail.com> | 2015-02-26 17:12:49 +0900 |
---|---|---|
committer | Geoff Norton <grompf@gmail.com> | 2015-02-26 17:12:49 +0900 |
commit | 9ef30782816e1ad6c300b5f6a90a9dd3878460c8 (patch) | |
tree | d54555f516dbb4652b3ce78a59dce295941a4704 /src | |
parent | 17127950a12b2afe3bf9e6526ddc7d19749781ff (diff) | |
download | coreclr-9ef30782816e1ad6c300b5f6a90a9dd3878460c8.tar.gz coreclr-9ef30782816e1ad6c300b5f6a90a9dd3878460c8.tar.bz2 coreclr-9ef30782816e1ad6c300b5f6a90a9dd3878460c8.zip |
Implement ExternalMethodFixupStub, VirtualMethodFixupStub and StubDispatchFixupStub for UNIX
Diffstat (limited to 'src')
-rw-r--r-- | src/vm/CMakeLists.txt | 9 | ||||
-rw-r--r-- | src/vm/amd64/externalmethodfixupthunk.S | 47 | ||||
-rw-r--r-- | src/vm/amd64/unixstubs.cpp | 32 | ||||
-rw-r--r-- | src/vm/amd64/virtualcallstubamd64.S | 20 |
4 files changed, 72 insertions, 36 deletions
diff --git a/src/vm/CMakeLists.txt b/src/vm/CMakeLists.txt index a395f2339d..5795fa3d91 100644 --- a/src/vm/CMakeLists.txt +++ b/src/vm/CMakeLists.txt @@ -326,14 +326,15 @@ set(VM_SOURCES_WKS_AMD64_ASM else() set(VM_SOURCES_WKS_AMD64_ASM + ${AMD64_SOURCES_DIR}/calldescrworkeramd64.S ${AMD64_SOURCES_DIR}/crthelpers.S + ${AMD64_SOURCES_DIR}/externalmethodfixupthunk.S + ${AMD64_SOURCES_DIR}/getstate.S + ${AMD64_SOURCES_DIR}/jithelpers_fast.S ${AMD64_SOURCES_DIR}/jithelpers_fastwritebarriers.S ${AMD64_SOURCES_DIR}/jithelpers_slow.S - ${AMD64_SOURCES_DIR}/jithelpers_fast.S - ${AMD64_SOURCES_DIR}/getstate.S - ${AMD64_SOURCES_DIR}/calldescrworkeramd64.S - ${AMD64_SOURCES_DIR}/unixasmhelpers.S ${AMD64_SOURCES_DIR}/theprestubamd64.S + ${AMD64_SOURCES_DIR}/unixasmhelpers.S ${AMD64_SOURCES_DIR}/umthunkstub.S ${AMD64_SOURCES_DIR}/virtualcallstubamd64.S ) diff --git a/src/vm/amd64/externalmethodfixupthunk.S b/src/vm/amd64/externalmethodfixupthunk.S new file mode 100644 index 0000000000..ed58f70d53 --- /dev/null +++ b/src/vm/amd64/externalmethodfixupthunk.S @@ -0,0 +1,47 @@ +// +// 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. +// +; +.intel_syntax noprefix +#include "unixasmmacros.inc" +#include "asmconstants.h" + +//============================================================================================ +// EXTERN_C VOID __stdcall ExternalMethodFixupStub() + +NESTED_ENTRY ExternalMethodFixupStub, _TEXT, ProcessCLRException + + PROLOG_WITH_TRANSITION_BLOCK 0, 8, rdx, 0, 0 + + lea rdi, [rsp + __PWTB_TransitionBlock] // pTransitionBlock + sub rsi, 5 // pThunk + mov rdx, 0 // sectionIndex + mov rcx, 0 // pModule + + call C_FUNC(ExternalMethodFixupWorker) + + EPILOG_WITH_TRANSITION_BLOCK_TAILCALL +PATCH_LABEL ExternalMethodFixupPatchLabel + TAILJMP_RAX + +NESTED_END ExternalMethodFixupStub, _TEXT + + +//============================================================================================ +// EXTERN_C VOID __stdcall VirtualMethodFixupStub() + +NESTED_ENTRY VirtualMethodFixupStub, _TEXT, ProcessCLRException + + PROLOG_WITH_TRANSITION_BLOCK 0, 8, rdx, 0, 0 + + lea rdi, [rsp + __PWTB_TransitionBlock] // pTransitionBlock + sub rsi, 5 // pThunk + call C_FUNC(VirtualMethodFixupWorker) + + EPILOG_WITH_TRANSITION_BLOCK_TAILCALL +PATCH_LABEL VirtualMethodFixupPatchLabel + TAILJMP_RAX + +NESTED_END VirtualMethodFixupStub, _TEXT diff --git a/src/vm/amd64/unixstubs.cpp b/src/vm/amd64/unixstubs.cpp index 9de7c6f7a2..c74d74fe15 100644 --- a/src/vm/amd64/unixstubs.cpp +++ b/src/vm/amd64/unixstubs.cpp @@ -12,16 +12,6 @@ extern "C" PORTABILITY_ASSERT("Implement for PAL"); } - void ExternalMethodFixupPatchLabel() - { - PORTABILITY_ASSERT("Implement for PAL"); - } - - void ExternalMethodFixupStub() - { - PORTABILITY_ASSERT("Implement for PAL"); - } - void GenericPInvokeCalliHelper() { PORTABILITY_ASSERT("Implement for PAL"); @@ -52,16 +42,6 @@ extern "C" PORTABILITY_ASSERT("Implement for PAL"); } - void VirtualMethodFixupPatchLabel() - { - PORTABILITY_ASSERT("Implement for PAL"); - } - - void VirtualMethodFixupStub() - { - PORTABILITY_ASSERT("Implement for PAL"); - } - DWORD getcpuid(DWORD arg, unsigned char result[16]) { DWORD eax; @@ -96,16 +76,4 @@ extern "C" void STDCALL JIT_ProfilerEnterLeaveTailcallStub(UINT_PTR ProfilerHandle) { } - -#ifdef FEATURE_PREJIT - void StubDispatchFixupStub() - { - PORTABILITY_ASSERT("Implement for PAL"); - } -#endif - - void StubDispatchFixupPatchLabel() - { - PORTABILITY_ASSERT("Implement for PAL"); - } }; diff --git a/src/vm/amd64/virtualcallstubamd64.S b/src/vm/amd64/virtualcallstubamd64.S index 240d455254..25e5ece184 100644 --- a/src/vm/amd64/virtualcallstubamd64.S +++ b/src/vm/amd64/virtualcallstubamd64.S @@ -88,3 +88,23 @@ Fail_RWCLAS: jmp C_FUNC(ResolveWorkerAsmStub) LEAF_END ResolveWorkerChainLookupAsmStub, _TEXT + +#ifdef FEATURE_PREJIT +NESTED_ENTRY StubDispatchFixupStub, _TEXT, ProcessCLRException + + PROLOG_WITH_TRANSITION_BLOCK 0, 0, 0, 0, 0 + + lea rdi, [rsp + __PWTB_TransitionBlock] // pTransitionBlock + mov rsi, r11 // indirection cell address + + mov rdx,0 // sectionIndex + mov rcx,0 // pModule + + call C_FUNC(StubDispatchFixupWorker) + + EPILOG_WITH_TRANSITION_BLOCK_TAILCALL +PATCH_LABEL StubDispatchFixupPatchLabel + TAILJMP_RAX + +NESTED_END StubDispatchFixupStub, _TEXT +#endif |