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:
authorPeter Sollich <petersol@microsoft.com>2017-04-25 03:56:40 +0300
committerJan Kotas <jkotas@microsoft.com>2017-04-25 03:56:40 +0300
commit36f5f8b0afa79678cd8048672231d71ce7d0e953 (patch)
tree46c6c17ba128d843f19fa2e52c62435a67c252ff /src/Native/Runtime/windows
parent6e0e018d0ea4bf9852ce1f28137783fdaf0a4760 (diff)
Gc reporting for filter funclets (#3401)
I found the problem with filter funclets is that the untracked variables get reported both by the filter funclet and the enclosing method. While the compiler makes sure that the lifetimes of other variables get appropriately split and marked as pinned, this is not the case for untracked variables - here we simply need to suppress the reporting if we are indeed in a filter funclet. My fix simply figures out whether we are indeed in a filter, and if so, passes an appropriate flag to EnumerateLiveSlots. I suspect that UnixNativeCodeManager.cpp/.h will need a parallel fix, but lets first discuss whether my fix for Windows is in fact correct.
Diffstat (limited to 'src/Native/Runtime/windows')
-rw-r--r--src/Native/Runtime/windows/CoffNativeCodeManager.cpp20
-rw-r--r--src/Native/Runtime/windows/CoffNativeCodeManager.h2
2 files changed, 21 insertions, 1 deletions
diff --git a/src/Native/Runtime/windows/CoffNativeCodeManager.cpp b/src/Native/Runtime/windows/CoffNativeCodeManager.cpp
index c4cbbeeae..27fe4848f 100644
--- a/src/Native/Runtime/windows/CoffNativeCodeManager.cpp
+++ b/src/Native/Runtime/windows/CoffNativeCodeManager.cpp
@@ -251,6 +251,18 @@ bool CoffNativeCodeManager::IsFunclet(MethodInfo * pMethInfo)
return (unwindBlockFlags & UBF_FUNC_KIND_MASK) != UBF_FUNC_KIND_ROOT;
}
+bool CoffNativeCodeManager::IsFilter(MethodInfo * pMethInfo)
+{
+ CoffNativeMethodInfo * pMethodInfo = (CoffNativeMethodInfo *)pMethInfo;
+
+ size_t unwindDataBlobSize;
+ PTR_VOID pUnwindDataBlob = GetUnwindDataBlob(m_moduleBase, pMethodInfo->runtimeFunction, &unwindDataBlobSize);
+
+ uint8_t unwindBlockFlags = *(dac_cast<DPTR(uint8_t)>(pUnwindDataBlob) + unwindDataBlobSize);
+
+ return (unwindBlockFlags & UBF_FUNC_KIND_MASK) == UBF_FUNC_KIND_FILTER;
+}
+
PTR_VOID CoffNativeCodeManager::GetFramePointer(MethodInfo * pMethInfo,
REGDISPLAY * pRegisterSet)
{
@@ -296,10 +308,16 @@ void CoffNativeCodeManager::EnumGcRefs(MethodInfo * pMethodInfo,
codeOffset - 1 // TODO: Is this adjustment correct?
);
+ ICodeManagerFlags flags = (ICodeManagerFlags)0;
+ if (pNativeMethodInfo->executionAborted)
+ flags = ICodeManagerFlags::ExecutionAborted;
+ if (IsFilter(pMethodInfo))
+ flags = (ICodeManagerFlags)(flags | ICodeManagerFlags::NoReportUntracked);
+
if (!decoder.EnumerateLiveSlots(
pRegisterSet,
false /* reportScratchSlots */,
- pNativeMethodInfo->executionAborted ? ICodeManagerFlags::ExecutionAborted : 0, // TODO: Flags?
+ flags,
hCallback->pCallback,
hCallback
))
diff --git a/src/Native/Runtime/windows/CoffNativeCodeManager.h b/src/Native/Runtime/windows/CoffNativeCodeManager.h
index 4d4c72aaf..09b960386 100644
--- a/src/Native/Runtime/windows/CoffNativeCodeManager.h
+++ b/src/Native/Runtime/windows/CoffNativeCodeManager.h
@@ -61,6 +61,8 @@ public:
bool IsFunclet(MethodInfo * pMethodInfo);
+ bool IsFilter(MethodInfo * pMethodInfo);
+
PTR_VOID GetFramePointer(MethodInfo * pMethodInfo,
REGDISPLAY * pRegisterSet);