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_COMMON_OPERATOR_H_ | 5 #ifndef V8_COMPILER_COMMON_OPERATOR_H_ |
6 #define V8_COMPILER_COMMON_OPERATOR_H_ | 6 #define V8_COMPILER_COMMON_OPERATOR_H_ |
7 | 7 |
8 #include "src/compiler/machine-type.h" | 8 #include "src/compiler/machine-type.h" |
9 #include "src/unique.h" | 9 #include "src/unique.h" |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 // Prediction hint for branches. | 26 // Prediction hint for branches. |
27 enum class BranchHint : uint8_t { kNone, kTrue, kFalse }; | 27 enum class BranchHint : uint8_t { kNone, kTrue, kFalse }; |
28 | 28 |
29 inline size_t hash_value(BranchHint hint) { return static_cast<size_t>(hint); } | 29 inline size_t hash_value(BranchHint hint) { return static_cast<size_t>(hint); } |
30 | 30 |
31 std::ostream& operator<<(std::ostream&, BranchHint); | 31 std::ostream& operator<<(std::ostream&, BranchHint); |
32 | 32 |
33 BranchHint BranchHintOf(const Operator* const); | 33 BranchHint BranchHintOf(const Operator* const); |
34 | 34 |
35 | 35 |
| 36 size_t CaseIndexOf(const Operator* const); |
| 37 |
| 38 |
36 class SelectParameters FINAL { | 39 class SelectParameters FINAL { |
37 public: | 40 public: |
38 explicit SelectParameters(MachineType type, | 41 explicit SelectParameters(MachineType type, |
39 BranchHint hint = BranchHint::kNone) | 42 BranchHint hint = BranchHint::kNone) |
40 : type_(type), hint_(hint) {} | 43 : type_(type), hint_(hint) {} |
41 | 44 |
42 MachineType type() const { return type_; } | 45 MachineType type() const { return type_; } |
43 BranchHint hint() const { return hint_; } | 46 BranchHint hint() const { return hint_; } |
44 | 47 |
45 private: | 48 private: |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 // Special operator used only in Branches to mark them as always taken, but | 168 // Special operator used only in Branches to mark them as always taken, but |
166 // still unfoldable. This is required to properly connect non terminating | 169 // still unfoldable. This is required to properly connect non terminating |
167 // loops to end (in both the sea of nodes and the CFG). | 170 // loops to end (in both the sea of nodes and the CFG). |
168 const Operator* Always(); | 171 const Operator* Always(); |
169 | 172 |
170 const Operator* Dead(); | 173 const Operator* Dead(); |
171 const Operator* End(); | 174 const Operator* End(); |
172 const Operator* Branch(BranchHint = BranchHint::kNone); | 175 const Operator* Branch(BranchHint = BranchHint::kNone); |
173 const Operator* IfTrue(); | 176 const Operator* IfTrue(); |
174 const Operator* IfFalse(); | 177 const Operator* IfFalse(); |
| 178 const Operator* Switch(size_t control_output_count); |
| 179 const Operator* Case(size_t index); |
175 const Operator* Throw(); | 180 const Operator* Throw(); |
176 const Operator* Return(); | 181 const Operator* Return(); |
177 | 182 |
178 const Operator* Start(int num_formal_parameters); | 183 const Operator* Start(int num_formal_parameters); |
179 const Operator* Loop(int control_input_count); | 184 const Operator* Loop(int control_input_count); |
180 const Operator* Merge(int control_input_count); | 185 const Operator* Merge(int control_input_count); |
181 const Operator* Parameter(int index); | 186 const Operator* Parameter(int index); |
182 | 187 |
183 const Operator* OsrNormalEntry(); | 188 const Operator* OsrNormalEntry(); |
184 const Operator* OsrLoopEntry(); | 189 const Operator* OsrLoopEntry(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 Zone* const zone_; | 222 Zone* const zone_; |
218 | 223 |
219 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); | 224 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); |
220 }; | 225 }; |
221 | 226 |
222 } // namespace compiler | 227 } // namespace compiler |
223 } // namespace internal | 228 } // namespace internal |
224 } // namespace v8 | 229 } // namespace v8 |
225 | 230 |
226 #endif // V8_COMPILER_COMMON_OPERATOR_H_ | 231 #endif // V8_COMPILER_COMMON_OPERATOR_H_ |
OLD | NEW |