Skip to content

[pull] master from rust-lang:master#490

Merged
pull[bot] merged 9 commits intoevanjs:masterfrom
rust-lang:master
Apr 19, 2020
Merged

[pull] master from rust-lang:master#490
pull[bot] merged 9 commits intoevanjs:masterfrom
rust-lang:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull bot commented Apr 19, 2020

See Commits and Changes for more details.


Created by pull[bot]. Want to support this open source service? Please star it : )

ehuss and others added 9 commits April 19, 2020 10:36
This is intended to make it easier to deal with Unit lifetimes.
Refactor BuildContext

This restructures the "front end" of the compile process so that the `UnitGraph` can be accessed by API users. Essentially, the `BuildContext` contains the result of generating the `UnitGraph`, and other bits of information collected along the way. This logically separates the build process into two phases: (1) generate the `UnitGraph` and `BuildContext` and (2) pass the `BuildContext` to `Context` which performs the actual compilation.

The main challenge here is dealing with the references and lifetimes. The old code kept a bunch of things on the stack with various layers of references. Beside reorganizing things, the big change is to wrap `Package` and `Target` in `Rc`. This still requires the `UnitInterner` to be passed in and kept alive. It is possible to avoid that by placing all `Unit`s in `Rc`, but that had a roughly 5% performance hit (on fresh builds) because Units are very optimized to be used as hashable keys, and `Rc` loses those optimizations.
@pull pull bot added the ⤵️ pull label Apr 19, 2020
@pull pull bot merged commit 3dcfdef into evanjs:master Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants