@@ -147,6 +147,7 @@ impl DepGraph {
147147 }
148148 }
149149
150+ #[ inline]
150151 pub fn new_disabled ( ) -> DepGraph {
151152 DepGraph { data : None , virtual_dep_node_index : Lrc :: new ( AtomicU32 :: new ( 0 ) ) }
152153 }
@@ -163,6 +164,7 @@ impl DepGraph {
163164 }
164165 }
165166
167+ #[ inline]
166168 pub fn assert_ignored ( & self ) {
167169 if let Some ( ..) = self . data {
168170 crate :: tls:: read_deps ( |task_deps| {
@@ -497,18 +499,21 @@ impl DepGraph {
497499 self . data . is_some ( ) && self . dep_node_index_of_opt ( dep_node) . is_some ( )
498500 }
499501
502+ #[ inline]
500503 pub fn prev_fingerprint_of ( & self , dep_node : & DepNode ) -> Option < Fingerprint > {
501504 self . data . as_ref ( ) . unwrap ( ) . previous . fingerprint_of ( dep_node)
502505 }
503506
504507 /// Checks whether a previous work product exists for `v` and, if
505508 /// so, return the path that leads to it. Used to skip doing work.
509+ #[ inline]
506510 pub fn previous_work_product ( & self , v : & WorkProductId ) -> Option < WorkProduct > {
507511 self . data . as_ref ( ) . and_then ( |data| data. previous_work_products . get ( v) . cloned ( ) )
508512 }
509513
510514 /// Access the map of work-products created during the cached run. Only
511515 /// used during saving of the dep-graph.
516+ #[ inline]
512517 pub fn previous_work_products ( & self ) -> & FxHashMap < WorkProductId , WorkProduct > {
513518 & self . data . as_ref ( ) . unwrap ( ) . previous_work_products
514519 }
@@ -535,10 +540,12 @@ impl DepGraph {
535540 dep_node_debug. borrow_mut ( ) . insert ( dep_node, debug_str) ;
536541 }
537542
543+ #[ inline]
538544 pub fn dep_node_debug_str ( & self , dep_node : DepNode ) -> Option < String > {
539545 self . data . as_ref ( ) ?. dep_node_debug . borrow ( ) . get ( & dep_node) . cloned ( )
540546 }
541547
548+ #[ inline]
542549 fn node_color ( & self , dep_node : & DepNode ) -> Option < DepNodeColor > {
543550 if let Some ( ref data) = self . data {
544551 if let Some ( prev_index) = data. previous . node_to_index_opt ( dep_node) {
@@ -792,12 +799,14 @@ impl DepGraph {
792799
793800 // Returns true if the given node has been marked as red during the
794801 // current compilation session. Used in various assertions
802+ #[ inline]
795803 pub fn is_red ( & self , dep_node : & DepNode ) -> bool {
796804 self . node_color ( dep_node) == Some ( DepNodeColor :: Red )
797805 }
798806
799807 // Returns true if the given node has been marked as green during the
800808 // current compilation session. Used in various assertions
809+ #[ inline]
801810 pub fn is_green ( & self , dep_node : & DepNode ) -> bool {
802811 self . node_color ( dep_node) . map_or ( false , |c| c. is_green ( ) )
803812 }
@@ -838,6 +847,7 @@ impl DepGraph {
838847 }
839848 }
840849
850+ #[ inline]
841851 pub fn encode ( & self , profiler : & SelfProfilerRef ) -> FileEncodeResult {
842852 if let Some ( data) = & self . data {
843853 data. current . encoder . steal ( ) . finish ( profiler)
@@ -846,6 +856,7 @@ impl DepGraph {
846856 }
847857 }
848858
859+ #[ inline]
849860 pub ( crate ) fn next_virtual_depnode_index ( & self ) -> DepNodeIndex {
850861 let index = self . virtual_dep_node_index . fetch_add ( 1 , Relaxed ) ;
851862 DepNodeIndex :: from_u32 ( index)
@@ -1012,6 +1023,7 @@ impl CurrentDepGraph {
10121023 }
10131024
10141025 #[ cfg( debug_assertions) ]
1026+ #[ inline]
10151027 fn record_edge ( & self , dep_node_index : DepNodeIndex , key : DepNode ) {
10161028 if let Some ( forbidden_edge) = & self . forbidden_edge {
10171029 forbidden_edge. index_to_node . lock ( ) . insert ( dep_node_index, key) ;
@@ -1020,6 +1032,7 @@ impl CurrentDepGraph {
10201032
10211033 /// Writes the node to the current dep-graph and allocates a `DepNodeIndex` for it.
10221034 /// Assumes that this is a node that has no equivalent in the previous dep-graph.
1035+ #[ inline]
10231036 fn intern_new_node (
10241037 & self ,
10251038 profiler : & SelfProfilerRef ,
@@ -1040,6 +1053,7 @@ impl CurrentDepGraph {
10401053 }
10411054 }
10421055
1056+ #[ inline]
10431057 fn intern_node (
10441058 & self ,
10451059 profiler : & SelfProfilerRef ,
@@ -1142,6 +1156,7 @@ impl CurrentDepGraph {
11421156 }
11431157 }
11441158
1159+ #[ inline]
11451160 fn promote_node_and_deps_to_current (
11461161 & self ,
11471162 profiler : & SelfProfilerRef ,
@@ -1237,6 +1252,7 @@ const COMPRESSED_RED: u32 = 1;
12371252const COMPRESSED_FIRST_GREEN : u32 = 2 ;
12381253
12391254impl DepNodeColorMap {
1255+ #[ inline]
12401256 fn new ( size : usize ) -> DepNodeColorMap {
12411257 DepNodeColorMap { values : ( 0 ..size) . map ( |_| AtomicU32 :: new ( COMPRESSED_NONE ) ) . collect ( ) }
12421258 }
@@ -1252,6 +1268,7 @@ impl DepNodeColorMap {
12521268 }
12531269 }
12541270
1271+ #[ inline]
12551272 fn insert ( & self , index : SerializedDepNodeIndex , color : DepNodeColor ) {
12561273 self . values [ index] . store (
12571274 match color {
0 commit comments