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 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 // Forward declarations. | 14 // Forward declarations. |
15 class ExternalReference; | 15 class ExternalReference; |
16 | 16 |
17 | 17 |
18 namespace compiler { | 18 namespace compiler { |
19 | 19 |
20 // Forward declarations. | 20 // Forward declarations. |
21 class CallDescriptor; | 21 class CallDescriptor; |
22 struct CommonOperatorBuilderImpl; | 22 struct CommonOperatorBuilderImpl; |
23 class Operator; | 23 class Operator; |
24 | 24 |
25 | 25 |
| 26 // Prediction hint for branches. |
| 27 enum class BranchHint : uint8_t { kNone, kTrue, kFalse }; |
| 28 |
| 29 inline size_t hash_value(BranchHint hint) { return static_cast<size_t>(hint); } |
| 30 |
| 31 std::ostream& operator<<(std::ostream&, BranchHint); |
| 32 |
| 33 BranchHint BranchHintOf(const Operator* const); |
| 34 |
| 35 |
26 // Flag that describes how to combine the current environment with | 36 // Flag that describes how to combine the current environment with |
27 // the output of a node to obtain a framestate for lazy bailout. | 37 // the output of a node to obtain a framestate for lazy bailout. |
28 class OutputFrameStateCombine { | 38 class OutputFrameStateCombine { |
29 public: | 39 public: |
30 enum Kind { | 40 enum Kind { |
31 kPushOutput, // Push the output on the expression stack. | 41 kPushOutput, // Push the output on the expression stack. |
32 kPokeAt // Poke at the given environment location, | 42 kPokeAt // Poke at the given environment location, |
33 // counting from the top of the stack. | 43 // counting from the top of the stack. |
34 }; | 44 }; |
35 | 45 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 126 |
117 | 127 |
118 // Interface for building common operators that can be used at any level of IR, | 128 // Interface for building common operators that can be used at any level of IR, |
119 // including JavaScript, mid-level, and low-level. | 129 // including JavaScript, mid-level, and low-level. |
120 class CommonOperatorBuilder FINAL { | 130 class CommonOperatorBuilder FINAL { |
121 public: | 131 public: |
122 explicit CommonOperatorBuilder(Zone* zone); | 132 explicit CommonOperatorBuilder(Zone* zone); |
123 | 133 |
124 const Operator* Dead(); | 134 const Operator* Dead(); |
125 const Operator* End(); | 135 const Operator* End(); |
126 const Operator* Branch(); | 136 const Operator* Branch(BranchHint = BranchHint::kNone); |
127 const Operator* IfTrue(); | 137 const Operator* IfTrue(); |
128 const Operator* IfFalse(); | 138 const Operator* IfFalse(); |
129 const Operator* Throw(); | 139 const Operator* Throw(); |
130 const Operator* Return(); | 140 const Operator* Return(); |
131 | 141 |
132 const Operator* Start(int num_formal_parameters); | 142 const Operator* Start(int num_formal_parameters); |
133 const Operator* Merge(int controls); | 143 const Operator* Merge(int controls); |
134 const Operator* Loop(int controls); | 144 const Operator* Loop(int controls); |
135 const Operator* Parameter(int index); | 145 const Operator* Parameter(int index); |
136 | 146 |
(...skipping 22 matching lines...) Expand all Loading... |
159 | 169 |
160 const CommonOperatorBuilderImpl& impl_; | 170 const CommonOperatorBuilderImpl& impl_; |
161 Zone* const zone_; | 171 Zone* const zone_; |
162 }; | 172 }; |
163 | 173 |
164 } // namespace compiler | 174 } // namespace compiler |
165 } // namespace internal | 175 } // namespace internal |
166 } // namespace v8 | 176 } // namespace v8 |
167 | 177 |
168 #endif // V8_COMPILER_COMMON_OPERATOR_H_ | 178 #endif // V8_COMPILER_COMMON_OPERATOR_H_ |
OLD | NEW |