pub struct MachTextSectionBuilder<I: VCodeInst> { /* private fields */ }Expand description
Implementation of the TextSectionBuilder trait backed by MachBuffer.
Note that MachBuffer was primarily written for intra-function references
of jumps between basic blocks, but it’s also quite usable for entire text
sections and resolving references between functions themselves. This
builder interprets “blocks” as labeled functions for the purposes of
resolving labels internally in the buffer.
Implementations§
Source§impl<I: VCodeInst> MachTextSectionBuilder<I>
impl<I: VCodeInst> MachTextSectionBuilder<I>
Sourcepub fn new(num_funcs: usize) -> MachTextSectionBuilder<I>
pub fn new(num_funcs: usize) -> MachTextSectionBuilder<I>
Creates a new text section builder which will have num_funcs functions
pushed into it.
Trait Implementations§
Source§impl<I: VCodeInst> TextSectionBuilder for MachTextSectionBuilder<I>
impl<I: VCodeInst> TextSectionBuilder for MachTextSectionBuilder<I>
Source§fn append(
&mut self,
labeled: bool,
func: &[u8],
align: u32,
ctrl_plane: &mut ControlPlane,
) -> u64
fn append( &mut self, labeled: bool, func: &[u8], align: u32, ctrl_plane: &mut ControlPlane, ) -> u64
Source§fn resolve_reloc(
&mut self,
offset: u64,
reloc: Reloc,
addend: Addend,
target: usize,
) -> bool
fn resolve_reloc( &mut self, offset: u64, reloc: Reloc, addend: Addend, target: usize, ) -> bool
Attempts to resolve a relocation for this function. Read more
Source§fn force_veneers(&mut self)
fn force_veneers(&mut self)
A debug-only option which is used to for
Auto Trait Implementations§
impl<I> Forget for MachTextSectionBuilder<I>
impl<I> Freeze for MachTextSectionBuilder<I>where
*const u8 is !null: Freeze,
*const [u8] is !null: Freeze,
PhantomData<[u8]>: Freeze,
*const MachRelocBase<RelocTarget> is !null: Freeze,
NonZero<u8>: Freeze,
*const MachTrap is !null: Freeze,
*const MachCallSite is !null: Freeze,
*const MachPatchableCallSite is !null: Freeze,
*const MachExceptionHandler is !null: Freeze,
RelSourceLoc: Freeze,
*const MachSrcLoc<Stencil> is !null: Freeze,
PhantomData<MachDebugTags>: Freeze,
PhantomData<DebugTag>: Freeze,
*const [ScalarBitSet<usize>] is !null: Freeze,
PhantomData<[ScalarBitSet<usize>]>: Freeze,
*const (Type, CompoundBitSet) is !null: Freeze,
*const (u32, u32, UserStackMap) is !null: Freeze,
*const (u32, UnwindInst) is !null: Freeze,
*const u32 is !null: Freeze,
*const MachLabel is !null: Freeze,
*const VCodeConstant is !null: Freeze,
*const MachLabelTrap is !null: Freeze,
<I as MachInst>::LabelUse: Freeze,
*const MachLabelFixup<I> is !null: Freeze,
PhantomData<MachLabelFixup<I>>: Freeze,
*const MachBranch is !null: Freeze,
PhantomData<MachBufferConstant>: Freeze,
PhantomData<VCodeConstant>: Freeze,
*const (VCodeConstant, u32) is !null: Freeze,
PhantomData<MachBufferStackSlot>: Freeze,
PhantomData<StackSlot>: Freeze,
impl<I> Move for MachTextSectionBuilder<I>
impl<I> RefUnwindSafe for MachTextSectionBuilder<I>where
u8: RefUnwindSafe,
MachRelocBase<RelocTarget>: RefUnwindSafe,
NonZero<u8>: RefUnwindSafe,
MachTrap: RefUnwindSafe,
MachCallSite: RefUnwindSafe,
MachPatchableCallSite: RefUnwindSafe,
MachExceptionHandler: RefUnwindSafe,
RelSourceLoc: RefUnwindSafe,
MachSrcLoc<Stencil>: RefUnwindSafe,
(Type, CompoundBitSet): RefUnwindSafe,
(u32, u32, UserStackMap): RefUnwindSafe,
(u32, UnwindInst): RefUnwindSafe,
u32: RefUnwindSafe,
MachLabel: RefUnwindSafe,
VCodeConstant: RefUnwindSafe,
MachLabelTrap: RefUnwindSafe,
<I as MachInst>::LabelUse: RefUnwindSafe,
MachLabelFixup<I>: RefUnwindSafe,
MachBranch: RefUnwindSafe,
(VCodeConstant, u32): RefUnwindSafe,
impl<I> Send for MachTextSectionBuilder<I>where
SmallVec<[u8; 1024]>: Send,
SmallVec<[MachRelocBase<RelocTarget>; 16]>: Send,
SmallVec<[MachTrap; 16]>: Send,
SmallVec<[MachCallSite; 16]>: Send,
SmallVec<[MachPatchableCallSite; 16]>: Send,
SmallVec<[MachExceptionHandler; 16]>: Send,
SmallVec<[MachSrcLoc<Stencil>; 64]>: Send,
RawVecInner: Send,
SmallVec<[(u32, u32, UserStackMap); 8]>: Send,
SmallVec<[(u32, UnwindInst); 8]>: Send,
SmallVec<[u32; 16]>: Send,
SmallVec<[MachLabel; 16]>: Send,
SmallVec<[VCodeConstant; 16]>: Send,
SmallVec<[MachLabelTrap; 16]>: Send,
SmallVec<[MachLabelFixup<I>; 16]>: Send,
<I as MachInst>::LabelUse: Send,
SmallVec<[MachBranch; 4]>: Send,
SmallVec<[MachLabel; 4]>: Send,
SmallVec<[(VCodeConstant, u32); 4]>: Send,
impl<I> Sync for MachTextSectionBuilder<I>where
SmallVecData<[u8; 1024]>: Sync,
SmallVecData<[MachRelocBase<RelocTarget>; 16]>: Sync,
SmallVecData<[MachTrap; 16]>: Sync,
SmallVecData<[MachCallSite; 16]>: Sync,
SmallVecData<[MachPatchableCallSite; 16]>: Sync,
SmallVecData<[MachExceptionHandler; 16]>: Sync,
SmallVecData<[MachSrcLoc<Stencil>; 64]>: Sync,
RawVecInner: Sync,
SmallVecData<[(u32, u32, UserStackMap); 8]>: Sync,
SmallVecData<[(u32, UnwindInst); 8]>: Sync,
SmallVecData<[u32; 16]>: Sync,
SmallVecData<[MachLabel; 16]>: Sync,
SmallVecData<[VCodeConstant; 16]>: Sync,
SmallVecData<[MachLabelTrap; 16]>: Sync,
SmallVecData<[MachLabelFixup<I>; 16]>: Sync,
<I as MachInst>::LabelUse: Sync,
SmallVecData<[MachBranch; 4]>: Sync,
SmallVecData<[MachLabel; 4]>: Sync,
SmallVecData<[(VCodeConstant, u32); 4]>: Sync,
impl<I> Unpin for MachTextSectionBuilder<I>where
*const u8 is !null: Unpin,
Box<[u8]>: Unpin,
*const MachRelocBase<RelocTarget> is !null: Unpin,
NonZero<u8>: Unpin,
*const MachTrap is !null: Unpin,
*const MachCallSite is !null: Unpin,
*const MachPatchableCallSite is !null: Unpin,
*const MachExceptionHandler is !null: Unpin,
RelSourceLoc: Unpin,
*const MachSrcLoc<Stencil> is !null: Unpin,
Box<[ScalarBitSet<usize>]>: Unpin,
*const (Type, CompoundBitSet) is !null: Unpin,
*const (u32, u32, UserStackMap) is !null: Unpin,
*const (u32, UnwindInst) is !null: Unpin,
*const u32 is !null: Unpin,
*const MachLabel is !null: Unpin,
*const VCodeConstant is !null: Unpin,
*const MachLabelTrap is !null: Unpin,
<I as MachInst>::LabelUse: Unpin,
*const MachLabelFixup<I> is !null: Unpin,
*const MachBranch is !null: Unpin,
*const (VCodeConstant, u32) is !null: Unpin,
impl<I> UnsafeUnpin for MachTextSectionBuilder<I>where
*const u8 is !null: UnsafeUnpin,
*const [u8] is !null: UnsafeUnpin,
PhantomData<[u8]>: UnsafeUnpin,
*const MachRelocBase<RelocTarget> is !null: UnsafeUnpin,
NonZeroU8Inner: UnsafeUnpin,
*const MachTrap is !null: UnsafeUnpin,
*const MachCallSite is !null: UnsafeUnpin,
*const MachPatchableCallSite is !null: UnsafeUnpin,
*const MachExceptionHandler is !null: UnsafeUnpin,
RelSourceLoc: UnsafeUnpin,
*const MachSrcLoc<Stencil> is !null: UnsafeUnpin,
PhantomData<MachDebugTags>: UnsafeUnpin,
PhantomData<DebugTag>: UnsafeUnpin,
*const [ScalarBitSet<usize>] is !null: UnsafeUnpin,
PhantomData<[ScalarBitSet<usize>]>: UnsafeUnpin,
*const (Type, CompoundBitSet) is !null: UnsafeUnpin,
*const (u32, u32, UserStackMap) is !null: UnsafeUnpin,
*const (u32, UnwindInst) is !null: UnsafeUnpin,
*const u32 is !null: UnsafeUnpin,
*const MachLabel is !null: UnsafeUnpin,
*const VCodeConstant is !null: UnsafeUnpin,
*const MachLabelTrap is !null: UnsafeUnpin,
<I as MachInst>::LabelUse: UnsafeUnpin,
*const MachLabelFixup<I> is !null: UnsafeUnpin,
PhantomData<MachLabelFixup<I>>: UnsafeUnpin,
*const MachBranch is !null: UnsafeUnpin,
PhantomData<MachBufferConstant>: UnsafeUnpin,
PhantomData<VCodeConstant>: UnsafeUnpin,
*const (VCodeConstant, u32) is !null: UnsafeUnpin,
PhantomData<MachBufferStackSlot>: UnsafeUnpin,
PhantomData<StackSlot>: UnsafeUnpin,
impl<I> UnwindSafe for MachTextSectionBuilder<I>where
NonNull<u8>: UnwindSafe,
BoxRaw<[u8]>: UnwindSafe,
NonNull<MachRelocBase<RelocTarget>>: UnwindSafe,
NonZero<u8>: UnwindSafe,
NonNull<MachTrap>: UnwindSafe,
NonNull<MachCallSite>: UnwindSafe,
NonNull<MachPatchableCallSite>: UnwindSafe,
NonNull<MachExceptionHandler>: UnwindSafe,
RelSourceLoc: UnwindSafe,
NonNull<MachSrcLoc<Stencil>>: UnwindSafe,
RawVecInner: UnwindSafe,
BoxRaw<[ScalarBitSet<usize>]>: UnwindSafe,
NonNull<(Type, CompoundBitSet)>: UnwindSafe,
NonNull<(u32, u32, UserStackMap)>: UnwindSafe,
NonNull<(u32, UnwindInst)>: UnwindSafe,
NonNull<u32>: UnwindSafe,
NonNull<MachLabel>: UnwindSafe,
NonNull<VCodeConstant>: UnwindSafe,
NonNull<MachLabelTrap>: UnwindSafe,
<I as MachInst>::LabelUse: UnwindSafe,
NonNull<MachLabelFixup<I>>: UnwindSafe,
NonNull<MachBranch>: UnwindSafe,
NonNull<(VCodeConstant, u32)>: UnwindSafe,
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