Hood Chatham
7ae4749d06
gh-124621: Emscripten: Add support for async input devices (GH-136822)
...
This is useful for implementing proper `input()`. It requires the
JavaScript engine to support the wasm JSPI spec which is now stage 4.
It is supported on Chrome since version 137 and on Firefox and node
behind a flag.
We override the `__wasi_fd_read()` syscall with our own variant that
checks for a readAsync operation. If it has it, we use our own async
variant of `fd_read()`, otherwise we use the original `fd_read()`.
We also add a variant of `FS.createDevice()` called
`FS.createAsyncInputDevice()`.
Finally, if JSPI is available, we wrap the `main()` symbol with
`WebAssembly.promising()` so that we can stack switch from `fd_read()`.
If JSPI is not available, attempting to read from an AsyncInputDevice
will raise an `OSError`.
2025-07-19 17:14:29 +02:00
..
2025-05-05 15:25:22 -07:00
2025-04-09 16:18:54 -07:00
2025-05-28 20:11:09 +03:00
2025-07-11 14:32:35 +01:00
2025-04-29 02:21:47 +00:00
2025-05-04 21:07:35 +03:00
2025-05-09 09:10:52 +02:00
2025-04-30 11:46:41 +02:00
2025-06-16 17:34:19 -06:00
2025-03-17 09:19:04 +00:00
2025-07-04 09:04:47 +05:30
2025-06-25 00:06:32 -07:00
2025-05-04 10:05:35 +01:00
2025-07-08 13:04:50 +05:30
2025-04-30 10:11:09 +09:00
2025-06-25 13:03:05 +02:00
2025-05-04 21:07:35 +03:00
2025-05-29 14:54:30 +00:00
2024-12-23 13:31:33 +01:00
2025-06-16 17:34:19 -06:00
2025-06-13 16:45:21 -06:00
2025-06-24 12:53:14 -06:00
2025-03-17 12:32:43 +01:00
2025-03-19 23:01:32 +01:00
2025-05-08 15:01:25 +00:00
2025-07-19 17:14:29 +02:00
2025-06-16 23:17:17 +00:00
2025-05-28 20:11:09 +03:00
2025-07-04 09:04:47 +05:30
2025-05-15 21:12:10 +01:00
2025-07-01 20:24:04 +03:00
2025-03-17 09:19:04 +00:00
2025-04-17 13:38:34 -07:00
2024-11-22 18:50:30 +00:00
2024-10-29 23:57:59 +00:00
2025-07-15 11:26:16 -04:00
2025-07-10 22:13:23 +01:00
2025-07-04 09:04:47 +05:30
2025-07-13 12:44:54 +03:00
2024-11-12 15:59:19 +02:00
2025-05-05 15:09:19 +00:00
2025-06-16 23:32:52 +09:00
2025-05-29 14:54:30 +00:00
2025-06-16 17:34:19 -06:00
2025-04-18 02:49:19 +01:00
2025-05-25 20:19:29 +00:00
2025-07-15 10:45:41 +01:00
2025-04-30 11:37:53 +01:00
2025-07-14 17:01:56 -07:00
2025-03-17 09:19:04 +00:00
2025-05-28 20:11:09 +03:00
2025-07-14 10:14:20 -07:00
2025-03-24 11:00:32 +01:00
2025-07-01 13:26:13 -04:00
2025-06-29 10:07:24 +03:00
2025-05-28 15:24:40 +02:00
2025-05-20 11:24:11 -04:00
2025-06-27 19:37:44 +08:00
2025-07-02 01:20:46 +08:00
2025-07-02 14:08:25 +08:00
2025-06-28 18:30:30 +08:00
2025-06-17 13:43:09 +01:00
2025-06-04 09:35:56 +02:00
2025-05-09 11:39:23 +00:00
2025-07-11 14:32:35 +01:00
2025-07-11 14:32:35 +01:00
2025-07-15 10:45:41 +01:00
2024-11-07 16:37:41 +01:00
2025-07-07 12:45:22 +05:30
2025-06-17 13:16:59 -06:00
2024-11-01 22:04:31 +00:00
2025-05-29 14:54:30 +00:00
2025-03-19 13:46:17 +00:00
2025-05-28 20:11:09 +03:00
2025-03-19 17:33:24 +01:00
2025-06-25 00:06:32 -07:00
2025-07-10 18:44:24 +01:00
2025-06-07 19:32:06 +01:00
2025-06-17 14:11:09 +02:00
2025-06-05 18:53:57 +01:00
2025-07-01 17:31:07 +02:00
2025-04-18 21:03:42 +05:30
2025-03-17 09:19:04 +00:00
2025-07-13 21:09:42 +03:00
2025-06-21 10:56:14 +03:00
2025-05-30 10:15:47 +00:00
2024-10-13 20:59:41 +05:30
2025-05-30 10:15:47 +00:00
2025-05-30 10:15:47 +00:00
2025-05-28 20:11:09 +03:00
2025-03-22 10:38:47 +01:00
2025-01-17 16:42:27 +01:00
2025-04-29 12:56:20 +02:00