inline some things

This commit is contained in:
Chris Fallin
2021-05-26 00:48:41 -07:00
parent 4e0dd1f296
commit dcf6f473ca

View File

@@ -485,6 +485,7 @@ impl PrioQueue {
} }
} }
#[inline(always)]
fn insert(&mut self, bundle: LiveBundleIndex, prio: usize, reg_hint: PReg) { fn insert(&mut self, bundle: LiveBundleIndex, prio: usize, reg_hint: PReg) {
self.heap.push(PrioQueueEntry { self.heap.push(PrioQueueEntry {
prio: prio as u32, prio: prio as u32,
@@ -493,10 +494,12 @@ impl PrioQueue {
}); });
} }
#[inline(always)]
fn is_empty(self) -> bool { fn is_empty(self) -> bool {
self.heap.is_empty() self.heap.is_empty()
} }
#[inline(always)]
fn pop(&mut self) -> Option<(LiveBundleIndex, PReg)> { fn pop(&mut self) -> Option<(LiveBundleIndex, PReg)> {
self.heap.pop().map(|entry| (entry.bundle, entry.reg_hint)) self.heap.pop().map(|entry| (entry.bundle, entry.reg_hint))
} }