| 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/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 controls) {} | 28 controls) {} |
| 29 | 29 |
| 30 virtual OStream& PrintParameter(OStream& os) const { return os; } // NOLINT | 30 virtual OStream& PrintParameter(OStream& os) const { return os; } // NOLINT |
| 31 int ControlInputCount() const { return parameter(); } | 31 int ControlInputCount() const { return parameter(); } |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 class CallOperator : public Operator1<CallDescriptor*> { | 34 class CallOperator : public Operator1<CallDescriptor*> { |
| 35 public: | 35 public: |
| 36 CallOperator(CallDescriptor* descriptor, const char* mnemonic) | 36 CallOperator(CallDescriptor* descriptor, const char* mnemonic) |
| 37 : Operator1<CallDescriptor*>( | 37 : Operator1<CallDescriptor*>( |
| 38 IrOpcode::kCall, descriptor->properties(), descriptor->InputCount(), | 38 IrOpcode::kCall, descriptor->properties(), |
| 39 descriptor->InputCount() + descriptor->FrameStateCount(), |
| 39 descriptor->ReturnCount(), mnemonic, descriptor) {} | 40 descriptor->ReturnCount(), mnemonic, descriptor) {} |
| 40 | 41 |
| 41 virtual OStream& PrintParameter(OStream& os) const { // NOLINT | 42 virtual OStream& PrintParameter(OStream& os) const { // NOLINT |
| 42 return os << "[" << *parameter() << "]"; | 43 return os << "[" << *parameter() << "]"; |
| 43 } | 44 } |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 // Interface for building common operators that can be used at any level of IR, | 47 // Interface for building common operators that can be used at any level of IR, |
| 47 // including JavaScript, mid-level, and low-level. | 48 // including JavaScript, mid-level, and low-level. |
| 48 // TODO(titzer): Move the mnemonics into SimpleOperator and Operator1 classes. | 49 // TODO(titzer): Move the mnemonics into SimpleOperator and Operator1 classes. |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 290 |
| 290 template <typename T> | 291 template <typename T> |
| 291 inline T ValueOf(Operator* op) { | 292 inline T ValueOf(Operator* op) { |
| 292 return CommonOperatorTraits<T>::ValueOf(op); | 293 return CommonOperatorTraits<T>::ValueOf(op); |
| 293 } | 294 } |
| 294 } | 295 } |
| 295 } | 296 } |
| 296 } // namespace v8::internal::compiler | 297 } // namespace v8::internal::compiler |
| 297 | 298 |
| 298 #endif // V8_COMPILER_COMMON_OPERATOR_H_ | 299 #endif // V8_COMPILER_COMMON_OPERATOR_H_ |
| OLD | NEW |