External Module Graph in EPS
We now store an ExternalModuleGraph in the EPS. When an new interface is
loaded, the module graph is extended with a node for the loaded
interface. The result is a partial module graph. If you want to run
a transitive closure query on the graph you must first force the
transitive closure to be loaded by using loadExternalGraphBelow
.
The primary advantage (for now) is that the transitive dependency calculation does not have to be repeated in getLinkDeps. If your module had many dependencies and many splices, performing this calculation at every splice site took a significant amount of time.
We might also want to use this module graph in future for considering questions such as reachability of rules or accessibilty of instance imported by levelled imported.
This patch removes another place in the compiler where transitive dependency is calculated in an ad-hoc manner. In general, the transitive dependency calculation should be cached and computed using a ModuleGraph abstraction.
The transitive dependency query required by getLinkDeps operates on a
graph without hs-boot nodes. If a linkable from a module in a loop is
needed, then all modules in the loop are necessary to be available to
execute that module. Therefore there is a query in ModuleGraph
and
ExternalModuleGraph
which allows a transitive closure query to be
performed on a graph without loops.