forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Prototype removing boxes from GC.KeepAlive Instead, import KEEPALIVE(BOX) as a sequence of KEEPALIVE for object fields (flattened). * Clean things up Move the importation to its own method. Add debug output. Rename a few things. * Add a test Basic verification of the new optimization. * Fix formatting * Disable the test on Mono It relies on a precise GC. * Add a class field scenario to the test * Fix a test Running diffs for win-x64, there was exactly one result, in this test. GC.KeepAlive here is used as a generic "make sure that there is a use for the variable beyond an assigment" function. The new optimization eliminates this use as the struct in question has no GC fields. Fix the test by using an actual generic "use me" function. Will be broken by advanced interprocediral analysis that is apparently not as far away as one would expect, but will do for now. * Use advanced DEBUG features for even nicer dumps * Add two simple EH scenarios to the test * Fix the test It is possible for a GC to occur just after the KeepAlive calls and for CheckSuccess to wrongly conclude the objects weren't kept alive. * Only elide copies for GT_LCL_VARs If the source is a GT_LCL_FLD, then we would only want too keep alive the fields it encloses (or, since TYP_STRUCT local fields are currently not supported, nothing). * Use the address of the whole struct for KEEPALIVE The field-by-field approach results in the struct getting address-exposed anyway, so there is no good reason to bloat the IR. Just have the address escape directly. Co-authored-by: Jeremy Koritzinsky <[email protected]>
- Loading branch information
1 parent
87ac0d5
commit 4173838
Showing
7 changed files
with
453 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.