Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Mosier <smosier@microsoft.com>2016-02-08 23:44:58 +0300
committerScott Mosier <smosier@microsoft.com>2016-02-08 23:44:58 +0300
commite7cf9872439f602b39a320c6ade8c9af6dd2e817 (patch)
tree140ac9095691a81167d010f81fb4688daf00cae7 /src/Native/Runtime/module.h
parentcfb63d562045aafa3a81a4834dd457ad60e81ba6 (diff)
Fix RhpLoopHijack to stop trashing important registers
The loop hijack worker routine is not honoring the contract that it should be. Namely, the runtime is not allowed to trash any registers in our worker (except r12 on ARM). The two big oversights were scratch FP registers and the flags registers. I have also added a per-module map from loop index to target address (thus requiring all the shash.h includes). This primarily helps gcstress throughput because the loop indirection cell address calculation ends up being surprisingly lengthy. I considered the other obvious approach of "back-patching" the loop indirection cell in the gcstress case (normal loop hijacking does this, but under gcstress, we do not). However, I ended up preferring this because it could help GC suspension latency in normal operation. [tfs-changeset: 1573401]
Diffstat (limited to 'src/Native/Runtime/module.h')
-rw-r--r--src/Native/Runtime/module.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Native/Runtime/module.h b/src/Native/Runtime/module.h
index 31cdfd029..5eebff5cd 100644
--- a/src/Native/Runtime/module.h
+++ b/src/Native/Runtime/module.h
@@ -146,6 +146,8 @@ public:
bool IsFinalizerInitComplete() { return m_fFinalizerInitComplete; }
void SetFinalizerInitComplete() { m_fFinalizerInitComplete = true; }
+ void * RecoverLoopHijackTarget(UInt32 entryIndex, ModuleHeader * pModuleHeader);
+
private:
Module(ModuleHeader * pModuleHeader);
#ifdef FEATURE_CUSTOM_IMPORTS
@@ -153,6 +155,7 @@ private:
PTR_UInt8 GetBaseAddress() { return (PTR_UInt8)(size_t)GetOsModuleHandle(); }
#endif // FEATURE_CUSTOM_IMPORTS
+
static void UnsynchronizedHijackLoop(void ** ppvIndirectionCell, UInt32 cellIndex,
void * pvRedirStubsStart, UInt8 * pbDirtyBitmap);
@@ -171,5 +174,8 @@ private:
PTR_StaticGcDesc m_pStaticsGCInfo;
PTR_StaticGcDesc m_pThreadStaticsGCInfo;
PTR_UInt8 m_pStaticsGCDataSection;
+
+ ReaderWriterLock m_loopHijackMapLock;
+ MapSHash<UInt32, void*> m_loopHijackIndexToTargetMap;
};