Signed-off-by: xermicus <bigcyrill@hotmail.com>
This commit is contained in:
xermicus
2025-09-18 14:40:00 +02:00
parent a5fbd545c5
commit b0ad55715f
8 changed files with 96 additions and 57 deletions
+2
View File
@@ -7,3 +7,5 @@ repository.workspace = true
authors.workspace = true
description = "revive compiler rust backend runtime library"
[dependencies]
alloy-core = { workspace = true, default-features = false }
-1
View File
@@ -1 +0,0 @@
//! The revive Rust backend contract runtime library configuration.
@@ -0,0 +1,4 @@
//! The revive Rust backend contract runtime library configuration.
/// The Ethereum Virtual Machine word size in bytes.
pub const EVM_WORD_SIZE_BYTES: usize = 32;
+2 -13
View File
@@ -2,16 +2,5 @@
#![no_std]
pub const EVM_WORD_SIZE_BYTES: usize = 32;
/// The emulated linear EVM heap memory size.
pub const MEMORY_SIZE: usize = 1024 * 64;
/// The emulated linear EVM heap memory size.
pub const MEMORY: [u8; MEMORY_SIZE] = [0; MEMORY_SIZE];
pub struct Function<const VARIABLES: usize> {
pub variables: [u8; VARIABLES],
}
impl<const VARIABLES: usize> Function<VARIABLES> {}
pub mod configuration;
pub mod memory;
+13
View File
@@ -0,0 +1,13 @@
//! The revive Rust backend contract runtime emulated linear EVM heap memory.
/// The emulated linear EVM heap memory size.
pub const MEMORY_SIZE: usize = 1024 * 64;
/// The emulated linear EVM heap memory size.
pub const MEMORY: [u8; MEMORY_SIZE] = [0; MEMORY_SIZE];
pub struct Function<const VARIABLES: usize> {
pub variables: [u8; VARIABLES],
}
impl<const VARIABLES: usize> Function<VARIABLES> {}
+2 -3
View File
@@ -20,7 +20,7 @@ hex-literal = { version = "0.4.1", default-features = false }
polkavm-derive = { version = "0.27.0" }
[profile.release]
opt-level = 3
opt-level = z
lto = true
codegen-units = 1
"#;
@@ -51,8 +51,7 @@ pub const MEMORY: [u8; MEMORY_SIZE] = [0; MEMORY_SIZE];
const EXPORT_FUNCTION: &str = r#"
#[no_mangle]
#[polkavm_derive::polkavm_export]
pub extern "C" fn
"#;
pub extern "C" fn "#;
fn emit(constructor_code: &str, runtime_code: &str) -> String {
let mut buffer = String::from(HEADER);