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_SCHEDULE_H_ | 5 #ifndef V8_COMPILER_SCHEDULE_H_ |
6 #define V8_COMPILER_SCHEDULE_H_ | 6 #define V8_COMPILER_SCHEDULE_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/zone-containers.h" | 10 #include "src/zone-containers.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 // A basic block contains an ordered list of nodes and ends with a control | 26 // A basic block contains an ordered list of nodes and ends with a control |
27 // node. Note that if a basic block has phis, then all phis must appear as the | 27 // node. Note that if a basic block has phis, then all phis must appear as the |
28 // first nodes in the block. | 28 // first nodes in the block. |
29 class BasicBlock FINAL : public ZoneObject { | 29 class BasicBlock FINAL : public ZoneObject { |
30 public: | 30 public: |
31 // Possible control nodes that can end a block. | 31 // Possible control nodes that can end a block. |
32 enum Control { | 32 enum Control { |
33 kNone, // Control not initialized yet. | 33 kNone, // Control not initialized yet. |
34 kGoto, // Goto a single successor block. | 34 kGoto, // Goto a single successor block. |
| 35 kCall, // Call with continuation as first successor, exception second. |
35 kBranch, // Branch if true to first successor, otherwise second. | 36 kBranch, // Branch if true to first successor, otherwise second. |
36 kSwitch, // Table dispatch to one of the successor blocks. | 37 kSwitch, // Table dispatch to one of the successor blocks. |
37 kReturn, // Return a value from this method. | 38 kReturn, // Return a value from this method. |
38 kThrow // Throw an exception. | 39 kThrow // Throw an exception. |
39 }; | 40 }; |
40 | 41 |
41 class Id { | 42 class Id { |
42 public: | 43 public: |
43 int ToInt() const { return static_cast<int>(index_); } | 44 int ToInt() const { return static_cast<int>(index_); } |
44 size_t ToSize() const { return index_; } | 45 size_t ToSize() const { return index_; } |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 // BasicBlock building: records that a node will later be added to a block but | 224 // BasicBlock building: records that a node will later be added to a block but |
224 // doesn't actually add the node to the block. | 225 // doesn't actually add the node to the block. |
225 void PlanNode(BasicBlock* block, Node* node); | 226 void PlanNode(BasicBlock* block, Node* node); |
226 | 227 |
227 // BasicBlock building: add a node to the end of the block. | 228 // BasicBlock building: add a node to the end of the block. |
228 void AddNode(BasicBlock* block, Node* node); | 229 void AddNode(BasicBlock* block, Node* node); |
229 | 230 |
230 // BasicBlock building: add a goto to the end of {block}. | 231 // BasicBlock building: add a goto to the end of {block}. |
231 void AddGoto(BasicBlock* block, BasicBlock* succ); | 232 void AddGoto(BasicBlock* block, BasicBlock* succ); |
232 | 233 |
| 234 // BasicBlock building: add a call at the end of {block}. |
| 235 void AddCall(BasicBlock* block, Node* call, BasicBlock* success_block, |
| 236 BasicBlock* exception_block); |
| 237 |
233 // BasicBlock building: add a branch at the end of {block}. | 238 // BasicBlock building: add a branch at the end of {block}. |
234 void AddBranch(BasicBlock* block, Node* branch, BasicBlock* tblock, | 239 void AddBranch(BasicBlock* block, Node* branch, BasicBlock* tblock, |
235 BasicBlock* fblock); | 240 BasicBlock* fblock); |
236 | 241 |
237 // BasicBlock building: add a switch at the end of {block}. | 242 // BasicBlock building: add a switch at the end of {block}. |
238 void AddSwitch(BasicBlock* block, Node* sw, BasicBlock** succ_blocks, | 243 void AddSwitch(BasicBlock* block, Node* sw, BasicBlock** succ_blocks, |
239 size_t succ_count); | 244 size_t succ_count); |
240 | 245 |
241 // BasicBlock building: add a return at the end of {block}. | 246 // BasicBlock building: add a return at the end of {block}. |
242 void AddReturn(BasicBlock* block, Node* input); | 247 void AddReturn(BasicBlock* block, Node* input); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 DISALLOW_COPY_AND_ASSIGN(Schedule); | 290 DISALLOW_COPY_AND_ASSIGN(Schedule); |
286 }; | 291 }; |
287 | 292 |
288 std::ostream& operator<<(std::ostream&, const Schedule&); | 293 std::ostream& operator<<(std::ostream&, const Schedule&); |
289 | 294 |
290 } // namespace compiler | 295 } // namespace compiler |
291 } // namespace internal | 296 } // namespace internal |
292 } // namespace v8 | 297 } // namespace v8 |
293 | 298 |
294 #endif // V8_COMPILER_SCHEDULE_H_ | 299 #endif // V8_COMPILER_SCHEDULE_H_ |
OLD | NEW |