| 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/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 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-pool.h" | 12 #include "src/compiler/zone-pool.h" |
| 13 #include "src/zone-containers.h" | 13 #include "src/zone-containers.h" |
| 14 | 14 |
| 15 namespace v8 { | 15 namespace v8 { |
| 16 namespace internal { | 16 namespace internal { |
| 17 namespace compiler { | 17 namespace compiler { |
| 18 | 18 |
| 19 class SpecialRPONumberer; | 19 class SpecialRPONumberer; |
| 20 | 20 |
| 21 // Computes a schedule from a graph, placing nodes into basic blocks and | 21 // Computes a schedule from a graph, placing nodes into basic blocks and |
| 22 // ordering the basic blocks in the special RPO order. | 22 // ordering the basic blocks in the special RPO order. |
| 23 class Scheduler { | 23 class Scheduler { |
| 24 public: | 24 public: |
| 25 // The complete scheduling algorithm. Creates a new schedule and places all | 25 // The complete scheduling algorithm. Creates a new schedule and places all |
| 26 // nodes from the graph into it. | 26 // nodes from the graph into it. |
| 27 static Schedule* ComputeSchedule(ZonePool* zone_pool, Graph* graph); | 27 static Schedule* ComputeSchedule(Zone* zone, Graph* graph); |
| 28 | 28 |
| 29 // Compute the RPO of blocks in an existing schedule. | 29 // Compute the RPO of blocks in an existing schedule. |
| 30 static BasicBlockVector* ComputeSpecialRPO(ZonePool* zone_pool, | 30 static BasicBlockVector* ComputeSpecialRPO(Zone* zone, Schedule* schedule); |
| 31 Schedule* schedule); | |
| 32 | 31 |
| 33 private: | 32 private: |
| 34 // Placement of a node changes during scheduling. The placement state | 33 // Placement of a node changes during scheduling. The placement state |
| 35 // transitions over time while the scheduler is choosing a position: | 34 // transitions over time while the scheduler is choosing a position: |
| 36 // | 35 // |
| 37 // +---------------------+-----+----> kFixed | 36 // +---------------------+-----+----> kFixed |
| 38 // / / / | 37 // / / / |
| 39 // kUnknown ----+------> kCoupled ----+ / | 38 // kUnknown ----+------> kCoupled ----+ / |
| 40 // \ / | 39 // \ / |
| 41 // +----> kSchedulable ----+--------> kScheduled | 40 // +----> kSchedulable ----+--------> kScheduled |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 103 |
| 105 void FuseFloatingControl(BasicBlock* block, Node* node); | 104 void FuseFloatingControl(BasicBlock* block, Node* node); |
| 106 void MovePlannedNodes(BasicBlock* from, BasicBlock* to); | 105 void MovePlannedNodes(BasicBlock* from, BasicBlock* to); |
| 107 }; | 106 }; |
| 108 | 107 |
| 109 } // namespace compiler | 108 } // namespace compiler |
| 110 } // namespace internal | 109 } // namespace internal |
| 111 } // namespace v8 | 110 } // namespace v8 |
| 112 | 111 |
| 113 #endif // V8_COMPILER_SCHEDULER_H_ | 112 #endif // V8_COMPILER_SCHEDULER_H_ |
| OLD | NEW |