From 47d5d6b394893e544afa2a1c669d392f04f7b6b9 Mon Sep 17 00:00:00 2001 From: xermicus Date: Tue, 14 May 2024 11:08:35 +0200 Subject: [PATCH] dedicated functions for logging events adds even more code size on 32bit Signed-off-by: xermicus --- crates/llvm-context/src/polkavm/context/mod.rs | 6 ++++++ crates/llvm-context/src/polkavm/evm/event.rs | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/llvm-context/src/polkavm/context/mod.rs b/crates/llvm-context/src/polkavm/context/mod.rs index 5b32cac..442ff65 100644 --- a/crates/llvm-context/src/polkavm/context/mod.rs +++ b/crates/llvm-context/src/polkavm/context/mod.rs @@ -1185,6 +1185,12 @@ where /// However, we still protect against this possibility here. Heap index /// offsets are generally untrusted and potentially represent valid /// (but wrong) pointers when truncated. + /// + /// TODO: Splitting up into a dedicated function + /// could potentially decrease code sizes (LLVM can still decide to inline). + /// However, passing i256 parameters is counter productive and + /// I've found that splitting it up actualy increases code size. + /// Should be reviewed after 64bit support. pub fn safe_truncate_int_to_xlen( &self, value: inkwell::values::IntValue<'ctx>, diff --git a/crates/llvm-context/src/polkavm/evm/event.rs b/crates/llvm-context/src/polkavm/evm/event.rs index e024b92..30e68b0 100644 --- a/crates/llvm-context/src/polkavm/evm/event.rs +++ b/crates/llvm-context/src/polkavm/evm/event.rs @@ -10,7 +10,8 @@ use crate::polkavm_const::runtime_api; /// /// TODO: Splitting up into dedicated functions (log0..log4) /// could potentially decrease code sizes (LLVM can still decide to inline). -/// However, passing many i256 parameters could also hurt a bit. +/// However, passing i256 parameters is counter productive and +/// I've found that splitting it up actualy increases code size. /// Should be reviewed after 64bit support. pub fn log<'ctx, D>( context: &mut Context<'ctx, D>,