aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-03-14 00:14:15 +0900
committernsfisis <nsfisis@gmail.com>2024-03-14 00:14:15 +0900
commit4b7e894a397def9b14d8e3f589ec159dfb788ed8 (patch)
tree2ca7ce51594d512b8bd34b648edb870dfd6e11a8 /examples
parentdb69c4edabf03c2d4bf5119d5b307bdd3a5c7cbe (diff)
downloadphp-waddiwasi-4b7e894a397def9b14d8e3f589ec159dfb788ed8.tar.gz
php-waddiwasi-4b7e894a397def9b14d8e3f589ec159dfb788ed8.tar.zst
php-waddiwasi-4b7e894a397def9b14d8e3f589ec159dfb788ed8.zip
perf: specialize load/store instr
Diffstat (limited to 'examples')
-rw-r--r--examples/php-on-wasm/php-wasm.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/php-on-wasm/php-wasm.php b/examples/php-on-wasm/php-wasm.php
index 6443107..54f6561 100644
--- a/examples/php-on-wasm/php-wasm.php
+++ b/examples/php-on-wasm/php-wasm.php
@@ -619,9 +619,9 @@ function hostFunc__wasi_snapshot_preview1__fd_write(Runtime $runtime): void {
$nWritten = 0;
for ($i = 0; $i < $iovcnt; $i++) {
- $ptr = $mem->loadI32($iov + $i * 8, 4, true);
+ $ptr = $mem->loadI32_s32($iov + $i * 8);
assert($ptr !== null);
- $len = $mem->loadI32($iov + $i * 8 + 4, 4, true);
+ $len = $mem->loadI32_s32($iov + $i * 8 + 4);
assert($len !== null);
$buf = '';
for ($j = 0; $j < $len; $j++) {
@@ -636,7 +636,7 @@ function hostFunc__wasi_snapshot_preview1__fd_write(Runtime $runtime): void {
}
$nWritten += $len;
}
- $mem->storeI32($pnum, $nWritten, 4);
+ $mem->storeI32_s32($pnum, $nWritten);
$runtime->stack->pushValue(0);
}
@@ -724,7 +724,7 @@ function hostFunc__env____syscall_openat(Runtime $runtime): void {
assert($mem !== null);
if ($varargs !== 0) {
- $mode = $mem->loadI32($varargs, 4, true);
+ $mode = $mem->loadI32_s32($varargs);
$varargs += 4;
} else {
$mode = 0;