bytecodealliance / lucet

Lucet, the Sandboxing WebAssembly Compiler.
Apache License 2.0
4.06k stars 164 forks source link

lucetc: parallelize codegen with rayon #595

Closed pchickey closed 3 years ago

pchickey commented 3 years ago

This PR enables parallel code generation in lucetc by way of the rayon crate.

The internals of lucetc were re-organized in terms of ownership and send/sync safety, but should be functionally identical.

cranelift-module was modified to enable parallel code generation upstream: https://github.com/bytecodealliance/wasmtime/pull/2371

One side-effect of this parallelism is that section ordering in the resulting object file is no longer deterministic. This would be a desirable property in the long run but isn't necessary right now.

I authored the first bit of this and @alexcrichton finished it up, so we'll each sign-off on the others work here.