Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Unified Diff: src/compiler/graph-trimmer.h

Issue 1698883003: [turbofan] Robustify the GraphTrimmer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/graph-trimmer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/graph-trimmer.h
diff --git a/src/compiler/graph-trimmer.h b/src/compiler/graph-trimmer.h
index d8258becc8d6e4c3cb46ac9bdbc50a9ae28ab460..98d335a44df22eba6db95c7dad2a356869dfdaf6 100644
--- a/src/compiler/graph-trimmer.h
+++ b/src/compiler/graph-trimmer.h
@@ -28,14 +28,18 @@ class GraphTrimmer final {
// or any of the roots in the sequence [{begin},{end}[.
template <typename ForwardIterator>
void TrimGraph(ForwardIterator begin, ForwardIterator end) {
- while (begin != end) MarkAsLive(*begin++);
+ while (begin != end) {
+ Node* const node = *begin++;
+ if (!node->IsDead()) MarkAsLive(node);
+ }
TrimGraph();
}
private:
V8_INLINE bool IsLive(Node* const node) { return is_live_.Get(node); }
V8_INLINE void MarkAsLive(Node* const node) {
- if (!node->IsDead() && !IsLive(node)) {
+ DCHECK(!node->IsDead());
+ if (!IsLive(node)) {
is_live_.Set(node, true);
live_.push_back(node);
}
« no previous file with comments | « no previous file | src/compiler/graph-trimmer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698