Register a named WASM module. See "include/executor/executor.h".
| 28 | |
| 29 | /// Register a named WASM module. See "include/executor/executor.h". |
| 30 | Expect<std::unique_ptr<Runtime::Instance::ModuleInstance>> |
| 31 | Executor::registerModule(Runtime::StoreManager &StoreMgr, |
| 32 | const AST::Module &Mod, std::string_view Name) { |
| 33 | return instantiate(StoreMgr, Mod, Name).map_error([this](auto E) { |
| 34 | // If statistics are enabled, dump them here. |
| 35 | // When an error occurs, subsequent execution will not run. |
| 36 | if (Stat) { |
| 37 | Stat->dumpToLog(Conf); |
| 38 | } |
| 39 | return E; |
| 40 | }); |
| 41 | } |
| 42 | |
| 43 | /// Register an instantiated module. See "include/executor/executor.h". |
| 44 | Expect<void> |
no test coverage detected