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" |
(...skipping 16 matching lines...) Expand all Loading... |
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 size_t hash_value(BranchHint hint) { return static_cast<size_t>(hint); } | 30 inline size_t hash_value(BranchHint hint) { return static_cast<size_t>(hint); } |
31 | 31 |
32 std::ostream& operator<<(std::ostream&, BranchHint); | 32 std::ostream& operator<<(std::ostream&, BranchHint); |
33 | 33 |
34 BranchHint BranchHintOf(const Operator* const); | 34 BranchHint BranchHintOf(const Operator* const); |
35 | 35 |
36 | 36 |
| 37 // Prediction whether throw-site is surrounded by any local catch-scope. |
| 38 enum class IfExceptionHint { kLocallyUncaught, kLocallyCaught }; |
| 39 |
| 40 size_t hash_value(IfExceptionHint hint); |
| 41 |
| 42 std::ostream& operator<<(std::ostream&, IfExceptionHint); |
| 43 |
| 44 |
37 class SelectParameters final { | 45 class SelectParameters final { |
38 public: | 46 public: |
39 explicit SelectParameters(MachineType type, | 47 explicit SelectParameters(MachineType type, |
40 BranchHint hint = BranchHint::kNone) | 48 BranchHint hint = BranchHint::kNone) |
41 : type_(type), hint_(hint) {} | 49 : type_(type), hint_(hint) {} |
42 | 50 |
43 MachineType type() const { return type_; } | 51 MachineType type() const { return type_; } |
44 BranchHint hint() const { return hint_; } | 52 BranchHint hint() const { return hint_; } |
45 | 53 |
46 private: | 54 private: |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 class CommonOperatorBuilder final : public ZoneObject { | 95 class CommonOperatorBuilder final : public ZoneObject { |
88 public: | 96 public: |
89 explicit CommonOperatorBuilder(Zone* zone); | 97 explicit CommonOperatorBuilder(Zone* zone); |
90 | 98 |
91 const Operator* Dead(); | 99 const Operator* Dead(); |
92 const Operator* End(size_t control_input_count); | 100 const Operator* End(size_t control_input_count); |
93 const Operator* Branch(BranchHint = BranchHint::kNone); | 101 const Operator* Branch(BranchHint = BranchHint::kNone); |
94 const Operator* IfTrue(); | 102 const Operator* IfTrue(); |
95 const Operator* IfFalse(); | 103 const Operator* IfFalse(); |
96 const Operator* IfSuccess(); | 104 const Operator* IfSuccess(); |
97 const Operator* IfException(); | 105 const Operator* IfException(IfExceptionHint hint); |
98 const Operator* Switch(size_t control_output_count); | 106 const Operator* Switch(size_t control_output_count); |
99 const Operator* IfValue(int32_t value); | 107 const Operator* IfValue(int32_t value); |
100 const Operator* IfDefault(); | 108 const Operator* IfDefault(); |
101 const Operator* Throw(); | 109 const Operator* Throw(); |
102 const Operator* Deoptimize(); | 110 const Operator* Deoptimize(); |
103 const Operator* Return(); | 111 const Operator* Return(); |
104 const Operator* Terminate(); | 112 const Operator* Terminate(); |
105 | 113 |
106 const Operator* Start(int num_formal_parameters); | 114 const Operator* Start(int num_formal_parameters); |
107 const Operator* Loop(int control_input_count); | 115 const Operator* Loop(int control_input_count); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 Zone* const zone_; | 153 Zone* const zone_; |
146 | 154 |
147 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); | 155 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); |
148 }; | 156 }; |
149 | 157 |
150 } // namespace compiler | 158 } // namespace compiler |
151 } // namespace internal | 159 } // namespace internal |
152 } // namespace v8 | 160 } // namespace v8 |
153 | 161 |
154 #endif // V8_COMPILER_COMMON_OPERATOR_H_ | 162 #endif // V8_COMPILER_COMMON_OPERATOR_H_ |
OLD | NEW |