| 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 class SelectParameters FINAL { |
| 37 public: |
| 38 explicit SelectParameters(MachineType type, |
| 39 BranchHint hint = BranchHint::kNone) |
| 40 : type_(type), hint_(hint) {} |
| 41 |
| 42 MachineType type() const { return type_; } |
| 43 BranchHint hint() const { return hint_; } |
| 44 |
| 45 private: |
| 46 const MachineType type_; |
| 47 const BranchHint hint_; |
| 48 }; |
| 49 |
| 50 bool operator==(SelectParameters const&, SelectParameters const&); |
| 51 bool operator!=(SelectParameters const&, SelectParameters const&); |
| 52 |
| 53 size_t hash_value(SelectParameters const& p); |
| 54 |
| 55 std::ostream& operator<<(std::ostream&, SelectParameters const& p); |
| 56 |
| 57 SelectParameters const& SelectParametersOf(const Operator* const); |
| 58 |
| 59 |
| 36 // Flag that describes how to combine the current environment with | 60 // Flag that describes how to combine the current environment with |
| 37 // the output of a node to obtain a framestate for lazy bailout. | 61 // the output of a node to obtain a framestate for lazy bailout. |
| 38 class OutputFrameStateCombine { | 62 class OutputFrameStateCombine { |
| 39 public: | 63 public: |
| 40 enum Kind { | 64 enum Kind { |
| 41 kPushOutput, // Push the output on the expression stack. | 65 kPushOutput, // Push the output on the expression stack. |
| 42 kPokeAt // Poke at the given environment location, | 66 kPokeAt // Poke at the given environment location, |
| 43 // counting from the top of the stack. | 67 // counting from the top of the stack. |
| 44 }; | 68 }; |
| 45 | 69 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 const Operator* Parameter(int index); | 174 const Operator* Parameter(int index); |
| 151 | 175 |
| 152 const Operator* Int32Constant(int32_t); | 176 const Operator* Int32Constant(int32_t); |
| 153 const Operator* Int64Constant(int64_t); | 177 const Operator* Int64Constant(int64_t); |
| 154 const Operator* Float32Constant(volatile float); | 178 const Operator* Float32Constant(volatile float); |
| 155 const Operator* Float64Constant(volatile double); | 179 const Operator* Float64Constant(volatile double); |
| 156 const Operator* ExternalConstant(const ExternalReference&); | 180 const Operator* ExternalConstant(const ExternalReference&); |
| 157 const Operator* NumberConstant(volatile double); | 181 const Operator* NumberConstant(volatile double); |
| 158 const Operator* HeapConstant(const Unique<HeapObject>&); | 182 const Operator* HeapConstant(const Unique<HeapObject>&); |
| 159 | 183 |
| 184 const Operator* Select(MachineType, BranchHint = BranchHint::kNone); |
| 160 const Operator* Phi(MachineType type, int arguments); | 185 const Operator* Phi(MachineType type, int arguments); |
| 161 const Operator* EffectPhi(int arguments); | 186 const Operator* EffectPhi(int arguments); |
| 162 const Operator* ValueEffect(int arguments); | 187 const Operator* ValueEffect(int arguments); |
| 163 const Operator* Finish(int arguments); | 188 const Operator* Finish(int arguments); |
| 164 const Operator* StateValues(int arguments); | 189 const Operator* StateValues(int arguments); |
| 165 const Operator* FrameState( | 190 const Operator* FrameState( |
| 166 FrameStateType type, BailoutId bailout_id, | 191 FrameStateType type, BailoutId bailout_id, |
| 167 OutputFrameStateCombine state_combine, | 192 OutputFrameStateCombine state_combine, |
| 168 MaybeHandle<JSFunction> jsfunction = MaybeHandle<JSFunction>()); | 193 MaybeHandle<JSFunction> jsfunction = MaybeHandle<JSFunction>()); |
| 169 const Operator* Call(const CallDescriptor* descriptor); | 194 const Operator* Call(const CallDescriptor* descriptor); |
| 170 const Operator* Projection(size_t index); | 195 const Operator* Projection(size_t index); |
| 171 | 196 |
| 172 private: | 197 private: |
| 173 Zone* zone() const { return zone_; } | 198 Zone* zone() const { return zone_; } |
| 174 | 199 |
| 175 const CommonOperatorBuilderImpl& impl_; | 200 const CommonOperatorBuilderImpl& impl_; |
| 176 Zone* const zone_; | 201 Zone* const zone_; |
| 177 | 202 |
| 178 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); | 203 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); |
| 179 }; | 204 }; |
| 180 | 205 |
| 181 } // namespace compiler | 206 } // namespace compiler |
| 182 } // namespace internal | 207 } // namespace internal |
| 183 } // namespace v8 | 208 } // namespace v8 |
| 184 | 209 |
| 185 #endif // V8_COMPILER_COMMON_OPERATOR_H_ | 210 #endif // V8_COMPILER_COMMON_OPERATOR_H_ |
| OLD | NEW |