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(opcode, properties, inputs, outputs, mnemonic, controls) {} | 27 : Operator1(static_cast<uint8_t>(opcode), properties, inputs, outputs, |
| 28 mnemonic, controls) {} |
28 | 29 |
29 virtual OStream& PrintParameter(OStream& os) const { return os; } // NOLINT | 30 virtual OStream& PrintParameter(OStream& os) const { return os; } // NOLINT |
30 int ControlInputCount() const { return parameter(); } | 31 int ControlInputCount() const { return parameter(); } |
31 }; | 32 }; |
32 | 33 |
33 class CallOperator : public Operator1<CallDescriptor*> { | 34 class CallOperator : public Operator1<CallDescriptor*> { |
34 public: | 35 public: |
35 CallOperator(CallDescriptor* descriptor, const char* mnemonic) | 36 CallOperator(CallDescriptor* descriptor, const char* mnemonic) |
36 : Operator1(IrOpcode::kCall, descriptor->properties(), | 37 : Operator1(static_cast<uint8_t>(IrOpcode::kCall), |
37 descriptor->InputCount(), descriptor->ReturnCount(), mnemonic, | 38 descriptor->properties(), descriptor->InputCount(), |
38 descriptor) {} | 39 descriptor->ReturnCount(), mnemonic, descriptor) {} |
39 | 40 |
40 virtual OStream& PrintParameter(OStream& os) const { // NOLINT | 41 virtual OStream& PrintParameter(OStream& os) const { // NOLINT |
41 return os << "[" << *parameter() << "]"; | 42 return os << "[" << *parameter() << "]"; |
42 } | 43 } |
43 }; | 44 }; |
44 | 45 |
45 class FrameStateDescriptor { | 46 class FrameStateDescriptor { |
46 public: | 47 public: |
47 explicit FrameStateDescriptor(BailoutId bailout_id) | 48 explicit FrameStateDescriptor(BailoutId bailout_id) |
48 : bailout_id_(bailout_id) {} | 49 : bailout_id_(bailout_id) {} |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 | 277 |
277 template <typename T> | 278 template <typename T> |
278 inline T ValueOf(Operator* op) { | 279 inline T ValueOf(Operator* op) { |
279 return CommonOperatorTraits<T>::ValueOf(op); | 280 return CommonOperatorTraits<T>::ValueOf(op); |
280 } | 281 } |
281 } | 282 } |
282 } | 283 } |
283 } // namespace v8::internal::compiler | 284 } // namespace v8::internal::compiler |
284 | 285 |
285 #endif // V8_COMPILER_COMMON_OPERATOR_H_ | 286 #endif // V8_COMPILER_COMMON_OPERATOR_H_ |
OLD | NEW |