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 --- examples/hello-world/index.php | 2 +- examples/php-on-wasm/php-wasm.php | 2 +- examples/rubyvm-on-php-on-wasm/php-wasm.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/hello-world/index.php b/examples/hello-world/index.php index 9b0b1bd..6129a07 100644 --- a/examples/hello-world/index.php +++ b/examples/hello-world/index.php @@ -30,6 +30,6 @@ $linker = new Linker($store); $linker->register('', 'putc', Extern::Func(FuncInst::Host(new FuncType([ValType::I32], []), function (Runtime $runtime, int $c) { printf('%c', $c); }))); -$runtime = Runtime::instantiate($store, $module, $linker->resolve($module)); +$runtime = Runtime::instantiate($module, $linker); $runtime->invoke('main', []); diff --git a/examples/php-on-wasm/php-wasm.php b/examples/php-on-wasm/php-wasm.php index 11bb5ac..78196d6 100644 --- a/examples/php-on-wasm/php-wasm.php +++ b/examples/php-on-wasm/php-wasm.php @@ -133,7 +133,7 @@ foreach ($imports as $moduleName => $moduleImports) { } } -$runtime = Runtime::instantiate($store, $module, $linker->resolve($module)); +$runtime = Runtime::instantiate($module, $linker); $codePtr = allocateStringOnWasmMemory($runtime, PHP_HELLO_WORLD); $results = $runtime->invoke("php_wasm_run", [$codePtr]); diff --git a/examples/rubyvm-on-php-on-wasm/php-wasm.php b/examples/rubyvm-on-php-on-wasm/php-wasm.php index 73c0f19..492d91e 100644 --- a/examples/rubyvm-on-php-on-wasm/php-wasm.php +++ b/examples/rubyvm-on-php-on-wasm/php-wasm.php @@ -133,7 +133,7 @@ foreach ($imports as $moduleName => $moduleImports) { } } -$runtime = Runtime::instantiate($store, $module, $linker->resolve($module)); +$runtime = Runtime::instantiate($module, $linker); $codePtr = allocateStringOnWasmMemory($runtime, strtr(PHP_HELLO_WORLD, ['%DIR%' => __DIR__])); $results = $runtime->invoke("php_wasm_run", [$codePtr]); -- cgit v1.2.3-70-g09d2