diff --git a/crates/jit/src/instantiate.rs b/crates/jit/src/instantiate.rs index 2a3c7bd42619..d3a260deb563 100644 --- a/crates/jit/src/instantiate.rs +++ b/crates/jit/src/instantiate.rs @@ -509,6 +509,7 @@ impl CompiledModule { /// Returns the text section of the ELF image for this compiled module. /// /// This memory should have the read/execute permissions. + #[inline] pub fn text(&self) -> &[u8] { self.code_memory.text() } @@ -575,6 +576,7 @@ impl CompiledModule { /// /// These trampolines are used for native callers (e.g. `Func::wrap`) /// calling Wasm callees. + #[inline] pub fn native_to_wasm_trampoline(&self, index: DefinedFuncIndex) -> Option<&[u8]> { let loc = self.funcs[index].native_to_wasm_trampoline?; Some(&self.text()[loc.start as usize..][..loc.length as usize]) diff --git a/crates/runtime/src/mmap.rs b/crates/runtime/src/mmap.rs index 1c077890c35b..4f9f4c64d4e5 100644 --- a/crates/runtime/src/mmap.rs +++ b/crates/runtime/src/mmap.rs @@ -122,6 +122,7 @@ impl Mmap { /// # Panics /// /// Panics of the `range` provided is outside of the limits of this mmap. + #[inline] pub unsafe fn slice(&self, range: Range) -> &[u8] { assert!(range.start <= range.end); assert!(range.end <= self.len()); diff --git a/crates/runtime/src/mmap_vec.rs b/crates/runtime/src/mmap_vec.rs index 68d0e49f2c2b..c7822ffe9b4e 100644 --- a/crates/runtime/src/mmap_vec.rs +++ b/crates/runtime/src/mmap_vec.rs @@ -127,6 +127,7 @@ impl MmapVec { impl Deref for MmapVec { type Target = [u8]; + #[inline] fn deref(&self) -> &[u8] { // SAFETY: this mmap owns its own range of the underlying mmap so it // should be all good-to-read. diff --git a/crates/wasmtime/src/signatures.rs b/crates/wasmtime/src/signatures.rs index e34de4638842..6ce6b0150423 100644 --- a/crates/wasmtime/src/signatures.rs +++ b/crates/wasmtime/src/signatures.rs @@ -45,6 +45,7 @@ impl SignatureCollection { } /// Gets the shared signature index given a module signature index. + #[inline] pub fn shared_signature(&self, index: SignatureIndex) -> Option { self.signatures.get(index).copied() }