pub struct JitIndex {
pub methods: Vec<JitMethod>,
pub call_graph: HashMap<String, Vec<String>>,
}Expand description
Parsed index of all methods in a JIT disassembly file.
Fields§
§methods: Vec<JitMethod>§call_graph: HashMap<String, Vec<String>>Inverted call graph: callee-name-substring → caller method names.
Built from call [Namespace.Class:Method(args):ret] operands
in every method body. When disasm <X> matches no standalone
listing (because X was inlined at every site), we look up X
here and advertise the callers by name — the user can jump
straight to disasm <caller> and find the inlined body embedded
there, instead of having to discover the caller via search
first.
Keyed by both the fully-qualified Namespace.Class:Method form
and the short Class:Method form, so a pattern in either shape
resolves.
Implementations§
Source§impl JitIndex
impl JitIndex
Sourcepub fn callers_of(&self, pattern: &str) -> Vec<&str>
pub fn callers_of(&self, pattern: &str) -> Vec<&str>
Callers that reference pattern in a call instruction. Used
by the empty-match hint to advertise where an inlined target’s
body can actually be inspected (inside the caller’s listing).
Substring match so MathUtils:Length, :Length, and the full
MyNamespace.MathUtils:Length all resolve.
Sourcepub fn cmd_methods(&self, pattern: &str) -> String
pub fn cmd_methods(&self, pattern: &str) -> String
methods [pattern] — list methods with code sizes, sorted largest first.
Sourcepub fn disasm_with_parent_fallback(&self, pattern: &str) -> Option<String>
pub fn disasm_with_parent_fallback(&self, pattern: &str) -> Option<String>
Produce real disassembly text for pattern — the method’s own
body if it was emitted standalone, or the callers’ bodies
(banner-separated) when it was inlined away. Returns None
when neither path has anything: no standalone match, no
caller references in the capture. Callers decide whether to
render a hint, bail, etc.
Shared between the interactive REPL and the on-demand
disasm collector so both surfaces benefit from the
inlined-parent fallback — previously the collector did a
plain header scan and bailed with “no matching header”,
making dbg disasm from a shell strictly worse than the
REPL for inlined targets.
Sourcepub fn cmd_disasm(&self, pattern: &str) -> String
pub fn cmd_disasm(&self, pattern: &str) -> String
disasm <pattern> — REPL command. Thin wrapper over
disasm_with_parent_fallback that renders the generic
inlining hint when there’s nothing useful to show.
Sourcepub fn cmd_search(&self, pattern: &str) -> String
pub fn cmd_search(&self, pattern: &str) -> String
search <instruction> — find methods containing a specific instruction.
Sourcepub fn cmd_callers(&self, pattern: &str) -> String
pub fn cmd_callers(&self, pattern: &str) -> String
callers <pattern> — who calls this method?
Sourcepub fn cmd_hotspots(&self, n: usize, pattern: &str) -> String
pub fn cmd_hotspots(&self, n: usize, pattern: &str) -> String
hotspots [N] [pattern] — top N methods by code size.
Sourcepub fn cmd_simd_filtered(&self, pattern: &str) -> String
pub fn cmd_simd_filtered(&self, pattern: &str) -> String
simd [pattern] — find methods using SIMD instructions,
optionally scoped to a name-substring filter.
Auto Trait Implementations§
impl Freeze for JitIndex
impl RefUnwindSafe for JitIndex
impl Send for JitIndex
impl Sync for JitIndex
impl Unpin for JitIndex
impl UnsafeUnpin for JitIndex
impl UnwindSafe for JitIndex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more