From c44c6f91b89508a71a838406b286d114e461ca18 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 18 Jul 2024 02:39:36 +0900 Subject: refactor: simplify Runtime::instantiate()'s parameters --- src/WebAssembly/Execution/Runtime.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/WebAssembly/Execution/Runtime.php') diff --git a/src/WebAssembly/Execution/Runtime.php b/src/WebAssembly/Execution/Runtime.php index 2604212..1bb440b 100644 --- a/src/WebAssembly/Execution/Runtime.php +++ b/src/WebAssembly/Execution/Runtime.php @@ -39,14 +39,13 @@ final class Runtime implements ExporterInterface ) { } - /** - * @param list $externVals - */ public static function instantiate( - Store $store, Module $module, - array $externVals, + Linker $linker, ): self { + $store = $linker->store; + $externVals = $linker->resolve($module); + $allocator = new Allocator($store); $moduleInstInit = $allocator->allocPreInitModule($module, $externVals); -- cgit v1.2.3-70-g09d2