Skip to content

Commit a2e6356

Browse files
committed
Auto merge of rust-lang#138824 - Zoxc:dep-graph-no-prev-map, r=oli-obk
Remove `prev_index_to_index` field from `CurrentDepGraph` The dep graph currently has 2 ways to map a previous index into a current index. The `prev_index_to_index` map stores the current index equivalent of a previous index. For indices which are marked green, we also store the same information in the `DepNodeColorMap`. We actually only need to known the mapping for green nodes however, so this PR removes `prev_index_to_index` and instead makes use of the `DepNodeColorMap`. To avoid racing when promoting a node from the previous session, the encoder lock is now used to ensure only one thread encodes the promoted node. This was previously done by the lock in `prev_index_to_index`. This also changes `nodes_newly_allocated_in_current_session` used to detect duplicate dep nodes to contain both new and previous nodes, which is simpler and can better catch duplicates. The dep node index encoding used in `DepNodeColorMap` is tweak to avoid subtraction / addition to optimize accessing the current equivalent of a previous index. r? `@oli-obk`
2 parents 19cab6b + 60e4a1b commit a2e6356

File tree

2 files changed

+144
-185
lines changed

2 files changed

+144
-185
lines changed

0 commit comments

Comments
 (0)