-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Use a DFS to compare CTFE snapshots #66946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
ecstatic-morse
wants to merge
10
commits into
rust-lang:master
from
ecstatic-morse:better-infinite-loop
Closed
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6faae4d
Add `erase_alloc_id` method to various Miri primitives
ecstatic-morse f0148a5
Derive `Hash` and `Eq` for some Miri primitives
ecstatic-morse 840e323
Add DFS iterator for `Memory`
ecstatic-morse fa5ff3a
Remove unused `Clone` impl for `Memory`
ecstatic-morse 37844e5
Reimplement CTFE snapshot comparison using a DFS
ecstatic-morse 26b9146
Rename `is_empty` to `has_been_invoked`
ecstatic-morse 345a8d5
Move `CtfeMemory` alias next to `CompileTimeInterpreter`
ecstatic-morse e017f57
Fix typo
ecstatic-morse afb4faa
Hash discriminant of `LocalValue`
ecstatic-morse ba22627
Ensure promotion does not prevent generation of new `AllocId`s
ecstatic-morse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add DFS iterator for
Memory
- Loading branch information
commit 840e323965be8c269278f76c1d1fb434df75f89a
There are no files selected for viewing
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this where you are ignoring
InterpError
? This seems reasonable.We should make sure that we don't catch errors requiring allocation though, similar to this. Maybe create a new helper method at the error type for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean by "errors requiring allocation". Are there certain errors that we should
bug
on instead of ignoring? IsUb
one of these?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any error type that has a
String
or other heap types in their fields will allocate when being thrown, and the catching will then destroy the allocated values. If this allocate->throw->catch->destroy happens in a high frequency we're wasting a lot of cycles with all the allocating/deallocating.So, the idea is to make sure that any error that is caught and acted upon (and not just rethrown) does not allocate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea: Should we make the set of errors that
Memory
can emit a separate type (with appropriateInto
impls) so we know the set of errors thatMemory
methods can emit and can make sure all of them don't allocate?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. I'll probably wait for someone else to do this? It feels like y'all have a decent idea of what you want here.