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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 // BasicBlock building: records that a node will later be added to a block but | 227 // BasicBlock building: records that a node will later be added to a block but |
227 // doesn't actually add the node to the block. | 228 // doesn't actually add the node to the block. |
228 void PlanNode(BasicBlock* block, Node* node); | 229 void PlanNode(BasicBlock* block, Node* node); |
229 | 230 |
230 // BasicBlock building: add a node to the end of the block. | 231 // BasicBlock building: add a node to the end of the block. |
231 void AddNode(BasicBlock* block, Node* node); | 232 void AddNode(BasicBlock* block, Node* node); |
232 | 233 |
233 // BasicBlock building: add a goto to the end of {block}. | 234 // BasicBlock building: add a goto to the end of {block}. |
234 void AddGoto(BasicBlock* block, BasicBlock* succ); | 235 void AddGoto(BasicBlock* block, BasicBlock* succ); |
235 | 236 |
| 237 // BasicBlock building: add a call at the end of {block}. |
| 238 void AddCall(BasicBlock* block, Node* call, BasicBlock* success_block, |
| 239 BasicBlock* exception_block); |
| 240 |
236 // BasicBlock building: add a branch at the end of {block}. | 241 // BasicBlock building: add a branch at the end of {block}. |
237 void AddBranch(BasicBlock* block, Node* branch, BasicBlock* tblock, | 242 void AddBranch(BasicBlock* block, Node* branch, BasicBlock* tblock, |
238 BasicBlock* fblock); | 243 BasicBlock* fblock); |
239 | 244 |
240 // BasicBlock building: add a switch at the end of {block}. | 245 // BasicBlock building: add a switch at the end of {block}. |
241 void AddSwitch(BasicBlock* block, Node* sw, BasicBlock** succ_blocks, | 246 void AddSwitch(BasicBlock* block, Node* sw, BasicBlock** succ_blocks, |
242 size_t succ_count); | 247 size_t succ_count); |
243 | 248 |
244 // BasicBlock building: add a return at the end of {block}. | 249 // BasicBlock building: add a return at the end of {block}. |
245 void AddReturn(BasicBlock* block, Node* input); | 250 void AddReturn(BasicBlock* block, Node* input); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 DISALLOW_COPY_AND_ASSIGN(Schedule); | 293 DISALLOW_COPY_AND_ASSIGN(Schedule); |
289 }; | 294 }; |
290 | 295 |
291 std::ostream& operator<<(std::ostream&, const Schedule&); | 296 std::ostream& operator<<(std::ostream&, const Schedule&); |
292 | 297 |
293 } // namespace compiler | 298 } // namespace compiler |
294 } // namespace internal | 299 } // namespace internal |
295 } // namespace v8 | 300 } // namespace v8 |
296 | 301 |
297 #endif // V8_COMPILER_SCHEDULE_H_ | 302 #endif // V8_COMPILER_SCHEDULE_H_ |
OLD | NEW |