Skip to main content

JitIndex

Struct JitIndex 

Source
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

Source

pub fn parse(text: &str) -> Self

Parse raw JIT disassembly text into an indexed structure.

Source

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.

Source

pub fn cmd_methods(&self, pattern: &str) -> String

methods [pattern] — list methods with code sizes, sorted largest first.

Source

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.

Source

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.

search <instruction> — find methods containing a specific instruction.

Source

pub fn cmd_calls(&self, pattern: &str) -> String

calls <pattern> — what does this method call?

Source

pub fn cmd_callers(&self, pattern: &str) -> String

callers <pattern> — who calls this method?

Source

pub fn cmd_stats(&self, pattern: &str) -> String

stats [pattern] — summary statistics.

Source

pub fn cmd_hotspots(&self, n: usize, pattern: &str) -> String

hotspots [N] [pattern] — top N methods by code size.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.