Crates.io | near-vm-compiler-singlepass |
lib.rs | near-vm-compiler-singlepass |
version | 0.27.0 |
source | src |
created_at | 2023-05-30 17:55:47.219946 |
updated_at | 2024-11-04 16:24:05.870691 |
description | Singlepass compiler for Wasmer WebAssembly runtime |
homepage | |
repository | https://github.com/near/nearcore |
max_upload_size | |
id | 878169 |
size | 473,178 |
near-vm-compiler-singlepass
This crate is a fork of wasmer-compiler-singlepass
. A significant number of things changed, but the documentation is not up-to-date yet.
This crate contains a compiler implementation based on the Singlepass linear compiler.
use near_vm_test_api::{Store, Universal};
use near_vm_compiler_singlepass::Singlepass;
let compiler = Singlepass::new();
// Put it into an engine and add it to the store
let store = Store::new(&Universal::new(compiler).engine());
Note: you can find a full working example using Singlepass compiler here.
Singlepass is designed to emit compiled code at linear time, as such is not prone to JIT bombs and also offers great compilation performance, however with a bit slower runtime speed.
The fact that singlepass is not prone to JIT bombs and offers a very predictable compilation speed makes it ideal for blockchains and other systems where fast and consistent compilation times are very critical.