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/unix
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/unix')
-rw-r--r--src/Native/Runtime/unix/UnixNativeCodeManager.cpp16
-rw-r--r--src/Native/Runtime/unix/UnixNativeCodeManager.h2
2 files changed, 17 insertions, 1 deletions
diff --git a/src/Native/Runtime/unix/UnixNativeCodeManager.cpp b/src/Native/Runtime/unix/UnixNativeCodeManager.cpp
index f82e9b42a..af2a0909b 100644
--- a/src/Native/Runtime/unix/UnixNativeCodeManager.cpp
+++ b/src/Native/Runtime/unix/UnixNativeCodeManager.cpp
@@ -95,6 +95,14 @@ bool UnixNativeCodeManager::IsFunclet(MethodInfo * pMethodInfo)
return (unwindBlockFlags & UBF_FUNC_KIND_MASK) != UBF_FUNC_KIND_ROOT;
}
+bool UnixNativeCodeManager::IsFilter(MethodInfo * pMethodInfo)
+{
+ UnixNativeMethodInfo * pNativeMethodInfo = (UnixNativeMethodInfo *)pMethodInfo;
+
+ uint8_t unwindBlockFlags = *(pNativeMethodInfo->pLSDA);
+ return (unwindBlockFlags & UBF_FUNC_KIND_MASK) == UBF_FUNC_KIND_FILTER;
+}
+
PTR_VOID UnixNativeCodeManager::GetFramePointer(MethodInfo * pMethodInfo,
REGDISPLAY * pRegisterSet)
{
@@ -132,10 +140,16 @@ void UnixNativeCodeManager::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/unix/UnixNativeCodeManager.h b/src/Native/Runtime/unix/UnixNativeCodeManager.h
index 2a5e59430..e424a559c 100644
--- a/src/Native/Runtime/unix/UnixNativeCodeManager.h
+++ b/src/Native/Runtime/unix/UnixNativeCodeManager.h
@@ -25,6 +25,8 @@ public:
bool IsFunclet(MethodInfo * pMethodInfo);
+ bool IsFilter(MethodInfo * pMethodInfo);
+
PTR_VOID GetFramePointer(MethodInfo * pMethodInfo,
REGDISPLAY * pRegisterSet);