OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COMPILER_SCHEDULER_H_ | 5 #ifndef V8_COMPILER_SCHEDULER_H_ |
6 #define V8_COMPILER_SCHEDULER_H_ | 6 #define V8_COMPILER_SCHEDULER_H_ |
7 | 7 |
8 #include "src/base/flags.h" | 8 #include "src/base/flags.h" |
9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
10 #include "src/compiler/opcodes.h" | 10 #include "src/compiler/opcodes.h" |
11 #include "src/compiler/schedule.h" | 11 #include "src/compiler/schedule.h" |
12 #include "src/compiler/zone-stats.h" | 12 #include "src/compiler/zone-stats.h" |
| 13 #include "src/globals.h" |
13 #include "src/zone/zone-containers.h" | 14 #include "src/zone/zone-containers.h" |
14 | 15 |
15 namespace v8 { | 16 namespace v8 { |
16 namespace internal { | 17 namespace internal { |
17 namespace compiler { | 18 namespace compiler { |
18 | 19 |
19 // Forward declarations. | 20 // Forward declarations. |
20 class CFGBuilder; | 21 class CFGBuilder; |
21 class ControlEquivalence; | 22 class ControlEquivalence; |
22 class Graph; | 23 class Graph; |
23 class SpecialRPONumberer; | 24 class SpecialRPONumberer; |
24 | 25 |
25 | 26 |
26 // Computes a schedule from a graph, placing nodes into basic blocks and | 27 // Computes a schedule from a graph, placing nodes into basic blocks and |
27 // ordering the basic blocks in the special RPO order. | 28 // ordering the basic blocks in the special RPO order. |
28 class Scheduler { | 29 class V8_EXPORT_PRIVATE Scheduler { |
29 public: | 30 public: |
30 // Flags that control the mode of operation. | 31 // Flags that control the mode of operation. |
31 enum Flag { kNoFlags = 0u, kSplitNodes = 1u << 1 }; | 32 enum Flag { kNoFlags = 0u, kSplitNodes = 1u << 1 }; |
32 typedef base::Flags<Flag> Flags; | 33 typedef base::Flags<Flag> Flags; |
33 | 34 |
34 // The complete scheduling algorithm. Creates a new schedule and places all | 35 // The complete scheduling algorithm. Creates a new schedule and places all |
35 // nodes from the graph into it. | 36 // nodes from the graph into it. |
36 static Schedule* ComputeSchedule(Zone* zone, Graph* graph, Flags flags); | 37 static Schedule* ComputeSchedule(Zone* zone, Graph* graph, Flags flags); |
37 | 38 |
38 // Compute the RPO of blocks in an existing schedule. | 39 // Compute the RPO of blocks in an existing schedule. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 }; | 116 }; |
116 | 117 |
117 | 118 |
118 DEFINE_OPERATORS_FOR_FLAGS(Scheduler::Flags) | 119 DEFINE_OPERATORS_FOR_FLAGS(Scheduler::Flags) |
119 | 120 |
120 } // namespace compiler | 121 } // namespace compiler |
121 } // namespace internal | 122 } // namespace internal |
122 } // namespace v8 | 123 } // namespace v8 |
123 | 124 |
124 #endif // V8_COMPILER_SCHEDULER_H_ | 125 #endif // V8_COMPILER_SCHEDULER_H_ |
OLD | NEW |