paradigmxyz / revmc

JIT and AOT compiler for the Ethereum Virtual Machine, built on Revm.
Apache License 2.0
159 stars 10 forks source link
aot compiler cranelift evm jit llvm

revmc

Experimental JIT and AOT compiler for the Ethereum Virtual Machine.

The compiler implementation is abstracted over an intermediate representation backend. It performs very well, as demonstrated below from our criterion benchmarks, and exposes an intuitive API via Revm.

image

This repository hosts two backend implementations:

Requirements

LLVM backend

Usage

The compiler is implemented as a library and can be used as such through the revmc crate.

A minimal runtime is required to run AOT-compiled bytecodes. A default runtime implementation is provided through symbols exported in the revmc-builtins crate and must be exported in the final binary. This can be achieved with the following build script:

fn main() {
    revmc_build::emit();
}

You can check out the examples directory for example usage.

Credits

The initial compiler implementation was inspired by paradigmxyz/jitevm.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in these crates by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.