pub struct MethodTable { /* private fields */ }Expand description
Helper for mapping bytecode offsets to method ranges.
Implementations§
Source§impl MethodTable
impl MethodTable
Sourcepub fn new(
instructions: &[Instruction],
manifest: Option<&ContractManifest>,
) -> Self
pub fn new( instructions: &[Instruction], manifest: Option<&ContractManifest>, ) -> Self
Build a method table using stable method starts plus manifest metadata.
Stable starts include the script entry, manifest ABI offsets, compiler
INITSLOT prologues, and direct internal call targets. This keeps
analysis aligned with inferred helpers without over-splitting detached
tails that are only useful for presentation-time rendering.
Sourcepub fn methods(&self) -> impl Iterator<Item = (usize, usize, &MethodRef)>
pub fn methods(&self) -> impl Iterator<Item = (usize, usize, &MethodRef)>
Iterate known method spans as (start, end, method_ref) triples
ordered by start. Used by the structured-IR per-method view to
extract a sub-CFG per method.
Sourcepub fn method_for_offset(&self, offset: usize) -> MethodRef
pub fn method_for_offset(&self, offset: usize) -> MethodRef
Resolve the method that contains the given bytecode offset.
Sourcepub fn resolve_internal_target(&self, target_offset: usize) -> MethodRef
pub fn resolve_internal_target(&self, target_offset: usize) -> MethodRef
Resolve an internal call target to a method reference.
spans is kept sorted by start offset, so we use binary search.
Sourcepub fn manifest_index_for_start(&self, offset: usize) -> Option<usize>
pub fn manifest_index_for_start(&self, offset: usize) -> Option<usize>
Return the manifest ABI method index for a method starting at offset, if any.