forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dropflag hints (stack-local booleans) for unfragmented paths in t…
…rans. Added code to maintain these hints at runtime, and to conditionalize drop-filling and calls to destructors. In this early stage, we are using hints, so we are always free to leave out a flag for a path -- then we just pass `None` as the dropflag hint in the corresponding schedule cleanup call. But, once a path has a hint, we must at least maintain it: i.e. if the hint exists, we must ensure it is never set to "moved" if the data in question might actually have been initialized. It remains sound to conservatively set the hint to "initialized" as long as the true drop-flag embedded in the value itself is up-to-date. ---- Here are some high-level details I want to point out: * We maintain the hint in Lvalue::post_store, marking the lvalue as moved. (But also continue drop-filling if necessary.) * We update the hint on ExprAssign. * We pass along the hint in once closures that capture-by-move. * You only call `drop_ty` for state that does not have an associated hint. If you have a hint, you must call `drop_ty_core` instead. (Originally I passed the hint into `drop_ty` as well, to make the connection to a hint more apparent, but the vast majority of current calls to `drop_ty` are in contexts where no hint is available, so it just seemed like noise in the resulting diff.)
- Loading branch information
Showing
10 changed files
with
259 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.