diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2020-02-17 18:38:30 +0100 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2020-02-19 16:03:21 +0100 |
| commit | a8522256c5ad5d7ec3b0f10f0d23da84d72ce73a (patch) | |
| tree | 49cb579f0d75a18ca7ba980ea0a0a72ed1c8aa4d | |
| parent | 19170cd217c1469fd7d78c6a99caf6b2bfc91f90 (diff) | |
| download | rust-a8522256c5ad5d7ec3b0f10f0d23da84d72ce73a.tar.gz rust-a8522256c5ad5d7ec3b0f10f0d23da84d72ce73a.zip | |
Tune inlining
| -rw-r--r-- | src/librustc/dep_graph/graph.rs | 2 | ||||
| -rw-r--r-- | src/librustc_data_structures/profiling.rs | 9 | ||||
| -rw-r--r-- | src/librustc_data_structures/stable_hasher.rs | 1 | ||||
| -rw-r--r-- | src/librustc_session/session.rs | 1 |
4 files changed, 9 insertions, 4 deletions
diff --git a/src/librustc/dep_graph/graph.rs b/src/librustc/dep_graph/graph.rs index ae2fde96617..531a45b120c 100644 --- a/src/librustc/dep_graph/graph.rs +++ b/src/librustc/dep_graph/graph.rs @@ -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 }; diff --git a/src/librustc_data_structures/profiling.rs b/src/librustc_data_structures/profiling.rs index 1d0ac4f4907..f2c80510f22 100644 --- a/src/librustc_data_structures/profiling.rs +++ b/src/librustc_data_structures/profiling.rs @@ -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); + }); } } diff --git a/src/librustc_data_structures/stable_hasher.rs b/src/librustc_data_structures/stable_hasher.rs index 0a26bf3bdc9..a98e77cebd8 100644 --- a/src/librustc_data_structures/stable_hasher.rs +++ b/src/librustc_data_structures/stable_hasher.rs @@ -27,6 +27,7 @@ pub trait StableHasherResult: Sized { } impl StableHasher { + #[inline] pub fn new() -> Self { StableHasher { state: SipHasher128::new_with_keys(0, 0) } } diff --git a/src/librustc_session/session.rs b/src/librustc_session/session.rs index 6f003043aa9..2fb7977dce9 100644 --- a/src/librustc_session/session.rs +++ b/src/librustc_session/session.rs @@ -392,6 +392,7 @@ impl Session { ); } + #[inline] pub fn source_map(&self) -> &source_map::SourceMap { self.parse_sess.source_map() } |
