Instantiate a WASM Module. See "include/executor/executor.h".
| 14 | |
| 15 | /// Instantiate a WASM Module. See "include/executor/executor.h". |
| 16 | Expect<std::unique_ptr<Runtime::Instance::ModuleInstance>> |
| 17 | Executor::instantiateModule(Runtime::StoreManager &StoreMgr, |
| 18 | const AST::Module &Mod) { |
| 19 | return instantiate(StoreMgr, Mod).map_error([this](auto E) { |
| 20 | // If statistics are enabled, dump them here. |
| 21 | // When an error occurs, subsequent execution will not run. |
| 22 | if (Stat) { |
| 23 | Stat->dumpToLog(Conf); |
| 24 | } |
| 25 | return E; |
| 26 | }); |
| 27 | } |
| 28 | |
| 29 | /// Register a named WASM module. See "include/executor/executor.h". |
| 30 | Expect<std::unique_ptr<Runtime::Instance::ModuleInstance>> |