@@ -147,6 +147,7 @@ impl DepGraph {
147
147
}
148
148
}
149
149
150
+ #[ inline]
150
151
pub fn new_disabled ( ) -> DepGraph {
151
152
DepGraph { data : None , virtual_dep_node_index : Lrc :: new ( AtomicU32 :: new ( 0 ) ) }
152
153
}
@@ -163,6 +164,7 @@ impl DepGraph {
163
164
}
164
165
}
165
166
167
+ #[ inline]
166
168
pub fn assert_ignored ( & self ) {
167
169
if let Some ( ..) = self . data {
168
170
crate :: tls:: read_deps ( |task_deps| {
@@ -497,18 +499,21 @@ impl DepGraph {
497
499
self . data . is_some ( ) && self . dep_node_index_of_opt ( dep_node) . is_some ( )
498
500
}
499
501
502
+ #[ inline]
500
503
pub fn prev_fingerprint_of ( & self , dep_node : & DepNode ) -> Option < Fingerprint > {
501
504
self . data . as_ref ( ) . unwrap ( ) . previous . fingerprint_of ( dep_node)
502
505
}
503
506
504
507
/// Checks whether a previous work product exists for `v` and, if
505
508
/// so, return the path that leads to it. Used to skip doing work.
509
+ #[ inline]
506
510
pub fn previous_work_product ( & self , v : & WorkProductId ) -> Option < WorkProduct > {
507
511
self . data . as_ref ( ) . and_then ( |data| data. previous_work_products . get ( v) . cloned ( ) )
508
512
}
509
513
510
514
/// Access the map of work-products created during the cached run. Only
511
515
/// used during saving of the dep-graph.
516
+ #[ inline]
512
517
pub fn previous_work_products ( & self ) -> & FxHashMap < WorkProductId , WorkProduct > {
513
518
& self . data . as_ref ( ) . unwrap ( ) . previous_work_products
514
519
}
@@ -535,10 +540,12 @@ impl DepGraph {
535
540
dep_node_debug. borrow_mut ( ) . insert ( dep_node, debug_str) ;
536
541
}
537
542
543
+ #[ inline]
538
544
pub fn dep_node_debug_str ( & self , dep_node : DepNode ) -> Option < String > {
539
545
self . data . as_ref ( ) ?. dep_node_debug . borrow ( ) . get ( & dep_node) . cloned ( )
540
546
}
541
547
548
+ #[ inline]
542
549
fn node_color ( & self , dep_node : & DepNode ) -> Option < DepNodeColor > {
543
550
if let Some ( ref data) = self . data {
544
551
if let Some ( prev_index) = data. previous . node_to_index_opt ( dep_node) {
@@ -792,12 +799,14 @@ impl DepGraph {
792
799
793
800
// Returns true if the given node has been marked as red during the
794
801
// current compilation session. Used in various assertions
802
+ #[ inline]
795
803
pub fn is_red ( & self , dep_node : & DepNode ) -> bool {
796
804
self . node_color ( dep_node) == Some ( DepNodeColor :: Red )
797
805
}
798
806
799
807
// Returns true if the given node has been marked as green during the
800
808
// current compilation session. Used in various assertions
809
+ #[ inline]
801
810
pub fn is_green ( & self , dep_node : & DepNode ) -> bool {
802
811
self . node_color ( dep_node) . map_or ( false , |c| c. is_green ( ) )
803
812
}
@@ -838,6 +847,7 @@ impl DepGraph {
838
847
}
839
848
}
840
849
850
+ #[ inline]
841
851
pub fn encode ( & self , profiler : & SelfProfilerRef ) -> FileEncodeResult {
842
852
if let Some ( data) = & self . data {
843
853
data. current . encoder . steal ( ) . finish ( profiler)
@@ -846,6 +856,7 @@ impl DepGraph {
846
856
}
847
857
}
848
858
859
+ #[ inline]
849
860
pub ( crate ) fn next_virtual_depnode_index ( & self ) -> DepNodeIndex {
850
861
let index = self . virtual_dep_node_index . fetch_add ( 1 , Relaxed ) ;
851
862
DepNodeIndex :: from_u32 ( index)
@@ -1012,6 +1023,7 @@ impl CurrentDepGraph {
1012
1023
}
1013
1024
1014
1025
#[ cfg( debug_assertions) ]
1026
+ #[ inline]
1015
1027
fn record_edge ( & self , dep_node_index : DepNodeIndex , key : DepNode ) {
1016
1028
if let Some ( forbidden_edge) = & self . forbidden_edge {
1017
1029
forbidden_edge. index_to_node . lock ( ) . insert ( dep_node_index, key) ;
@@ -1020,6 +1032,7 @@ impl CurrentDepGraph {
1020
1032
1021
1033
/// Writes the node to the current dep-graph and allocates a `DepNodeIndex` for it.
1022
1034
/// Assumes that this is a node that has no equivalent in the previous dep-graph.
1035
+ #[ inline]
1023
1036
fn intern_new_node (
1024
1037
& self ,
1025
1038
profiler : & SelfProfilerRef ,
@@ -1040,6 +1053,7 @@ impl CurrentDepGraph {
1040
1053
}
1041
1054
}
1042
1055
1056
+ #[ inline]
1043
1057
fn intern_node (
1044
1058
& self ,
1045
1059
profiler : & SelfProfilerRef ,
@@ -1142,6 +1156,7 @@ impl CurrentDepGraph {
1142
1156
}
1143
1157
}
1144
1158
1159
+ #[ inline]
1145
1160
fn promote_node_and_deps_to_current (
1146
1161
& self ,
1147
1162
profiler : & SelfProfilerRef ,
@@ -1237,6 +1252,7 @@ const COMPRESSED_RED: u32 = 1;
1237
1252
const COMPRESSED_FIRST_GREEN : u32 = 2 ;
1238
1253
1239
1254
impl DepNodeColorMap {
1255
+ #[ inline]
1240
1256
fn new ( size : usize ) -> DepNodeColorMap {
1241
1257
DepNodeColorMap { values : ( 0 ..size) . map ( |_| AtomicU32 :: new ( COMPRESSED_NONE ) ) . collect ( ) }
1242
1258
}
@@ -1252,6 +1268,7 @@ impl DepNodeColorMap {
1252
1268
}
1253
1269
}
1254
1270
1271
+ #[ inline]
1255
1272
fn insert ( & self , index : SerializedDepNodeIndex , color : DepNodeColor ) {
1256
1273
self . values [ index] . store (
1257
1274
match color {
0 commit comments