compiler-explorer/compiler-explorer

[REQUEST] Web Assembly JIT compiler

Open

#1,871 opened on Mar 3, 2020

View on GitHub
 (3 comments) (12 reactions) (0 assignees)TypeScript (14,391 stars) (1,605 forks)batch import
help wantednew-languagerequest

Description

It is possible to get native jitted code for web assembly(wasm) out of javascript engines like SpiderMonkey and V8. Here is an example.

I think it makes sense to add wat(wasm text)-to-x86 explorer in the future to study optimization opportunities. One could use CE to generate wat and then copy-paste that wat in the second window and get native assembly.

One way to get native assembly is to run v8 with --print-wasm-code option. There's also a way using v8's internals to get custom output.

Adding that would involve installing wasm tools for (wat -> wasm) conversion and one of the javasctipt engines. I personally tried using v8 and it wasn't difficult in terms of installing/compiling from source compared to llvm/clang. Although that would also involve pulling some google internal tools like depot_tools.

Thanks, Anton

Contributor guide