summaryrefslogtreecommitdiff
path: root/index.htm
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2024-11-01 05:04:25 +0100
committerMitya Selivanov <automainint@guattari.tech>2024-11-01 05:04:25 +0100
commit63c3b9bda3fe7eb8750f084ff070f40b967f9532 (patch)
tree8b027ed24c91ea4de2479108d5886c6675c0504c /index.htm
parenteb0c1592d49de956c8c4d83a831fab3cf0372acb (diff)
downloadreduced_system_layer-63c3b9bda3fe7eb8750f084ff070f40b967f9532.zip
Build wasm without Emscripten
Diffstat (limited to 'index.htm')
-rw-r--r--index.htm22
1 files changed, 16 insertions, 6 deletions
diff --git a/index.htm b/index.htm
index 35fd8ca..0ffcf89 100644
--- a/index.htm
+++ b/index.htm
@@ -24,13 +24,13 @@
fetch("index.wasm"),
{
"wasi_snapshot_preview1" : {
- args_sizes_get : (...args) => { console.log(`args_sizes_get: ${args}`); },
- args_get : (...args) => { console.log(`args_get: ${args}`); },
- proc_exit : (...args) => { console.log(`proc_exit: ${args}`); },
clock_time_get : () => { return Date.now(); },
- fd_close : (...args) => { console.log(`fd_close: ${args}`); },
- fd_write : (...args) => { console.log(`fd_write: ${args}`); },
- fd_seek : (...args) => { console.log(`fd_seek: ${args}`); },
+ args_sizes_get : () => { throw new Error("Unexpected args_sizes_get call"); },
+ args_get : () => { throw new Error("Unexpected args_get call"); },
+ proc_exit : () => { throw new Error("Unexpected proc_exit call"); },
+ fd_close : () => { throw new Error("Unexpected fd_close call"); },
+ fd_write : () => { throw new Error("Unexpected fd_write call"); },
+ fd_seek : () => { throw new Error("Unexpected fd_seek call"); },
},
"env" : {
p_init : () => {
@@ -60,6 +60,16 @@
p_wait_events : () => {},
p_sleep_for : (time) => {},
p_time : Date.now,
+ memset : (dst, val, num) => {
+ // FIXME PERF
+ for (let i = 0; i < num; ++i)
+ dst[i] = val;
+ },
+ memcpy : (dst, src, num) => {
+ // FIXME PERF
+ for (let i = 0; i < num; ++i)
+ dst[i] = src[i];
+ },
},
}
);