Address naming and comments from reviews

This commit is contained in:
Andreas Molzer 2019-08-28 03:58:42 +02:00
parent df58fcffbc
commit 85d6b7b9d3
3 changed files with 9 additions and 9 deletions

View File

@ -136,7 +136,7 @@ impl<Tag, Extra> Allocation<Tag, Extra> {
self.size.bytes() as usize
}
/// Look at a slice which may describe undefined bytes or describe a relocation. This differs
/// Looks at a slice which may describe undefined bytes or describe a relocation. This differs
/// from `get_bytes_with_undef_and_ptr` in that it does no relocation checks (even on the
/// edges) at all. It further ignores `AllocationExtra` callbacks.
/// This must not be used for reads affecting the interpreter execution.
@ -144,7 +144,7 @@ impl<Tag, Extra> Allocation<Tag, Extra> {
&self.bytes[range]
}
/// View the undef mask.
/// Returns the undef mask.
pub fn undef_mask(&self) -> &UndefMask {
&self.undef_mask
}
@ -583,7 +583,7 @@ pub struct AllocationDefinedness {
/// Transferring the definedness mask to other allocations.
impl<Tag, Extra> Allocation<Tag, Extra> {
/// Creates a run-length encoding of the undef_mask.
pub fn compress_defined_range(
pub fn compress_undef_range(
&self,
src: Pointer<Tag>,
size: Size,
@ -622,7 +622,7 @@ impl<Tag, Extra> Allocation<Tag, Extra> {
}
/// Apply multiple instances of the run-length encoding to the undef_mask.
pub fn mark_compressed_range(
pub fn mark_compressed_undef_range(
&mut self,
defined: &AllocationDefinedness,
dest: Pointer<Tag>,

View File

@ -35,9 +35,9 @@ pub fn const_alloc_to_llvm(cx: &CodegenCx<'ll, '_>, alloc: &Allocation) -> &'ll
assert_eq!(offset as usize as u64, offset);
let offset = offset as usize;
if offset > next_offset {
// This `inspect` is okay since we have check that it is not within a relocation, it is
// within the bounds of the allocation, and it doesn't affect interpreter execution (we
// inspect the result after interpreter execution). Any undef byte is replaced with
// This `inspect` is okay since we have checked that it is not within a relocation, it
// is within the bounds of the allocation, and it doesn't affect interpreter execution
// (we inspect the result after interpreter execution). Any undef byte is replaced with
// some arbitrary byte value.
//
// FIXME: relay undef bytes to codegen as undef const bytes

View File

@ -900,11 +900,11 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
assert_eq!(size.bytes() as usize as u64, size.bytes());
let src_alloc = self.get(src.alloc_id)?;
let compressed = src_alloc.compress_defined_range(src, size);
let compressed = src_alloc.compress_undef_range(src, size);
// now fill in all the data
let dest_allocation = self.get_mut(dest.alloc_id)?;
dest_allocation.mark_compressed_range(&compressed, dest, size, repeat);
dest_allocation.mark_compressed_undef_range(&compressed, dest, size, repeat);
Ok(())
}