Skip to content

Commit a852225

Browse files
committed
Tune inlining
1 parent 19170cd commit a852225

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

src/librustc/dep_graph/graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ impl CurrentDepGraph {
11221122
}
11231123

11241124
impl DepGraphData {
1125-
#[inline]
1125+
#[inline(never)]
11261126
fn read_index(&self, source: DepNodeIndex) {
11271127
ty::tls::with_context_opt(|icx| {
11281128
let icx = if let Some(icx) = icx { icx } else { return };

src/librustc_data_structures/profiling.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
//!
8282
//! [mm]: https://github.com/rust-lang/measureme/
8383
84+
use crate::cold_path;
8485
use crate::fx::FxHashMap;
8586

8687
use std::borrow::Borrow;
@@ -531,9 +532,11 @@ impl<'a> TimingGuard<'a> {
531532
#[inline]
532533
pub fn finish_with_query_invocation_id(self, query_invocation_id: QueryInvocationId) {
533534
if let Some(guard) = self.0 {
534-
let event_id = StringId::new_virtual(query_invocation_id.0);
535-
let event_id = EventId::from_virtual(event_id);
536-
guard.finish_with_override_event_id(event_id);
535+
cold_path(|| {
536+
let event_id = StringId::new_virtual(query_invocation_id.0);
537+
let event_id = EventId::from_virtual(event_id);
538+
guard.finish_with_override_event_id(event_id);
539+
});
537540
}
538541
}
539542

src/librustc_data_structures/stable_hasher.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pub trait StableHasherResult: Sized {
2727
}
2828

2929
impl StableHasher {
30+
#[inline]
3031
pub fn new() -> Self {
3132
StableHasher { state: SipHasher128::new_with_keys(0, 0) }
3233
}

src/librustc_session/session.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ impl Session {
392392
);
393393
}
394394

395+
#[inline]
395396
pub fn source_map(&self) -> &source_map::SourceMap {
396397
self.parse_sess.source_map()
397398
}

0 commit comments

Comments
 (0)