Skip to main content

EvalContextExt

Trait EvalContextExt 

Source
pub(super) trait EvalContextExt<'tcx>: MiriInterpCxExt<'tcx> {
    // Provided methods
    fn buffered_atomic_rmw(
        &mut self,
        new_val: Scalar,
        place: &MPlaceTy<'tcx>,
        atomic: AtomicRwOrd,
        init: Scalar,
    ) -> InterpResult<'tcx> { ... }
    fn buffered_atomic_read(
        &self,
        place: &MPlaceTy<'tcx>,
        atomic: AtomicReadOrd,
        latest_in_mo: Scalar,
        validate: impl FnOnce(Option<&VClock>) -> InterpResult<'tcx>,
    ) -> InterpResult<'tcx, Option<Scalar>> { ... }
    fn buffered_atomic_write(
        &mut self,
        val: Scalar,
        dest: &MPlaceTy<'tcx>,
        atomic: AtomicWriteOrd,
        init: Result<Option<Scalar>, ()>,
    ) -> InterpResult<'tcx> { ... }
    fn perform_read_on_buffered_latest(
        &self,
        place: &MPlaceTy<'tcx>,
        atomic: AtomicReadOrd,
    ) -> InterpResult<'tcx> { ... }
}

Provided Methods§

Source

fn buffered_atomic_rmw( &mut self, new_val: Scalar, place: &MPlaceTy<'tcx>, atomic: AtomicRwOrd, init: Scalar, ) -> InterpResult<'tcx>

Source

fn buffered_atomic_read( &self, place: &MPlaceTy<'tcx>, atomic: AtomicReadOrd, latest_in_mo: Scalar, validate: impl FnOnce(Option<&VClock>) -> InterpResult<'tcx>, ) -> InterpResult<'tcx, Option<Scalar>>

The argument to validate is the synchronization clock of the memory that is being read, if we are reading from a store buffer element.

Source

fn buffered_atomic_write( &mut self, val: Scalar, dest: &MPlaceTy<'tcx>, atomic: AtomicWriteOrd, init: Result<Option<Scalar>, ()>, ) -> InterpResult<'tcx>

Add the given write to the store buffer. (Does not change machine memory.)

init says with which value to initialize the store buffer in case there wasn’t a store buffer for this memory range before. Err(()) means the value is not available; Ok(None) means the memory does not contain a valid scalar.

Must be called after validate_atomic_store to ensure that sync_clock is up-to-date.

Source

fn perform_read_on_buffered_latest( &self, place: &MPlaceTy<'tcx>, atomic: AtomicReadOrd, ) -> InterpResult<'tcx>

Caller should never need to consult the store buffer for the latest value. This function is used exclusively for failed atomic_compare_exchange_scalar to perform load_impl on the latest store element

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>