Remove some dead code from wasmtime-jit (#3225)

Looks like nothing is actually using these methods, so let's remove
them.
This commit is contained in:
Alex Crichton
2021-08-23 14:35:39 -05:00
committed by GitHub
parent 3e65b46779
commit 925b771d2d
2 changed files with 1 additions and 21 deletions

View File

@@ -26,15 +26,6 @@ impl CodeMemoryEntry {
unwind_info_len, 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 { impl Drop for CodeMemoryEntry {
@@ -149,13 +140,6 @@ impl CodeMemory {
unsafe { &mut *body_ptr } unsafe { &mut *body_ptr }
} }
/// Returns all published segment ranges.
pub fn published_ranges<'a>(&'a self) -> impl Iterator<Item = (usize, usize)> + 'a {
self.entries[..self.published]
.iter()
.map(|entry| entry.range())
}
/// Allocates and copies the ELF image code section into CodeMemory. /// Allocates and copies the ELF image code section into CodeMemory.
/// Returns references to functions and trampolines defined there. /// Returns references to functions and trampolines defined there.
pub fn allocate_for_object<'a, 'b>( pub fn allocate_for_object<'a, 'b>(

View File

@@ -129,6 +129,7 @@ pub struct TypeTables {
/// Container for data needed for an Instance function to exist. /// Container for data needed for an Instance function to exist.
pub struct ModuleCode { pub struct ModuleCode {
range: (usize, usize), range: (usize, usize),
#[allow(dead_code)]
code_memory: CodeMemory, code_memory: CodeMemory,
#[allow(dead_code)] #[allow(dead_code)]
dbg_jit_registration: Option<GdbJitImageRegistration>, dbg_jit_registration: Option<GdbJitImageRegistration>,
@@ -284,11 +285,6 @@ impl CompiledModule {
.expect("defined function should be present") .expect("defined function should be present")
} }
/// Returns all ranges covered by JIT code.
pub fn jit_code_ranges<'a>(&'a self) -> impl Iterator<Item = (usize, usize)> + 'a {
self.code.code_memory.published_ranges()
}
/// Returns module's JIT code. /// Returns module's JIT code.
pub fn code(&self) -> &Arc<ModuleCode> { pub fn code(&self) -> &Arc<ModuleCode> {
&self.code &self.code