OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/frame-states.h" | 8 #include "src/compiler/frame-states.h" |
9 #include "src/compiler/machine-type.h" | 9 #include "src/compiler/machine-type.h" |
10 #include "src/unique.h" | 10 #include "src/unique.h" |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 | 14 |
15 // Forward declarations. | 15 // Forward declarations. |
16 class ExternalReference; | 16 class ExternalReference; |
17 | 17 |
18 | 18 |
19 namespace compiler { | 19 namespace compiler { |
20 | 20 |
21 // Forward declarations. | 21 // Forward declarations. |
22 class CallDescriptor; | 22 class CallDescriptor; |
23 struct CommonOperatorGlobalCache; | 23 struct CommonOperatorGlobalCache; |
24 class Operator; | 24 class Operator; |
25 | 25 |
26 | 26 |
27 // Prediction hint for branches. | 27 // Prediction hint for branches. |
28 enum class BranchHint : uint8_t { kNone, kTrue, kFalse }; | 28 enum class BranchHint : uint8_t { kNone, kTrue, kFalse }; |
29 | 29 |
| 30 inline BranchHint NegateBranchHint(BranchHint hint) { |
| 31 switch (hint) { |
| 32 case BranchHint::kNone: |
| 33 return hint; |
| 34 case BranchHint::kTrue: |
| 35 return BranchHint::kFalse; |
| 36 case BranchHint::kFalse: |
| 37 return BranchHint::kTrue; |
| 38 } |
| 39 UNREACHABLE(); |
| 40 return hint; |
| 41 } |
| 42 |
30 inline size_t hash_value(BranchHint hint) { return static_cast<size_t>(hint); } | 43 inline size_t hash_value(BranchHint hint) { return static_cast<size_t>(hint); } |
31 | 44 |
32 std::ostream& operator<<(std::ostream&, BranchHint); | 45 std::ostream& operator<<(std::ostream&, BranchHint); |
33 | 46 |
34 BranchHint BranchHintOf(const Operator* const); | 47 BranchHint BranchHintOf(const Operator* const); |
35 | 48 |
36 | 49 |
37 // Prediction whether throw-site is surrounded by any local catch-scope. | 50 // Prediction whether throw-site is surrounded by any local catch-scope. |
38 enum class IfExceptionHint { kLocallyUncaught, kLocallyCaught }; | 51 enum class IfExceptionHint { kLocallyUncaught, kLocallyCaught }; |
39 | 52 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 Zone* const zone_; | 172 Zone* const zone_; |
160 | 173 |
161 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); | 174 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); |
162 }; | 175 }; |
163 | 176 |
164 } // namespace compiler | 177 } // namespace compiler |
165 } // namespace internal | 178 } // namespace internal |
166 } // namespace v8 | 179 } // namespace v8 |
167 | 180 |
168 #endif // V8_COMPILER_COMMON_OPERATOR_H_ | 181 #endif // V8_COMPILER_COMMON_OPERATOR_H_ |
OLD | NEW |