diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-07-02 11:29:39 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2018-07-13 01:29:10 -0400 |
| commit | ed366980310c6bd77a5a879dc3726ad55d48c5fa (patch) | |
| tree | 0a0364f9bc5afc869ce3b95224bd9fb91febe0b6 /src/libstd/sys/unix/stack_overflow.rs | |
| parent | 862c0dd85153aea02ae284a87cb88e9c0de715a2 (diff) | |
| download | rust-ed366980310c6bd77a5a879dc3726ad55d48c5fa.tar.gz rust-ed366980310c6bd77a5a879dc3726ad55d48c5fa.zip | |
compute region values using SCCs not iterative flow
The strategy is this:
- we compute SCCs once all outlives constraints are known
- we allocate a set of values **per region** for storing liveness
- we allocate a set of values **per SCC** for storing the final values
- when we add a liveness constraint to the region R, we also add it
to the final value of the SCC to which R belongs
- then we can apply the constraints by just walking the DAG for the
SCCs and union'ing the children (which have their liveness
constraints within)
There are a few intermediate refactorings that I really ought to have
broken out into their own commits:
- reverse the constraint graph so that `R1: R2` means `R1 -> R2` and
not `R2 -> R1`. This fits better with the SCC computation and new
style of inference (`->` now means "take value from" and not "push
value into")
- this does affect some of the UI tests, since they traverse the
graph, but mostly the artificial ones and they don't necessarily
seem worse
- put some things (constraint set, etc) into `Rc`. This lets us root
them to permit mutation and iteration. It also guarantees they don't
change, which is critical to the correctness of the algorithm.
- Generalize various helpers that previously operated only on points
to work on any sort of region element.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
