diff options
author | Eugene Rozenfeld <erozen@microsoft.com> | 2018-12-16 12:07:42 -0800 |
---|---|---|
committer | Eugene Rozenfeld <erozen@microsoft.com> | 2018-12-21 22:38:52 -0800 |
commit | eea057675de7914af12c6168db0f3bebea35be5b (patch) | |
tree | 7b3134b62a2707e32fbf00d4c0138a39099d3a75 /src/jit/compiler.hpp | |
parent | 0a1374f4f7c2141bf6d8ad74a68dd329afdbee78 (diff) | |
download | coreclr-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/jit/compiler.hpp')
-rw-r--r-- | src/jit/compiler.hpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/jit/compiler.hpp b/src/jit/compiler.hpp index 29a79f862b..3fceff729a 100644 --- a/src/jit/compiler.hpp +++ b/src/jit/compiler.hpp @@ -1157,21 +1157,20 @@ inline GenTreeCall* Compiler::gtNewHelperCallNode(unsigned helper, var_types typ // gtNewAllocObjNode: A little helper to create an object allocation node. // // Arguments: -// helper - Value returned by ICorJitInfo::getNewHelper -// clsHnd - Corresponding class handle -// type - Tree return type (e.g. TYP_REF) -// op1 - Node containing an address of VtablePtr +// helper - Value returned by ICorJitInfo::getNewHelper +// helperHasSideEffects - True iff allocation helper has side effects +// clsHnd - Corresponding class handle +// type - Tree return type (e.g. TYP_REF) +// op1 - Node containing an address of VtablePtr // // Return Value: // Returns GT_ALLOCOBJ node that will be later morphed into an // allocation helper call or local variable allocation on the stack. -inline GenTreeAllocObj* Compiler::gtNewAllocObjNode(unsigned int helper, - CORINFO_CLASS_HANDLE clsHnd, - var_types type, - GenTree* op1) +inline GenTreeAllocObj* Compiler::gtNewAllocObjNode( + unsigned int helper, bool helperHasSideEffects, CORINFO_CLASS_HANDLE clsHnd, var_types type, GenTree* op1) { - GenTreeAllocObj* node = new (this, GT_ALLOCOBJ) GenTreeAllocObj(type, helper, clsHnd, op1); + GenTreeAllocObj* node = new (this, GT_ALLOCOBJ) GenTreeAllocObj(type, helper, helperHasSideEffects, clsHnd, op1); return node; } |