pub struct ClosureOptimizer { /* private fields */ }Expand description
A basic closure optimizer.
Implementations§
Source§impl ClosureOptimizer
impl ClosureOptimizer
Sourcepub fn new(inline_threshold: usize) -> Self
pub fn new(inline_threshold: usize) -> Self
Create an optimizer with the given inlining threshold (env size).
Sourcepub fn reduce_env(
&self,
closure: &mut Closure,
used_names: &HashSet<String>,
) -> usize
pub fn reduce_env( &self, closure: &mut Closure, used_names: &HashSet<String>, ) -> usize
Attempt to reduce a closure’s environment by removing unused captures.
Sourcepub fn optimize_pap(&self, pap: &Pap) -> Option<Closure>
pub fn optimize_pap(&self, pap: &Pap) -> Option<Closure>
Specialize a PAP by precomputing partial argument count.
Sourcepub fn inline_paps(&self, table: &mut FunctionTable) -> usize
pub fn inline_paps(&self, table: &mut FunctionTable) -> usize
Inline PAP optimization across the function table.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClosureOptimizer
impl RefUnwindSafe for ClosureOptimizer
impl Send for ClosureOptimizer
impl Sync for ClosureOptimizer
impl Unpin for ClosureOptimizer
impl UnsafeUnpin for ClosureOptimizer
impl UnwindSafe for ClosureOptimizer
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