]> git.lizzy.rs Git - rust.git/commitdiff
Inline a few `UndefMask` methods.
authorWesley Wiser <wwiser@gmail.com>
Sat, 30 Jun 2018 03:33:17 +0000 (23:33 -0400)
committerWesley Wiser <wwiser@gmail.com>
Sat, 30 Jun 2018 03:33:17 +0000 (23:33 -0400)
This saves 2.5 seconds on the test program.

src/librustc/mir/interpret/mod.rs

index 6bd5814799ae07d6c1847c99bfc77b11528dc55c..37580aa4efdb336fd8b8136122ea9bcd3f3eb795 100644 (file)
@@ -635,11 +635,13 @@ pub fn set_range_inbounds(&mut self, start: Size, end: Size, new_state: bool) {
         }
     }
 
+    #[inline]
     pub fn get(&self, i: Size) -> bool {
         let (block, bit) = bit_index(i);
         (self.blocks[block] & 1 << bit) != 0
     }
 
+    #[inline]
     pub fn set(&mut self, i: Size, new_state: bool) {
         let (block, bit) = bit_index(i);
         if new_state {
@@ -664,6 +666,7 @@ pub fn grow(&mut self, amount: Size, new_state: bool) {
     }
 }
 
+#[inline]
 fn bit_index(bits: Size) -> (usize, usize) {
     let bits = bits.bytes();
     let a = bits / BLOCK_SIZE;