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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 // TODO(titzer): convert return values here to size_t. | 91 // TODO(titzer): convert return values here to size_t. |
92 int ValueInputCount() const { return value_in_; } | 92 int ValueInputCount() const { return value_in_; } |
93 int EffectInputCount() const { return effect_in_; } | 93 int EffectInputCount() const { return effect_in_; } |
94 int ControlInputCount() const { return control_in_; } | 94 int ControlInputCount() const { return control_in_; } |
95 | 95 |
96 int ValueOutputCount() const { return value_out_; } | 96 int ValueOutputCount() const { return value_out_; } |
97 int EffectOutputCount() const { return effect_out_; } | 97 int EffectOutputCount() const { return effect_out_; } |
98 int ControlOutputCount() const { return control_out_; } | 98 int ControlOutputCount() const { return control_out_; } |
99 | 99 |
| 100 static size_t ZeroIfEliminatable(Properties properties) { |
| 101 return (properties & kEliminatable) == kEliminatable ? 0 : 1; |
| 102 } |
| 103 |
100 static size_t ZeroIfNoThrow(Properties properties) { | 104 static size_t ZeroIfNoThrow(Properties properties) { |
101 return (properties & kNoThrow) == kNoThrow ? 0 : 2; | 105 return (properties & kNoThrow) == kNoThrow ? 0 : 2; |
102 } | 106 } |
103 | 107 |
104 static size_t ZeroIfPure(Properties properties) { | 108 static size_t ZeroIfPure(Properties properties) { |
105 return (properties & kPure) == kPure ? 0 : 1; | 109 return (properties & kPure) == kPure ? 0 : 1; |
106 } | 110 } |
107 | 111 |
108 // TODO(titzer): API for input and output types, for typechecking graph. | 112 // TODO(titzer): API for input and output types, for typechecking graph. |
109 protected: | 113 protected: |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 return reinterpret_cast<const Operator1<double, base::bit_equal_to<double>, | 198 return reinterpret_cast<const Operator1<double, base::bit_equal_to<double>, |
195 base::bit_hash<double>>*>(op) | 199 base::bit_hash<double>>*>(op) |
196 ->parameter(); | 200 ->parameter(); |
197 } | 201 } |
198 | 202 |
199 } // namespace compiler | 203 } // namespace compiler |
200 } // namespace internal | 204 } // namespace internal |
201 } // namespace v8 | 205 } // namespace v8 |
202 | 206 |
203 #endif // V8_COMPILER_OPERATOR_H_ | 207 #endif // V8_COMPILER_OPERATOR_H_ |
OLD | NEW |