aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/WebAssembly/Execution/Linker.php2
-rw-r--r--src/WebAssembly/Execution/Runtime.php9
2 files changed, 5 insertions, 6 deletions
diff --git a/src/WebAssembly/Execution/Linker.php b/src/WebAssembly/Execution/Linker.php
index 3c9c1d0..89aaaba 100644
--- a/src/WebAssembly/Execution/Linker.php
+++ b/src/WebAssembly/Execution/Linker.php
@@ -14,7 +14,7 @@ final class Linker
private array $symbols = [];
public function __construct(
- private Store $store,
+ public readonly Store $store,
) {
}
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<ExternVal> $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);