fat -> wide
This commit is contained in:
parent
96ea142c89
commit
386a2bb3a0
@ -24,7 +24,7 @@
|
||||
///
|
||||
/// For optimization of a few very common cases, there is also a representation for a pair of
|
||||
/// primitive values (`ScalarPair`). It allows Miri to avoid making allocations for checked binary
|
||||
/// operations and fat pointers. This idea was taken from rustc's codegen.
|
||||
/// operations and wide pointers. This idea was taken from rustc's codegen.
|
||||
/// In particular, thanks to `ScalarPair`, arithmetic operations and casts can be entirely
|
||||
/// defined on `Immediate`, and do not have to work with a `Place`.
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, HashStable, Hash)]
|
||||
@ -74,7 +74,7 @@ pub fn new_dyn_trait(val: Scalar<Tag>, vtable: Pointer<Tag>) -> Self {
|
||||
pub fn to_scalar_or_undef(self) -> ScalarMaybeUndef<Tag> {
|
||||
match self {
|
||||
Immediate::Scalar(val) => val,
|
||||
Immediate::ScalarPair(..) => bug!("Got a fat pointer where a scalar was expected"),
|
||||
Immediate::ScalarPair(..) => bug!("Got a wide pointer where a scalar was expected"),
|
||||
}
|
||||
}
|
||||
|
||||
@ -331,7 +331,7 @@ pub fn read_scalar(
|
||||
Ok(self.read_immediate(op)?.to_scalar_or_undef())
|
||||
}
|
||||
|
||||
// Turn the fat MPlace into a string (must already be dereferenced!)
|
||||
// Turn the wide MPlace into a string (must already be dereferenced!)
|
||||
pub fn read_str(
|
||||
&self,
|
||||
mplace: MPlaceTy<'tcx, M::PointerTag>,
|
||||
|
@ -125,7 +125,7 @@ pub fn from_ptr(ptr: Pointer<Tag>, align: Align) -> Self {
|
||||
Self::from_scalar_ptr(ptr.into(), align)
|
||||
}
|
||||
|
||||
/// Turn a mplace into a (thin or fat) pointer, as a reference, pointing to the same space.
|
||||
/// Turn a mplace into a (thin or wide) pointer, as a reference, pointing to the same space.
|
||||
/// This is the inverse of `ref_to_mplace`.
|
||||
#[inline(always)]
|
||||
pub fn to_ref(self) -> Immediate<Tag> {
|
||||
@ -278,7 +278,7 @@ impl<'mir, 'tcx, Tag, M> InterpCx<'mir, 'tcx, M>
|
||||
M::MemoryMap: AllocMap<AllocId, (MemoryKind<M::MemoryKinds>, Allocation<Tag, M::AllocExtra>)>,
|
||||
M::AllocExtra: AllocationExtra<Tag>,
|
||||
{
|
||||
/// Take a value, which represents a (thin or fat) reference, and make it a place.
|
||||
/// Take a value, which represents a (thin or wide) reference, and make it a place.
|
||||
/// Alignment is just based on the type. This is the inverse of `MemPlace::to_ref()`.
|
||||
///
|
||||
/// Only call this if you are sure the place is "valid" (aligned and inbounds), or do not
|
||||
@ -1034,7 +1034,7 @@ pub fn allocate(
|
||||
MPlaceTy::from_aligned_ptr(ptr, layout)
|
||||
}
|
||||
|
||||
/// Returns a fat MPlace.
|
||||
/// Returns a wide MPlace.
|
||||
pub fn allocate_str(
|
||||
&mut self,
|
||||
str: &str,
|
||||
|
Loading…
Reference in New Issue
Block a user