The core lambda lift functionality.
Symbols that are called from an inner class.
A flag to indicate whether new free variables have been found
A flag to indicate whether lifted owners have changed
Buffers for lifted out classes and methods, indexed by owner
A map from local methods and classes to the owners to which they will be lifted as members. For methods and classes that do not have any dependencies this will be the enclosing package. symbols with packages as lifted owners will subsequently represented as static members of their toplevel class, unless their enclosing class was already static. Note: During tree transform (which runs at phase LambdaLift + 1), liftedOwner is also used to decide whether a method had a term owner before.
A map storing the free variable proxies of functions and classes. For every function and class, this is a map from the free variables of that function or class to the proxy symbols accessing them.
Compute final free variables map `fvs by closing over caller dependencies.
Compute final liftedOwner map by closing over caller dependencies
A symbol is local if it is owned by a term or a local trait, or if it is a constructor of a local symbol.
sym as being free in
sym is defined
enclosure or there is an intermediate class properly containing
sym is also free. Also, update
enclosure can access
sym, or its proxy in an intermediate class.
If there is an intermediate class in which
enclosuremust be contained in that class (in order to access the `sym proxy stored in the class).
- If there is no intermediate class,
enclosuremust be contained in the class enclosing
owner is more deeply nested
than the previous value of