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

Unified Diff: src/compiler/all-nodes.h

Issue 2226293002: [turbolizer] Visualize also the dead nodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@t-p2
Patch Set: Created 4 years, 4 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/all-nodes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/all-nodes.h
diff --git a/src/compiler/all-nodes.h b/src/compiler/all-nodes.h
index 700f0071b1e531e5514a121554a984cdcba3924d..36f02e958256853e619c9ebdec0c48d4ed90d873 100644
--- a/src/compiler/all-nodes.h
+++ b/src/compiler/all-nodes.h
@@ -16,19 +16,27 @@ namespace compiler {
// from end.
class AllNodes {
public:
- // Constructor. Traverses the graph and builds the {live} sets.
- AllNodes(Zone* local_zone, const Graph* graph);
+ // Constructor. Traverses the graph and builds the {reachable} sets. When
+ // {only_inputs} is true, find the nodes reachable through input edges;
+ // these are all live nodes.
+ AllNodes(Zone* local_zone, const Graph* graph, bool only_inputs = true);
bool IsLive(Node* node) {
+ CHECK(only_inputs_);
+ return IsReachable(node);
+ }
+
+ bool IsReachable(Node* node) {
if (!node) return false;
size_t id = node->id();
- return id < is_live.size() && is_live[id];
+ return id < is_reachable_.size() && is_reachable_[id];
}
- NodeVector live; // Nodes reachable from end.
+ NodeVector reachable; // Nodes reachable from end.
private:
- BoolVector is_live;
+ BoolVector is_reachable_;
+ const bool only_inputs_;
};
} // namespace compiler
« no previous file with comments | « no previous file | src/compiler/all-nodes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698