-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: internal bytecode representation, add more docs
- Loading branch information
Showing
20 changed files
with
664 additions
and
205 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ authors = ["DaniPopes <[email protected]>"] | |
edition = "2021" | ||
rust-version = "1.76" | ||
license = "MIT OR Apache-2.0" | ||
categories = [] | ||
categories = ["compilers", "cryptography::cryptocurrencies"] | ||
keywords = ["compile", "compiler", "jit", "evm", "ethereum"] | ||
homepage = "https://github.com/danipopes/cranelift-jit-evm" | ||
repository = "https://github.com/danipopes/cranelift-jit-evm" | ||
|
@@ -34,3 +34,5 @@ revm-primitives = "3.1.0" | |
revm-interpreter = "3.4.0" | ||
|
||
color-eyre = "0.6" | ||
tracing = "0.1" | ||
tracing-subscriber = "0.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# revm-jit-core | ||
|
||
Core abstraction and data structures for `revm-jit`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,32 @@ | ||
//! TODO | ||
|
||
#![doc = include_str!("../README.md")] | ||
#![allow(missing_docs)] | ||
#![cfg_attr(not(test), warn(unused_extern_crates))] | ||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] | ||
|
||
#[macro_use] | ||
mod macros; | ||
|
||
mod context; | ||
pub use context::*; | ||
|
||
mod traits; | ||
pub use traits::*; | ||
|
||
#[doc(no_inline)] | ||
pub use revm_interpreter as interpreter; | ||
#[doc(no_inline)] | ||
pub use revm_interpreter::InstructionResult; | ||
#[doc(no_inline)] | ||
pub use revm_primitives as primitives; | ||
|
||
/// JIT compilation result. | ||
pub type Result<T, E = Error> = std::result::Result<T, E>; | ||
|
||
/// JIT compilation error. | ||
pub type Error = color_eyre::eyre::Error; | ||
|
||
// Not public API. | ||
#[doc(hidden)] | ||
pub mod private { | ||
pub use tracing; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/// Log the time it takes to execute the given expression. | ||
#[macro_export] | ||
macro_rules! time { | ||
($level:expr, $what:literal, || $e:expr) => {{ | ||
let timer = std::time::Instant::now(); | ||
let res = $e; | ||
// $crate::private::tracing::event!($level, elapsed=?timer.elapsed(), $what); | ||
$crate::private::tracing::event!($level, "{:>10?} - {}", timer.elapsed(), $what); | ||
res | ||
}}; | ||
} | ||
|
||
/// Log the time it takes to execute the given expression at `debug` level. | ||
#[macro_export] | ||
macro_rules! debug_time { | ||
($what:literal, || $e:expr) => { | ||
$crate::time!($crate::private::tracing::Level::DEBUG, $what, || $e) | ||
}; | ||
} | ||
|
||
/// Log the time it takes to execute the given expression at `trace` level. | ||
#[macro_export] | ||
macro_rules! trace_time { | ||
($what:literal, || $e:expr) => { | ||
$crate::time!($crate::private::tracing::Level::TRACE, $what, || $e) | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# revm-jit | ||
# revm-jit-cranelift | ||
|
||
Experimental [JIT compiler][JIT] for [Ethereum Virtual Machine][EVM] bytecode using [Cranelift]. | ||
[Cranelift] backend for `revm-jit`. | ||
|
||
This crate is currently not functional due to missing `i256` support in Cranelift. | ||
|
||
[EVM]: https://ethereum.org/en/developers/docs/evm/ | ||
[JIT]: https://en.wikipedia.org/wiki/Just-in-time_compilation | ||
[Cranelift]: https://cranelift.dev/ |
Oops, something went wrong.