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

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

Issue 879583002: [turbofan] Remove GenericAlgorithm from verifier and graph replay. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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 | « BUILD.gn ('k') | 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
new file mode 100644
index 0000000000000000000000000000000000000000..2406d27c0b74991dec9f174baeaf44f03e7dddff
--- /dev/null
+++ b/src/compiler/all-nodes.h
@@ -0,0 +1,42 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_COMPILER_ALL_NODES_H_
+#define V8_COMPILER_ALL_NODES_H_
+
+#include "src/compiler/graph.h"
+#include "src/compiler/node.h"
+#include "src/v8.h"
+#include "src/zone-containers.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+// A helper utility that traverses the graph and gathers all nodes reachable
+// from end.
+class AllNodes {
Michael Starzinger 2015/01/26 17:16:56 I think this class should live in the graph.h file
+ public:
+ // Constructor. Traverses the graph and builds the {live} and {gray} sets.
+ AllNodes(Zone* local_zone, const Graph* graph);
+
+ bool IsLive(Node* node) {
+ return node != nullptr && node->id() < static_cast<int>(state.size()) &&
+ state[node->id()] == kLive;
+ }
+
+ NodeVector live; // Nodes reachable from end.
+ NodeVector gray; // Nodes themselves not reachable from end, but that
+ // appear in use lists of live nodes.
+
+ private:
+ enum State { kDead, kGray, kLive };
+
+ ZoneVector<State> state;
+};
+}
+}
+} // namespace v8::internal::compiler
+
+#endif // V8_COMPILER_ALL_NODES_H_
« no previous file with comments | « BUILD.gn ('k') | src/compiler/all-nodes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698