Mauro Bringolf
Mauro Bringolf
Here is what I've been working on: * New package that transpiles sign extension instructions back to functions with the (hopefully) same behavior. * The functions replacing the instructions are...
Currently we store them as instructions in the function body which is closer to text format, but conceptually not quite right since they're not instructions. I think we should move...
There are some restrictions on these arguments for the memory instructions to be well typed. * https://github.com/xtuc/webassemblyjs/blob/master/packages/validation/src/type-checker/get-type.js#L355 * https://github.com/xtuc/webassemblyjs/blob/master/packages/validation/src/type-checker/get-type.js#L373
The instructions related to tables are still missing from the type checker.
Our AST representation has different ways of representing nested instruction * `node.args`: https://github.com/xtuc/webassemblyjs/blob/master/packages/wast-parser/test/fixtures/return/expected.json#L18 * `node.instr`: https://github.com/xtuc/webassemblyjs/blob/master/packages/wast-parser/test/fixtures/instruction/nested-block/expected.json#L20 * `node.instrArgs`: https://github.com/xtuc/webassemblyjs/blob/d73d782786a02d97b21dd9285e20ada9911c219c/packages/wast-parser/test/fixtures/wast-call-instruction/expected.json#L11 This makes code working with them (in my case the type...
I noticed that the block node has `result: null` instead of `result: []` when its result type is omitted: https://github.com/xtuc/webassemblyjs/blob/master/packages/wast-parser/test/fixtures/block/empty/expected.json#L12 This should be `[]` for consistency, maybe there are other...
Another AST format change proposal. Conversion and memory instructions carry a type in their name (`store8`, `reinterpret/i32`, etc). We currently just store the instruction name and whatever package that requires...
The text format supports the following literals for floating point numbers * `nan`: https://github.com/WebAssembly/spec/blob/master/test/core/float_literals.wast#L5-L7 * `nan:0x...`: https://github.com/WebAssembly/spec/blob/master/test/core/float_literals.wast#L8-L13 * `inf`: https://github.com/WebAssembly/spec/blob/master/test/core/float_literals.wast#L14-L16 Spec is here https://webassembly.github.io/spec/core/text/values.html#text-float
Since we are interpreting in JS it makes sense to use JS floats for all numbers and their operations wherever possible. However, I think there are a few problems with...
We need to ensure that only valid literals are used for each type by comparing the parsed value with the upper and lower bound of the ranges.