diff --git a/benches/vm_execution.rs b/benches/vm_execution.rs index 4404c927..a753b863 100644 --- a/benches/vm_execution.rs +++ b/benches/vm_execution.rs @@ -13,7 +13,7 @@ extern crate test; use solana_rbpf::{ ebpf, memory_region::MemoryRegion, - program::{FunctionRegistry, SBPFVersion}, + program::{FunctionRegistry, SBPFVersion, SyscallRegistry}, vm::Config, }; use solana_rbpf::{ @@ -88,6 +88,7 @@ fn bench_jit_vs_interpreter( Arc::new(BuiltinProgram::new_loader( config, FunctionRegistry::default(), + SyscallRegistry::default(), )), ) .unwrap(); diff --git a/src/jit.rs b/src/jit.rs index d17abd19..e8c324e7 100644 --- a/src/jit.rs +++ b/src/jit.rs @@ -1696,7 +1696,9 @@ impl<'a, C: ContextObject> JitCompiler<'a, C> { mod tests { use super::*; use crate::{ - program::{BuiltinFunction, BuiltinProgram, FunctionRegistry, SBPFVersion}, + program::{ + BuiltinFunction, BuiltinProgram, FunctionRegistry, SBPFVersion, SyscallRegistry, + }, syscalls, vm::TestContextObject, }; @@ -1748,7 +1750,8 @@ mod tests { function_registry .register_function_hashed(*b"gather_bytes", syscalls::SyscallGatherBytes::vm) .unwrap(); - let loader = BuiltinProgram::new_loader(config, function_registry); + let syscall_registry = SyscallRegistry::default(); + let loader = BuiltinProgram::new_loader(config, function_registry, syscall_registry); let mut function_registry = FunctionRegistry::default(); function_registry .register_function(8, *b"function_foo", 8) diff --git a/src/program.rs b/src/program.rs index 131b08f5..c4829f22 100644 --- a/src/program.rs +++ b/src/program.rs @@ -216,7 +216,7 @@ impl FunctionRegistry { } } -/// A syscall registry to operate with static syscalls represented by integers. +/// A registry to operate with static syscalls represented by integers. #[derive(PartialEq, Eq)] pub struct SyscallRegistry { look_up: Vec<(Vec, T)>, diff --git a/tests/execution.rs b/tests/execution.rs index f890e9b6..539b3f15 100644 --- a/tests/execution.rs +++ b/tests/execution.rs @@ -3454,6 +3454,7 @@ fn execute_generated_program(prog: &[u8]) -> bool { ..Config::default() }, FunctionRegistry::default(), + SyscallRegistry::default(), )), SBPFVersion::V2, FunctionRegistry::default(), diff --git a/tests/exercise_instructions.rs b/tests/exercise_instructions.rs index 659c5770..6acd1a0b 100644 --- a/tests/exercise_instructions.rs +++ b/tests/exercise_instructions.rs @@ -17,7 +17,7 @@ use solana_rbpf::{ assembler::assemble, ebpf, memory_region::MemoryRegion, - program::{BuiltinFunction, BuiltinProgram, FunctionRegistry, SBPFVersion}, + program::{BuiltinFunction, BuiltinProgram, FunctionRegistry, SBPFVersion, SyscallRegistry}, static_analysis::Analysis, verifier::RequisiteVerifier, vm::{Config, ContextObject, TestContextObject}, @@ -124,7 +124,7 @@ macro_rules! test_interpreter_and_jit_asm { config.enable_instruction_tracing = true; let mut function_registry = FunctionRegistry::>::default(); $(test_interpreter_and_jit!(register, function_registry, $location => $syscall_function);)* - let loader = Arc::new(BuiltinProgram::new_loader(config, function_registry)); + let loader = Arc::new(BuiltinProgram::new_loader(config, function_registry, SyscallRegistry::default())); let mut executable = assemble($source, loader).unwrap(); test_interpreter_and_jit!(executable, $mem, $context_object); }