• Y
    Optimise DisplayClass Allocations (#32092) · d796d862
    Yair Halberstadt 提交于
    The current implementation of closure conversion creates closure environments for each
    new scope. This change tries to minimize the number of closure environments, and thus
    closure environment allocations, when possible by merging "adjacent" closure environments.
    
    To merge two closure environments, they have to:
    
    1. Be captured by exactly the same set of closures
    2. Have no backwards branching between the allocation of the two environments
    3. Have the same environment lifetime
    
    If so, all of the variables will be merged into a single closure environment. 
    
    Fixes #29965
    d796d862
LambdaRewriter.Analysis.Tree.cs 34.6 KB