I'm currently working on creating a wasm function using WasmModuleBuilder from V8:
var builder = new WasmModuleBuilder();
builder.addMemory(5, 5, false);
builder.addFunction("func", {params: [125,125], results: [125,125]});
builder.functions[0].addBody([
kExprGetLocal,
0,
kExprGetLocal,
1
]);
x = builder.instantiate()
for (f in x.exports) {
console.log(x.exports[f](0.5, 0.5))
}
An error is being thrown:
asm decoding failed: return count of 2 exceeds internal limit of 1 @+15
I'm looking for a way to return multiple values. Any suggestions or alternative methods for creating wasm functions from JavaScript code would be greatly appreciated.