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 "src/base/flags.h" | 8 #include "src/base/flags.h" |
9 #include "src/ostreams.h" | 9 #include "src/ostreams.h" |
10 #include "src/unique.h" | 10 #include "src/unique.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 | 262 |
263 private: | 263 private: |
264 int input_count_; | 264 int input_count_; |
265 int output_count_; | 265 int output_count_; |
266 T parameter_; | 266 T parameter_; |
267 }; | 267 }; |
268 | 268 |
269 // Type definitions for operators with specific types of parameters. | 269 // Type definitions for operators with specific types of parameters. |
270 typedef Operator1<PrintableUnique<Name> > NameOperator; | 270 typedef Operator1<PrintableUnique<Name> > NameOperator; |
271 | 271 |
| 272 |
| 273 // Helper to extract parameters from Operator1<*> operator. |
| 274 template <typename T> |
| 275 static inline T OpParameter(const Operator* op) { |
| 276 return reinterpret_cast<const Operator1<T>*>(op)->parameter(); |
| 277 } |
| 278 |
272 } // namespace compiler | 279 } // namespace compiler |
273 } // namespace internal | 280 } // namespace internal |
274 } // namespace v8 | 281 } // namespace v8 |
275 | 282 |
276 #endif // V8_COMPILER_OPERATOR_H_ | 283 #endif // V8_COMPILER_OPERATOR_H_ |
OLD | NEW |