| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // Compute a hashcode to speed up equivalence-set checking. | 75 // Compute a hashcode to speed up equivalence-set checking. |
| 76 // Equal operators should always have equal hashcodes, and unequal operators | 76 // Equal operators should always have equal hashcodes, and unequal operators |
| 77 // should have unequal hashcodes with high probability. | 77 // should have unequal hashcodes with high probability. |
| 78 virtual size_t HashCode() const { return base::hash<Opcode>()(opcode()); } | 78 virtual size_t HashCode() const { return base::hash<Opcode>()(opcode()); } |
| 79 | 79 |
| 80 // Check whether this operator has the given property. | 80 // Check whether this operator has the given property. |
| 81 bool HasProperty(Property property) const { | 81 bool HasProperty(Property property) const { |
| 82 return (properties() & property) == property; | 82 return (properties() & property) == property; |
| 83 } | 83 } |
| 84 | 84 |
| 85 // Number of data inputs to the operator, for verifying graph structure. | |
| 86 // TODO(titzer): convert callers to ValueInputCount(); | |
| 87 int InputCount() const { return ValueInputCount(); } | |
| 88 | |
| 89 // Number of data outputs from the operator, for verifying graph structure. | |
| 90 // TODO(titzer): convert callers to ValueOutputCount(); | |
| 91 int OutputCount() const { return ValueOutputCount(); } | |
| 92 | |
| 93 Properties properties() const { return properties_; } | 85 Properties properties() const { return properties_; } |
| 94 | 86 |
| 95 // TODO(titzer): convert return values here to size_t. | 87 // TODO(titzer): convert return values here to size_t. |
| 96 int ValueInputCount() const { return value_in_; } | 88 int ValueInputCount() const { return value_in_; } |
| 97 int EffectInputCount() const { return effect_in_; } | 89 int EffectInputCount() const { return effect_in_; } |
| 98 int ControlInputCount() const { return control_in_; } | 90 int ControlInputCount() const { return control_in_; } |
| 99 | 91 |
| 100 int ValueOutputCount() const { return value_out_; } | 92 int ValueOutputCount() const { return value_out_; } |
| 101 int EffectOutputCount() const { return effect_out_; } | 93 int EffectOutputCount() const { return effect_out_; } |
| 102 int ControlOutputCount() const { return control_out_; } | 94 int ControlOutputCount() const { return control_out_; } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 template <typename T> | 170 template <typename T> |
| 179 inline T const& OpParameter(const Operator* op) { | 171 inline T const& OpParameter(const Operator* op) { |
| 180 return static_cast<const Operator1<T>*>(op)->parameter(); | 172 return static_cast<const Operator1<T>*>(op)->parameter(); |
| 181 } | 173 } |
| 182 | 174 |
| 183 } // namespace compiler | 175 } // namespace compiler |
| 184 } // namespace internal | 176 } // namespace internal |
| 185 } // namespace v8 | 177 } // namespace v8 |
| 186 | 178 |
| 187 #endif // V8_COMPILER_OPERATOR_H_ | 179 #endif // V8_COMPILER_OPERATOR_H_ |
| OLD | NEW |