| 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 19 matching lines...) Expand all Loading... |
| 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 | 35 kCall, // Call with continuation as first successor, exception |
| 36 // second. | 36 // second. |
| 37 kBranch, // Branch if true to first successor, otherwise second. | 37 kBranch, // Branch if true to first successor, otherwise second. |
| 38 kSwitch, // Table dispatch to one of the successor blocks. | 38 kSwitch, // Table dispatch to one of the successor blocks. |
| 39 kDeoptimize, // Return a value from this method. | 39 kDeoptimize, // Return a value from this method. |
| 40 kTailCall, // Tail call another method from this method. |
| 40 kReturn, // Return a value from this method. | 41 kReturn, // Return a value from this method. |
| 41 kThrow // Throw an exception. | 42 kThrow // Throw an exception. |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 class Id { | 45 class Id { |
| 45 public: | 46 public: |
| 46 int ToInt() const { return static_cast<int>(index_); } | 47 int ToInt() const { return static_cast<int>(index_); } |
| 47 size_t ToSize() const { return index_; } | 48 size_t ToSize() const { return index_; } |
| 48 static Id FromSize(size_t index) { return Id(index); } | 49 static Id FromSize(size_t index) { return Id(index); } |
| 49 static Id FromInt(int index) { return Id(static_cast<size_t>(index)); } | 50 static Id FromInt(int index) { return Id(static_cast<size_t>(index)); } |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 void AddBranch(BasicBlock* block, Node* branch, BasicBlock* tblock, | 214 void AddBranch(BasicBlock* block, Node* branch, BasicBlock* tblock, |
| 214 BasicBlock* fblock); | 215 BasicBlock* fblock); |
| 215 | 216 |
| 216 // BasicBlock building: add a switch at the end of {block}. | 217 // BasicBlock building: add a switch at the end of {block}. |
| 217 void AddSwitch(BasicBlock* block, Node* sw, BasicBlock** succ_blocks, | 218 void AddSwitch(BasicBlock* block, Node* sw, BasicBlock** succ_blocks, |
| 218 size_t succ_count); | 219 size_t succ_count); |
| 219 | 220 |
| 220 // BasicBlock building: add a deoptimize at the end of {block}. | 221 // BasicBlock building: add a deoptimize at the end of {block}. |
| 221 void AddDeoptimize(BasicBlock* block, Node* input); | 222 void AddDeoptimize(BasicBlock* block, Node* input); |
| 222 | 223 |
| 224 // BasicBlock building: add a tailcall at the end of {block}. |
| 225 void AddTailCall(BasicBlock* block, Node* input); |
| 226 |
| 223 // BasicBlock building: add a return at the end of {block}. | 227 // BasicBlock building: add a return at the end of {block}. |
| 224 void AddReturn(BasicBlock* block, Node* input); | 228 void AddReturn(BasicBlock* block, Node* input); |
| 225 | 229 |
| 226 // BasicBlock building: add a throw at the end of {block}. | 230 // BasicBlock building: add a throw at the end of {block}. |
| 227 void AddThrow(BasicBlock* block, Node* input); | 231 void AddThrow(BasicBlock* block, Node* input); |
| 228 | 232 |
| 229 // BasicBlock mutation: insert a branch into the end of {block}. | 233 // BasicBlock mutation: insert a branch into the end of {block}. |
| 230 void InsertBranch(BasicBlock* block, BasicBlock* end, Node* branch, | 234 void InsertBranch(BasicBlock* block, BasicBlock* end, Node* branch, |
| 231 BasicBlock* tblock, BasicBlock* fblock); | 235 BasicBlock* tblock, BasicBlock* fblock); |
| 232 | 236 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 DISALLOW_COPY_AND_ASSIGN(Schedule); | 271 DISALLOW_COPY_AND_ASSIGN(Schedule); |
| 268 }; | 272 }; |
| 269 | 273 |
| 270 std::ostream& operator<<(std::ostream&, const Schedule&); | 274 std::ostream& operator<<(std::ostream&, const Schedule&); |
| 271 | 275 |
| 272 } // namespace compiler | 276 } // namespace compiler |
| 273 } // namespace internal | 277 } // namespace internal |
| 274 } // namespace v8 | 278 } // namespace v8 |
| 275 | 279 |
| 276 #endif // V8_COMPILER_SCHEDULE_H_ | 280 #endif // V8_COMPILER_SCHEDULE_H_ |
| OLD | NEW |