Skip to content

Commit c431f3f

Browse files
committed
Inline a few UndefMask methods.
This saves 2.5 seconds on the test program.
1 parent 8f969ed commit c431f3f

File tree

1 file changed

+3
-0
lines changed
  • src/librustc/mir/interpret

1 file changed

+3
-0
lines changed

src/librustc/mir/interpret/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,11 +635,13 @@ impl UndefMask {
635635
}
636636
}
637637

638+
#[inline]
638639
pub fn get(&self, i: Size) -> bool {
639640
let (block, bit) = bit_index(i);
640641
(self.blocks[block] & 1 << bit) != 0
641642
}
642643

644+
#[inline]
643645
pub fn set(&mut self, i: Size, new_state: bool) {
644646
let (block, bit) = bit_index(i);
645647
if new_state {
@@ -664,6 +666,7 @@ impl UndefMask {
664666
}
665667
}
666668

669+
#[inline]
667670
fn bit_index(bits: Size) -> (usize, usize) {
668671
let bits = bits.bytes();
669672
let a = bits / BLOCK_SIZE;

0 commit comments

Comments
 (0)