summaryrefslogtreecommitdiff
path: root/src/vm/methodtable.cpp
diff options
context:
space:
mode:
authorEugene Rozenfeld <erozen@microsoft.com>2018-12-16 12:07:42 -0800
committerEugene Rozenfeld <erozen@microsoft.com>2018-12-21 22:38:52 -0800
commiteea057675de7914af12c6168db0f3bebea35be5b (patch)
tree7b3134b62a2707e32fbf00d4c0138a39099d3a75 /src/vm/methodtable.cpp
parent0a1374f4f7c2141bf6d8ad74a68dd329afdbee78 (diff)
downloadcoreclr-eea057675de7914af12c6168db0f3bebea35be5b.tar.gz
coreclr-eea057675de7914af12c6168db0f3bebea35be5b.tar.bz2
coreclr-eea057675de7914af12c6168db0f3bebea35be5b.zip
Improve removal of dead calls to allocator helpers.
This change improves detection of allocators with side effects. Allocators can cause side effects if the allocated object may have a finalizer. This change adds a pHasSideEffects parameter to getNewHelper JitEE interface method. It's used by the jit to check for allocator side effects instead of guessing from helper ids. Fixes #21530.
Diffstat (limited to 'src/vm/methodtable.cpp')
-rw-r--r--src/vm/methodtable.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/vm/methodtable.cpp b/src/vm/methodtable.cpp
index 91f6edd258..d7e98ffa48 100644
--- a/src/vm/methodtable.cpp
+++ b/src/vm/methodtable.cpp
@@ -10236,4 +10236,30 @@ BOOL MethodTable::IsInheritanceChainLayoutFixedInCurrentVersionBubble()
return TRUE;
}
+
+//
+// Is the inheritance chain fixed within the current version bubble?
+//
+BOOL MethodTable::IsInheritanceChainFixedInCurrentVersionBubble()
+{
+ STANDARD_VM_CONTRACT;
+
+ MethodTable * pMT = this;
+
+ if (pMT->IsValueType())
+ {
+ return pMT->GetModule()->IsInCurrentVersionBubble();
+ }
+
+ while ((pMT != g_pObjectClass) && (pMT != NULL))
+ {
+ if (!pMT->GetModule()->IsInCurrentVersionBubble())
+ return FALSE;
+
+ pMT = pMT->GetParentMethodTable();
+ }
+
+ return TRUE;
+}
+
#endif // FEATURE_READYTORUN_COMPILER