9 Commits

Author SHA1 Message Date
Guy Bedford 3013f9459b feat: nodejs refactoring, windows support (#174) 2023-10-12 16:26:11 -07:00
Guy Bedford 506fd7bbbb deps: upgrade toolchain & WASI versions to latest (#162) 2023-09-20 12:47:49 -07:00
Eduardo de Moura Rodrigues 177f295422 fix(preview2-shim): missing response http headers (#158) 2023-09-13 14:23:11 -07:00
Guy Bedford 80881dcb79 feat: initial resources implementation (#128) 2023-08-18 17:35:55 -07:00
Guy Bedford f1a512f07e fix: identifier naming bug (#126) 2023-08-08 14:11:22 -07:00
Alex Crichton 31d3eab095 Support polyfilling multi-memory (#125)
* Support polyfilling multi-memory

Currently JS does not generally support the WebAssembly multi-memory
proposal. Wasmtime will, however, generate adapter modules which use
multi-memory to communicate between components. This means that composed
components are typically not compatible with the transpile process as
they produce a core module that doesn't actually run in any JS runtime.

This commit fixes this issue by adding polyfill support for
multi-memory. Whenever an adapter is produced that uses multi-memory jco
will now rewrite the module such that any references to memory that
isn't at index 0 to be indirected through functions. These imported
functions then operate on the specified memory on behalf of the wasm
itself. This is a horribly slow process because all memory reads/writes
become function calls, but given that the baseline is otherwise "does
not work" it's hopefully a bit better than before.

The end goal here is to work up towards strings between components, but
for now this just gets everything else working with multi-memory such as
transferring lists.

* Fill out comments

---------

Co-authored-by: Guy Bedford <gbedford@fastly.com>
2023-08-08 11:48:41 -07:00
Guy Bedford b3063ff95c fix: preview2 latest APIs (#54) 2023-03-23 15:33:09 -07:00
Guy Bedford d18b2d11ba fixup tests & asm.js cases 2022-12-21 15:54:14 -08:00
Guy Bedford a3bbd41d8c setup tests 2022-12-21 15:54:14 -08:00