| 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" |
| 11 #include "src/compiler/linkage.h" | 11 #include "src/compiler/linkage.h" |
| 12 #include "src/compiler/opcodes.h" | 12 #include "src/compiler/opcodes.h" |
| 13 #include "src/compiler/operator.h" | 13 #include "src/compiler/operator.h" |
| 14 #include "src/unique.h" | 14 #include "src/unique.h" |
| 15 | 15 |
| 16 namespace v8 { | 16 namespace v8 { |
| 17 namespace internal { | 17 namespace internal { |
| 18 | 18 |
| 19 class OStream; | 19 class OStream; |
| 20 | 20 |
| 21 namespace compiler { | 21 namespace compiler { |
| 22 | 22 |
| 23 class ControlOperator : public Operator1<int> { | 23 class ControlOperator : public Operator1<int> { |
| 24 public: | 24 public: |
| 25 ControlOperator(IrOpcode::Value opcode, uint16_t properties, int inputs, | 25 ControlOperator(IrOpcode::Value opcode, uint16_t properties, int inputs, |
| 26 int outputs, int controls, const char* mnemonic) | 26 int outputs, int controls, const char* mnemonic) |
| 27 : Operator1(static_cast<uint8_t>(opcode), properties, inputs, outputs, | 27 : Operator1<int>(static_cast<uint8_t>(opcode), properties, inputs, |
| 28 mnemonic, controls) {} | 28 outputs, mnemonic, 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(static_cast<uint8_t>(IrOpcode::kCall), | 37 : Operator1<CallDescriptor*>( |
| 38 descriptor->properties(), descriptor->InputCount(), | 38 static_cast<uint8_t>(IrOpcode::kCall), descriptor->properties(), |
| 39 descriptor->ReturnCount(), mnemonic, descriptor) {} | 39 descriptor->InputCount(), descriptor->ReturnCount(), mnemonic, |
| 40 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 class FrameStateDescriptor { | 47 class FrameStateDescriptor { |
| 47 public: | 48 public: |
| 48 explicit FrameStateDescriptor(BailoutId bailout_id) | 49 explicit FrameStateDescriptor(BailoutId bailout_id) |
| 49 : bailout_id_(bailout_id) {} | 50 : bailout_id_(bailout_id) {} |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 278 |
| 278 template <typename T> | 279 template <typename T> |
| 279 inline T ValueOf(Operator* op) { | 280 inline T ValueOf(Operator* op) { |
| 280 return CommonOperatorTraits<T>::ValueOf(op); | 281 return CommonOperatorTraits<T>::ValueOf(op); |
| 281 } | 282 } |
| 282 } | 283 } |
| 283 } | 284 } |
| 284 } // namespace v8::internal::compiler | 285 } // namespace v8::internal::compiler |
| 285 | 286 |
| 286 #endif // V8_COMPILER_COMMON_OPERATOR_H_ | 287 #endif // V8_COMPILER_COMMON_OPERATOR_H_ |
| OLD | NEW |