summaryrefslogtreecommitdiff
path: root/src/vm/jitinterfacegen.cpp
diff options
context:
space:
mode:
authorKoundinya Veluri <kouvel@users.noreply.github.com>2017-09-26 13:14:53 -0700
committerGitHub <noreply@github.com>2017-09-26 13:14:53 -0700
commit8f0ac5d2041d0c577607e2f778f2fbca1f7d732e (patch)
tree23e191f0f10287d162ef53b4a2b77d9170ac7615 /src/vm/jitinterfacegen.cpp
parent296aaf12b40ddd7478b6a14d6099f48b4b049438 (diff)
downloadcoreclr-8f0ac5d2041d0c577607e2f778f2fbca1f7d732e.tar.gz
coreclr-8f0ac5d2041d0c577607e2f778f2fbca1f7d732e.tar.bz2
coreclr-8f0ac5d2041d0c577607e2f778f2fbca1f7d732e.zip
Remove Monitor asm helpers (#14146)
- Removed asm helpers on Windows and used portable C++ helpers instead - Rearranged fast path code to improve them a bit and match the asm more closely Perf: - The asm helpers are a bit faster. The code generated for the portable helpers is almost the same now, the remaining differences are: - There were some layout issues where hot paths were in the wrong place and return paths were not cloned. Instrumenting some of the tests below with PGO on x64 resolved all of the layout issues. I couldn't get PGO instrumentation to work on x86 but I imagine it would be the same there. - Register usage - x64: All of the Enter functions are using one or two (TryEnter is using two) callee-saved registers for no apparent reason, forcing them to be saved and restored. r10 and r11 seem to be available but they're not being used. - x86: Similarly to x64, the compiled functions are pushing and popping 2-3 additional registers in the hottest fast paths. - I believe this is the main remaining gap and PGO is not helping with this - On Linux, perf is >= before for the most part - Perf tests used for below are updated in PR https://github.com/dotnet/coreclr/pull/13670
Diffstat (limited to 'src/vm/jitinterfacegen.cpp')
-rw-r--r--src/vm/jitinterfacegen.cpp42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/vm/jitinterfacegen.cpp b/src/vm/jitinterfacegen.cpp
index 26387405b7..38f1a7436a 100644
--- a/src/vm/jitinterfacegen.cpp
+++ b/src/vm/jitinterfacegen.cpp
@@ -47,15 +47,6 @@ EXTERN_C Object* JIT_NewArr1OBJ_UP (CORINFO_CLASS_HANDLE arrayMT, INT_PTR size);
EXTERN_C Object* JIT_NewArr1VC_MP (CORINFO_CLASS_HANDLE arrayMT, INT_PTR size);
EXTERN_C Object* JIT_NewArr1VC_UP (CORINFO_CLASS_HANDLE arrayMT, INT_PTR size);
-//For the optimized JIT_Mon helpers
-#if defined(_TARGET_AMD64_)
-EXTERN_C void JIT_MonEnterWorker_Slow(Object* obj, BYTE* pbLockTaken);
-EXTERN_C void JIT_MonExitWorker_Slow(Object* obj, BYTE* pbLockTaken);
-EXTERN_C void JIT_MonTryEnter_Slow(Object* obj, INT32 timeOut, BYTE* pbLockTaken);
-EXTERN_C void JIT_MonEnterStatic_Slow(AwareLock* lock, BYTE* pbLockTaken);
-EXTERN_C void JIT_MonExitStatic_Slow(AwareLock* lock, BYTE* pbLockTaken);
-#endif // _TARGET_AMD64_
-
extern "C" void* JIT_GetSharedNonGCStaticBase_Slow(SIZE_T moduleDomainID, DWORD dwModuleClassID);
extern "C" void* JIT_GetSharedNonGCStaticBaseNoCtor_Slow(SIZE_T moduleDomainID, DWORD dwModuleClassID);
extern "C" void* JIT_GetSharedGCStaticBase_Slow(SIZE_T moduleDomainID, DWORD dwModuleClassID);
@@ -114,12 +105,6 @@ EXTERN_C void JIT_BoxFastMPIGT__PatchTLSLabel();
EXTERN_C void AllocateStringFastMP_InlineGetThread__PatchTLSOffset();
EXTERN_C void JIT_NewArr1VC_MP_InlineGetThread__PatchTLSOffset();
EXTERN_C void JIT_NewArr1OBJ_MP_InlineGetThread__PatchTLSOffset();
-EXTERN_C void JIT_MonEnterWorker_InlineGetThread_GetThread_PatchLabel();
-EXTERN_C void JIT_MonExitWorker_InlineGetThread_GetThread_PatchLabel();
-EXTERN_C void JIT_MonTryEnter_GetThread_PatchLabel();
-EXTERN_C void JIT_MonEnterStaticWorker_InlineGetThread_GetThread_PatchLabel_1();
-EXTERN_C void JIT_MonEnterStaticWorker_InlineGetThread_GetThread_PatchLabel_2();
-EXTERN_C void JIT_MonExitStaticWorker_InlineGetThread_GetThread_PatchLabel();
static const LPVOID InlineGetThreadLocations[] = {
@@ -128,12 +113,6 @@ static const LPVOID InlineGetThreadLocations[] = {
(PVOID)AllocateStringFastMP_InlineGetThread__PatchTLSOffset,
(PVOID)JIT_NewArr1VC_MP_InlineGetThread__PatchTLSOffset,
(PVOID)JIT_NewArr1OBJ_MP_InlineGetThread__PatchTLSOffset,
- (PVOID)JIT_MonEnterWorker_InlineGetThread_GetThread_PatchLabel,
- (PVOID)JIT_MonExitWorker_InlineGetThread_GetThread_PatchLabel,
- (PVOID)JIT_MonTryEnter_GetThread_PatchLabel,
- (PVOID)JIT_MonEnterStaticWorker_InlineGetThread_GetThread_PatchLabel_1,
- (PVOID)JIT_MonEnterStaticWorker_InlineGetThread_GetThread_PatchLabel_2,
- (PVOID)JIT_MonExitStaticWorker_InlineGetThread_GetThread_PatchLabel,
};
EXTERN_C void JIT_GetSharedNonGCStaticBase__PatchTLSLabel();
@@ -187,11 +166,6 @@ void FixupInlineGetters(DWORD tlsSlot, const LPVOID * pLocations, int nLocations
}
#endif // defined(_WIN64) && !defined(FEATURE_IMPLICIT_TLS)
-#if defined(_TARGET_AMD64_)
-EXTERN_C void JIT_MonEnterStaticWorker();
-EXTERN_C void JIT_MonExitStaticWorker();
-#endif
-
void InitJITHelpers1()
{
STANDARD_VM_CONTRACT;
@@ -274,22 +248,6 @@ void InitJITHelpers1()
}
}
-#ifndef FEATURE_IMPLICIT_TLS
- if (gThreadTLSIndex >= TLS_MINIMUM_AVAILABLE)
- {
- // We need to patch the helpers for FCalls
- MakeIntoJumpStub(JIT_MonEnterWorker_InlineGetThread, JIT_MonEnterWorker_Slow);
- MakeIntoJumpStub(JIT_MonExitWorker_InlineGetThread, JIT_MonExitWorker_Slow);
- MakeIntoJumpStub(JIT_MonTryEnter_InlineGetThread, JIT_MonTryEnter_Slow);
-
- SetJitHelperFunction(CORINFO_HELP_MON_ENTER, JIT_MonEnterWorker_Slow);
- SetJitHelperFunction(CORINFO_HELP_MON_EXIT, JIT_MonExitWorker_Slow);
-
- SetJitHelperFunction(CORINFO_HELP_MON_ENTER_STATIC, JIT_MonEnterStatic_Slow);
- SetJitHelperFunction(CORINFO_HELP_MON_EXIT_STATIC, JIT_MonExitStatic_Slow);
- }
-#endif
-
if(IsSingleAppDomain())
{
SetJitHelperFunction(CORINFO_HELP_GETSHARED_GCSTATIC_BASE, JIT_GetSharedGCStaticBase_SingleAppDomain);