compiler-explorer/compiler-explorer

[REQUEST] Web Assembly JIT compiler

Open

#1,871 建立於 2020年3月3日

在 GitHub 查看
 (3 留言) (12 反應) (0 負責人)TypeScript (14,391 star) (1,605 fork)batch import
help wantednew-languagerequest

描述

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

貢獻者指南