dart-sdk/.dart_tool
Liam Appelbe e5180d0867 [vm/wasm] Wasm module instantiation and function calling
Add support for instantiating modules, getting their exported functions,
and calling those functions.

Function calling is tricky to implement, because we need to put the args
in an array to pass to wasm, and Dart doesn't have variadic functions.
So I implemented it by overriding noSuchMethod. Users can call
WasmFunction like a regular function, and the args will be dynamically
type checked and put in the array to pass to wasm.

WasmImports is a placeholder for now. Also, it's not possible to get
the function names until FFI supports passing structs by value, so for
now you can only get functions by their export index. If by-value
structs are delayed, I can add an intermediate C++ layer to the wasmer
library work around this.

Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I1214c96df324cfc9fc02a48bc09a269da1b8c6f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160144
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-09-02 00:22:21 +00:00
..
package_config.json [vm/wasm] Wasm module instantiation and function calling 2020-09-02 00:22:21 +00:00