| 2315 | } |
| 2316 | |
| 2317 | bool WasmRuntime::executeMainFile(String filename) { |
| 2318 | if (!_scheduler) { |
| 2319 | scheduleUpdate(); |
| 2320 | } |
| 2321 | auto instance = New<WasmInstance>(); |
| 2322 | auto moduleId = allocModuleId(instance.get()); |
| 2323 | if (moduleId == 0) { |
| 2324 | Error("failed to allocate wasm module id for {}", filename.toString()); |
| 2325 | return false; |
| 2326 | } |
| 2327 | instance->setModuleId(moduleId); |
| 2328 | if (instance->executeMainFile(filename)) { |
| 2329 | _instances.push_back(std::move(instance)); |
| 2330 | return true; |
| 2331 | } |
| 2332 | releaseModuleId(instance->getModuleId()); |
| 2333 | return false; |
| 2334 | } |
| 2335 | |
| 2336 | bool WasmInstance::executeMainFile(String filename) { |
| 2337 | if (_wasm.first || _loading) { |
nothing calls this directly
no test coverage detected