From eea057675de7914af12c6168db0f3bebea35be5b Mon Sep 17 00:00:00 2001 From: Eugene Rozenfeld Date: Sun, 16 Dec 2018 12:07:42 -0800 Subject: 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. --- src/vm/methodtable.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/vm/methodtable.cpp') 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 -- cgit v1.2.3