Tune inlining

This commit is contained in:
John Kåre Alsaker 2020-02-17 18:38:30 +01:00
parent 19170cd217
commit a8522256c5
4 changed files with 9 additions and 4 deletions

View File

@ -1122,7 +1122,7 @@ impl CurrentDepGraph {
}
impl DepGraphData {
#[inline]
#[inline(never)]
fn read_index(&self, source: DepNodeIndex) {
ty::tls::with_context_opt(|icx| {
let icx = if let Some(icx) = icx { icx } else { return };

View File

@ -81,6 +81,7 @@
//!
//! [mm]: https://github.com/rust-lang/measureme/
use crate::cold_path;
use crate::fx::FxHashMap;
use std::borrow::Borrow;
@ -531,9 +532,11 @@ impl<'a> TimingGuard<'a> {
#[inline]
pub fn finish_with_query_invocation_id(self, query_invocation_id: QueryInvocationId) {
if let Some(guard) = self.0 {
let event_id = StringId::new_virtual(query_invocation_id.0);
let event_id = EventId::from_virtual(event_id);
guard.finish_with_override_event_id(event_id);
cold_path(|| {
let event_id = StringId::new_virtual(query_invocation_id.0);
let event_id = EventId::from_virtual(event_id);
guard.finish_with_override_event_id(event_id);
});
}
}

View File

@ -27,6 +27,7 @@ pub trait StableHasherResult: Sized {
}
impl StableHasher {
#[inline]
pub fn new() -> Self {
StableHasher { state: SipHasher128::new_with_keys(0, 0) }
}

View File

@ -392,6 +392,7 @@ impl Session {
);
}
#[inline]
pub fn source_map(&self) -> &source_map::SourceMap {
self.parse_sess.source_map()
}