From 925b771d2d3590d3e394f3e2ab65ec83666c2637 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 23 Aug 2021 14:35:39 -0500 Subject: [PATCH] Remove some dead code from wasmtime-jit (#3225) Looks like nothing is actually using these methods, so let's remove them. --- crates/jit/src/code_memory.rs | 16 ---------------- crates/jit/src/instantiate.rs | 6 +----- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/crates/jit/src/code_memory.rs b/crates/jit/src/code_memory.rs index 04fe5f07ba..2788a69534 100644 --- a/crates/jit/src/code_memory.rs +++ b/crates/jit/src/code_memory.rs @@ -26,15 +26,6 @@ impl CodeMemoryEntry { unwind_info_len, }) } - - // Note that this intentionally excludes any unwinding information, if - // present, since consumers largely are only interested in code memory - // itself. - fn range(&self) -> (usize, usize) { - let start = self.mmap.as_ptr() as usize; - let end = start + self.text_len; - (start, end) - } } impl Drop for CodeMemoryEntry { @@ -149,13 +140,6 @@ impl CodeMemory { unsafe { &mut *body_ptr } } - /// Returns all published segment ranges. - pub fn published_ranges<'a>(&'a self) -> impl Iterator + 'a { - self.entries[..self.published] - .iter() - .map(|entry| entry.range()) - } - /// Allocates and copies the ELF image code section into CodeMemory. /// Returns references to functions and trampolines defined there. pub fn allocate_for_object<'a, 'b>( diff --git a/crates/jit/src/instantiate.rs b/crates/jit/src/instantiate.rs index 6108a85f17..c579030883 100644 --- a/crates/jit/src/instantiate.rs +++ b/crates/jit/src/instantiate.rs @@ -129,6 +129,7 @@ pub struct TypeTables { /// Container for data needed for an Instance function to exist. pub struct ModuleCode { range: (usize, usize), + #[allow(dead_code)] code_memory: CodeMemory, #[allow(dead_code)] dbg_jit_registration: Option, @@ -284,11 +285,6 @@ impl CompiledModule { .expect("defined function should be present") } - /// Returns all ranges covered by JIT code. - pub fn jit_code_ranges<'a>(&'a self) -> impl Iterator + 'a { - self.code.code_memory.published_ranges() - } - /// Returns module's JIT code. pub fn code(&self) -> &Arc { &self.code