pub struct CallSite {
pub caller: String,
pub callee: String,
pub call_id: u64,
pub is_tail_call: bool,
pub is_self_recursive: bool,
}Expand description
A single call site encountered during the inlining pass.
Fields§
§caller: StringName of the calling function.
callee: StringName of the called function.
call_id: u64Unique identifier for this call site (within the pass).
is_tail_call: boolWhether the call is in tail position.
is_self_recursive: boolWhether the callee is (mutually) recursive.
Implementations§
Source§impl CallSite
impl CallSite
Sourcepub fn new(
caller: impl Into<String>,
callee: impl Into<String>,
call_id: u64,
is_tail_call: bool,
is_self_recursive: bool,
) -> Self
pub fn new( caller: impl Into<String>, callee: impl Into<String>, call_id: u64, is_tail_call: bool, is_self_recursive: bool, ) -> Self
Create a new call site record.
Sourcepub fn inline_benefit(&self) -> u64
pub fn inline_benefit(&self) -> u64
Estimated benefit of inlining this call site (in abstract units).
Tail calls get a small bonus because inlining them can enable TCO. Self-recursive calls are penalised because inlining them risks blowup.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CallSite
impl RefUnwindSafe for CallSite
impl Send for CallSite
impl Sync for CallSite
impl Unpin for CallSite
impl UnsafeUnpin for CallSite
impl UnwindSafe for CallSite
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
Mutably borrows from an owned value. Read more