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

Unified Diff: src/compiler/control-flow-optimizer.h

Issue 931623002: [turbofan] Optimize certain chains of Branch into a Switch. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addrssed comments. 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/common-operator.cc ('k') | src/compiler/control-flow-optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/control-flow-optimizer.h
diff --git a/src/compiler/control-flow-optimizer.h b/src/compiler/control-flow-optimizer.h
new file mode 100644
index 0000000000000000000000000000000000000000..fb96e01734e4015e9a4123a0b1cb190bcd136748
--- /dev/null
+++ b/src/compiler/control-flow-optimizer.h
@@ -0,0 +1,52 @@
+// 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_CONTROL_FLOW_OPTIMIZER_H_
+#define V8_COMPILER_CONTROL_FLOW_OPTIMIZER_H_
+
+#include "src/compiler/node-marker.h"
+#include "src/zone-containers.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+// Forward declarations.
+class CommonOperatorBuilder;
+class Graph;
+class JSGraph;
+class MachineOperatorBuilder;
+class Node;
+
+
+class ControlFlowOptimizer FINAL {
+ public:
+ ControlFlowOptimizer(JSGraph* jsgraph, Zone* zone);
+
+ void Optimize();
+
+ private:
+ void Enqueue(Node* node);
+ void VisitNode(Node* node);
+ void VisitBranch(Node* node);
+
+ CommonOperatorBuilder* common() const;
+ Graph* graph() const;
+ JSGraph* jsgraph() const { return jsgraph_; }
+ MachineOperatorBuilder* machine() const;
+ Zone* zone() const { return zone_; }
+
+ JSGraph* const jsgraph_;
+ ZoneQueue<Node*> queue_;
+ NodeMarker<bool> queued_;
+ Zone* const zone_;
+
+ DISALLOW_COPY_AND_ASSIGN(ControlFlowOptimizer);
+};
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8
+
+#endif // V8_COMPILER_CONTROL_FLOW_OPTIMIZER_H_
« no previous file with comments | « src/compiler/common-operator.cc ('k') | src/compiler/control-flow-optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698