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

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

Issue 940403002: [turbofan] Don't compute unneeded gray set in AllNodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « src/compiler/all-nodes.h ('k') | src/compiler/graph-visualizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/all-nodes.cc
diff --git a/src/compiler/all-nodes.cc b/src/compiler/all-nodes.cc
index b055a68c08d0ec0a97e9c1719ac19e026aa0cd77..ed4a218c2bc42917aebbe332b72fbaea484ed209 100644
--- a/src/compiler/all-nodes.cc
+++ b/src/compiler/all-nodes.cc
@@ -4,16 +4,16 @@
#include "src/compiler/all-nodes.h"
+#include "src/compiler/graph.h"
+
namespace v8 {
namespace internal {
namespace compiler {
AllNodes::AllNodes(Zone* local_zone, const Graph* graph)
- : live(local_zone),
- gray(local_zone),
- state(graph->NodeCount(), AllNodes::kDead, local_zone) {
+ : live(local_zone), is_live(graph->NodeCount(), false, local_zone) {
Node* end = graph->end();
- state[end->id()] = AllNodes::kLive;
+ is_live[end->id()] = true;
live.push_back(end);
// Find all live nodes reachable from end.
for (size_t i = 0; i < live.size(); i++) {
@@ -26,23 +26,14 @@ AllNodes::AllNodes(Zone* local_zone, const Graph* graph)
// TODO(titzer): print a warning.
continue;
}
- if (state[input->id()] != AllNodes::kLive) {
+ if (!is_live[input->id()]) {
+ is_live[input->id()] = true;
live.push_back(input);
- state[input->id()] = AllNodes::kLive;
}
}
}
-
- // Find all nodes that are not reachable from end that use live nodes.
- for (size_t i = 0; i < live.size(); i++) {
- for (Node* const use : live[i]->uses()) {
- if (state[use->id()] == AllNodes::kDead) {
- gray.push_back(use);
- state[use->id()] = AllNodes::kGray;
- }
- }
- }
-}
}
-}
-} // namespace v8::internal::compiler
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8
« no previous file with comments | « src/compiler/all-nodes.h ('k') | src/compiler/graph-visualizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698