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_OPERATOR_H_ | 5 #ifndef V8_COMPILER_OPERATOR_H_ |
6 #define V8_COMPILER_OPERATOR_H_ | 6 #define V8_COMPILER_OPERATOR_H_ |
7 | 7 |
8 #include <ostream> // NOLINT(readability/streams) | 8 #include <ostream> // NOLINT(readability/streams) |
9 | 9 |
10 #include "src/base/flags.h" | 10 #include "src/base/flags.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 // TODO(titzer): convert return values here to size_t. | 87 // TODO(titzer): convert return values here to size_t. |
88 int ValueInputCount() const { return value_in_; } | 88 int ValueInputCount() const { return value_in_; } |
89 int EffectInputCount() const { return effect_in_; } | 89 int EffectInputCount() const { return effect_in_; } |
90 int ControlInputCount() const { return control_in_; } | 90 int ControlInputCount() const { return control_in_; } |
91 | 91 |
92 int ValueOutputCount() const { return value_out_; } | 92 int ValueOutputCount() const { return value_out_; } |
93 int EffectOutputCount() const { return effect_out_; } | 93 int EffectOutputCount() const { return effect_out_; } |
94 int ControlOutputCount() const { return control_out_; } | 94 int ControlOutputCount() const { return control_out_; } |
95 | 95 |
96 static inline size_t ZeroIfPure(Properties properties) { | 96 static size_t ZeroIfPure(Properties properties) { |
97 return (properties & kPure) == kPure ? 0 : 1; | 97 return (properties & kPure) == kPure ? 0 : 1; |
98 } | 98 } |
99 | 99 |
100 // TODO(titzer): API for input and output types, for typechecking graph. | 100 // TODO(titzer): API for input and output types, for typechecking graph. |
101 protected: | 101 protected: |
102 // Print the full operator into the given stream, including any | 102 // Print the full operator into the given stream, including any |
103 // static parameters. Useful for debugging and visualizing the IR. | 103 // static parameters. Useful for debugging and visualizing the IR. |
104 virtual void PrintTo(std::ostream& os) const; | 104 virtual void PrintTo(std::ostream& os) const; |
105 friend std::ostream& operator<<(std::ostream& os, const Operator& op); | 105 friend std::ostream& operator<<(std::ostream& os, const Operator& op); |
106 | 106 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 return reinterpret_cast<const Operator1<double, base::bit_equal_to<double>, | 186 return reinterpret_cast<const Operator1<double, base::bit_equal_to<double>, |
187 base::bit_hash<double>>*>(op) | 187 base::bit_hash<double>>*>(op) |
188 ->parameter(); | 188 ->parameter(); |
189 } | 189 } |
190 | 190 |
191 } // namespace compiler | 191 } // namespace compiler |
192 } // namespace internal | 192 } // namespace internal |
193 } // namespace v8 | 193 } // namespace v8 |
194 | 194 |
195 #endif // V8_COMPILER_OPERATOR_H_ | 195 #endif // V8_COMPILER_OPERATOR_H_ |
OLD | NEW |