3 ms·
@jart, how does the JIT work? Have you done the kind of Wingo-style wasm JIT[^0]? Or do you turn the JIT off? [^0]: https://wingolog.org/archives/2022/08/18/ju
by tekknolagi 4y ago
@jart, how does the JIT work? Have you done the kind of Wingo-style wasm JIT[^0]? Or do you turn the JIT off?
[^0]: https://wingolog.org/archives/2022/08/18/just-in-time-code-generation-within-webassembly https://wingolog.org/archives/2022/08/18/just-in-time-code-g...
- deleted 4y ago[deleted]
- jart 4y agoBlink's JIT only supports x86_64 and aarch64 at the moment. Otherwise it runs in interpreter mode.
- kentonv 4y agoBut to be clear, the JIT can actually target Wasm? Like it generates new Wasm modules on the fly and loads them with the browser's WebAssembly API? EDIT: Nevermind I misread, duh (thought you were refering to the input binary format rather than the target architecture). Still, very cool.
- jart 4y agoThe binary format that Blinkenlights executes is x86_64. The binary format that it generates for the purposes of JIT is x86_64 or aarch64. I'd like to add WASM to the list of JITable formats if it's possible. Currently, only about ~10 lines of handwritten assembly needed to be written per target architecture. Blink also needs a way to generate functions calls, plus an instruction length decoder. I currently know very little about WASM, but if someone else does, I'm hoping I've made it relatively straightforward to contribute JIT support.
- tekknolagi 4y agoThanks!