Separates verification, which blesses CompiledModules from loading which caches Modules:
Renames the existing cache as loaded_modules.
Moves CompiledModule out of Module and into its own cache -- compiled_modules -- populated during verification (which now no longer populates loaded_modules).
ModuleCache::insert now recursively adds Modules, Functions, and Structs (ensuring dependency modules are loaded first), assuming the all dependencies have been verified (failing otherwise).
Public APIs into the loader that previously returned Arc<Module> now also return a Arc<CompiledModule>.
This change is motivated by the fact that in the presence of package upgrades, a single CompiledModule can end up being stamped out as multiple Modules
Separates verification, which blesses
CompiledModule
s from loading which cachesModule
s:loaded_modules
.CompiledModule
out ofModule
and into its own cache --compiled_modules
-- populated during verification (which now no longer populatesloaded_modules
).ModuleCache::insert
now recursively addsModule
s,Function
s, andStruct
s (ensuring dependency modules are loaded first), assuming the all dependencies have been verified (failing otherwise).Arc<Module>
now also return aArc<CompiledModule>
.This change is motivated by the fact that in the presence of package upgrades, a single
CompiledModule
can end up being stamped out as multipleModule
sTest Plan