From c987532fa4faf9d1d24913de16f7840f481cde14 Mon Sep 17 00:00:00 2001 From: Jonghyun Park Date: Tue, 6 Dec 2016 05:08:33 +0900 Subject: [PATCH] [x86/Linux] Enclose stub-linking methods with FEATURE_STUBS_AS_IL (dotnet/coreclr#8432) Commit migrated from https://github.com/dotnet/coreclr/commit/0c952dcef303e2ee80e892bca7bf5d0950e225cd --- src/coreclr/src/vm/i386/cgenx86.cpp | 5 +++++ src/coreclr/src/vm/i386/stublinkerx86.cpp | 2 ++ src/coreclr/src/vm/i386/stublinkerx86.h | 11 +++++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/coreclr/src/vm/i386/cgenx86.cpp b/src/coreclr/src/vm/i386/cgenx86.cpp index 5e3c433..3774ac4 100644 --- a/src/coreclr/src/vm/i386/cgenx86.cpp +++ b/src/coreclr/src/vm/i386/cgenx86.cpp @@ -772,6 +772,7 @@ Stub *GenerateUMThunkPrestub() } CONTRACT_END; +#ifndef FEATURE_STUBS_AS_IL CPUSTUBLINKER sl; CPUSTUBLINKER *psl = &sl; @@ -808,6 +809,10 @@ Stub *GenerateUMThunkPrestub() psl->EmitComMethodStubEpilog(UMThkCallFrame::GetMethodFrameVPtr(), rgRareLabels, rgRejoinLabels, FALSE /*Don't profile*/); RETURN psl->Link(SystemDomain::GetGlobalLoaderAllocator()->GetExecutableHeap()); +#else // FEATURE_STUBS_AS_IL + PORTABILITY_ASSERT("GenerateUMThunkPrestub"); + return NULL; +#endif // FEATURE_STUBS_AS_IL } Stub *GenerateInitPInvokeFrameHelper() diff --git a/src/coreclr/src/vm/i386/stublinkerx86.cpp b/src/coreclr/src/vm/i386/stublinkerx86.cpp index 32261a4..3f4bad1 100644 --- a/src/coreclr/src/vm/i386/stublinkerx86.cpp +++ b/src/coreclr/src/vm/i386/stublinkerx86.cpp @@ -2624,6 +2624,7 @@ VOID StubLinkerCPU::EmitProfilerComCallEpilog(TADDR pFrameVptr, X86Reg regFrame) #endif // PROFILING_SUPPORTED +#ifndef FEATURE_STUBS_AS_IL //======================================================================== // Prolog for entering managed code from COM // pushes the appropriate frame ptr @@ -2850,6 +2851,7 @@ void StubLinkerCPU::EmitComMethodStubEpilog(TADDR pFrameVptr, EmitLabel(rgRareLabels[0]); // label for rare setup thread EmitRareSetup(rgRejoinLabels[0], /*fThrow*/ TRUE); // emit rare setup thread } +#endif // !FEATURE_STUBS_AS_IL //--------------------------------------------------------------- // Emit code to store the setup current Thread structure in eax. diff --git a/src/coreclr/src/vm/i386/stublinkerx86.h b/src/coreclr/src/vm/i386/stublinkerx86.h index 237fc79..ac37183 100644 --- a/src/coreclr/src/vm/i386/stublinkerx86.h +++ b/src/coreclr/src/vm/i386/stublinkerx86.h @@ -345,6 +345,11 @@ class StubLinkerCPU : public StubLinker VOID EmitSetup(CodeLabel *pForwardRef); VOID EmitRareSetup(CodeLabel* pRejoinPoint, BOOL fThrow); + +#ifndef FEATURE_STUBS_AS_IL + VOID EmitMethodStubProlog(TADDR pFrameVptr, int transitionBlockOffset); + VOID EmitMethodStubEpilog(WORD numArgBytes, int transitionBlockOffset); + VOID EmitCheckGSCookie(X86Reg frameReg, int gsCookieOffset); #ifdef _TARGET_X86_ @@ -353,10 +358,8 @@ class StubLinkerCPU : public StubLinker void EmitComMethodStubEpilog(TADDR pFrameVptr, CodeLabel** rgRareLabels, CodeLabel** rgRejoinLabels, BOOL bShouldProfile); -#endif - - VOID EmitMethodStubProlog(TADDR pFrameVptr, int transitionBlockOffset); - VOID EmitMethodStubEpilog(WORD numArgBytes, int transitionBlockOffset); +#endif // _TARGET_X86_ +#endif // !FEATURE_STUBS_AS_IL VOID EmitUnboxMethodStub(MethodDesc* pRealMD); #if defined(FEATURE_SHARE_GENERIC_CODE) -- 2.7.4