Skip to content

Commit

Permalink
Tune inlining
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Feb 19, 2020
1 parent 19170cd commit a852225
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/librustc/dep_graph/graph.rs
Expand Up @@ -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 };
Expand Down
9 changes: 6 additions & 3 deletions src/librustc_data_structures/profiling.rs
Expand Up @@ -81,6 +81,7 @@
//!
//! [mm]: https://github.com/rust-lang/measureme/

use crate::cold_path;
use crate::fx::FxHashMap;

use std::borrow::Borrow;
Expand Down Expand Up @@ -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);
});
}
}

Expand Down
1 change: 1 addition & 0 deletions src/librustc_data_structures/stable_hasher.rs
Expand Up @@ -27,6 +27,7 @@ pub trait StableHasherResult: Sized {
}

impl StableHasher {
#[inline]
pub fn new() -> Self {
StableHasher { state: SipHasher128::new_with_keys(0, 0) }
}
Expand Down
1 change: 1 addition & 0 deletions src/librustc_session/session.rs
Expand Up @@ -392,6 +392,7 @@ impl Session {
);
}

#[inline]
pub fn source_map(&self) -> &source_map::SourceMap {
self.parse_sess.source_map()
}
Expand Down

0 comments on commit a852225

Please sign in to comment.