doc(compiler-singlepass) Fix link to examples + add more links.

This commit is contained in:
Ivan Enderlin
2020-07-16 10:09:45 +02:00
parent 237eb3c1ba
commit 72c8411bb7

View File

@@ -1,7 +1,7 @@
# Wasmer Compiler - Singlepass # Wasmer Compiler - Singlepass
This is the `wasmer-compiler-singlepass` crate, which contains a This is the `wasmer-compiler-singlepass` crate, which contains a
compiler implementation based on Singlepass. compiler implementation based on a Singlepass.
## Usage ## Usage
@@ -22,14 +22,16 @@ let compiler = Singlepass::new();
let store = Store::new(&JIT::new(&compiler).engine()); let store = Store::new(&JIT::new(&compiler).engine());
``` ```
*Note: you can find a [full working example using Singlepass compiler here](https://github.com/wasmerio/wasmer-reborn/blob/master/examples/compiler-singlepass.rs).* *Note: you can find a [full working example using Singlepass compiler
here][example].*
## When to use Singlepass ## When to use Singlepass
Singlepass is designed to emit compiled code at linear time, as such Singlepass is designed to emit compiled code at linear time, as such
is not prone to JIT bombs and also offers great compilation performance is not prone to JIT bombs and also offers great compilation
orders of magnitude faster than `wasmer-compiler-cranelift` and performance orders of magnitude faster than
`wasmer-compiler-llvm`, however with a bit slower runtime speed. [`wasmer-compiler-cranelift`] and [`wasmer-compiler-llvm`], however
with a bit slower runtime speed.
The fact that singlepass is not prone to JIT bombs and offers a very The fact that singlepass is not prone to JIT bombs and offers a very
predictable compilation speed makes it ideal for **blockchains** and other predictable compilation speed makes it ideal for **blockchains** and other
@@ -38,4 +40,10 @@ systems where fast and consistent compilation times are very critical.
## Requirements ## Requirements
At the moment, this crate depends on Rust nightly to be compiled, as it uses At the moment, this crate depends on Rust nightly to be compiled, as it uses
`dynasm-rs` which can only be compiled in Nightly. [`dynasm-rs`] which can only be compiled in Nightly.
[example]: https://github.com/wasmerio/wasmer-reborn/blob/master/examples/compiler_singlepass.rs
[`wasmer-compiler-cranelift`]: https://github.com/wasmerio/wasmer-reborn/tree/master/lib/compiler-cranelift
[`wasmer-compiler-llvm`]: https://github.com/wasmerio/wasmer-reborn/tree/master/lib/compiler-llvm
[`dynasm-rs`]: https://github.com/CensoredUsername/dynasm-rs