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_PROPERTIES_INL_H_ | 5 #ifndef V8_COMPILER_OPERATOR_PROPERTIES_INL_H_ |
6 #define V8_COMPILER_OPERATOR_PROPERTIES_INL_H_ | 6 #define V8_COMPILER_OPERATOR_PROPERTIES_INL_H_ |
7 | 7 |
8 #include "src/compiler/common-operator.h" | 8 #include "src/compiler/common-operator.h" |
9 #include "src/compiler/js-operator.h" | 9 #include "src/compiler/js-operator.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 inline int OperatorProperties::GetContextInputCount(const Operator* op) { | 97 inline int OperatorProperties::GetContextInputCount(const Operator* op) { |
98 return OperatorProperties::HasContextInput(op) ? 1 : 0; | 98 return OperatorProperties::HasContextInput(op) ? 1 : 0; |
99 } | 99 } |
100 | 100 |
101 inline int OperatorProperties::GetFrameStateInputCount(const Operator* op) { | 101 inline int OperatorProperties::GetFrameStateInputCount(const Operator* op) { |
102 return OperatorProperties::HasFrameStateInput(op) ? 1 : 0; | 102 return OperatorProperties::HasFrameStateInput(op) ? 1 : 0; |
103 } | 103 } |
104 | 104 |
105 inline int OperatorProperties::GetEffectInputCount(const Operator* op) { | 105 inline int OperatorProperties::GetEffectInputCount(const Operator* op) { |
106 if (op->opcode() == IrOpcode::kEffectPhi || | 106 if (op->opcode() == IrOpcode::kEffectPhi || |
107 op->opcode() == IrOpcode::kFinish) { | 107 op->opcode() == IrOpcode::kFinish || |
| 108 op->opcode() == IrOpcode::kTerminate) { |
108 return OpParameter<int>(op); | 109 return OpParameter<int>(op); |
109 } | 110 } |
110 if (op->HasProperty(Operator::kNoRead) && op->HasProperty(Operator::kNoWrite)) | 111 if (op->HasProperty(Operator::kNoRead) && op->HasProperty(Operator::kNoWrite)) |
111 return 0; // no effects. | 112 return 0; // no effects. |
112 return 1; | 113 return 1; |
113 } | 114 } |
114 | 115 |
115 inline int OperatorProperties::GetControlInputCount(const Operator* op) { | 116 inline int OperatorProperties::GetControlInputCount(const Operator* op) { |
116 switch (op->opcode()) { | 117 switch (op->opcode()) { |
117 case IrOpcode::kPhi: | 118 case IrOpcode::kPhi: |
(...skipping 29 matching lines...) Expand all Loading... |
147 // ----------------------------------------------------------------------------- | 148 // ----------------------------------------------------------------------------- |
148 // Output properties. | 149 // Output properties. |
149 | 150 |
150 inline bool OperatorProperties::HasValueOutput(const Operator* op) { | 151 inline bool OperatorProperties::HasValueOutput(const Operator* op) { |
151 return GetValueOutputCount(op) > 0; | 152 return GetValueOutputCount(op) > 0; |
152 } | 153 } |
153 | 154 |
154 inline bool OperatorProperties::HasEffectOutput(const Operator* op) { | 155 inline bool OperatorProperties::HasEffectOutput(const Operator* op) { |
155 return op->opcode() == IrOpcode::kStart || | 156 return op->opcode() == IrOpcode::kStart || |
156 op->opcode() == IrOpcode::kValueEffect || | 157 op->opcode() == IrOpcode::kValueEffect || |
157 (op->opcode() != IrOpcode::kFinish && GetEffectInputCount(op) > 0); | 158 (op->opcode() != IrOpcode::kFinish && |
| 159 op->opcode() != IrOpcode::kTerminate && GetEffectInputCount(op) > 0); |
158 } | 160 } |
159 | 161 |
160 inline bool OperatorProperties::HasControlOutput(const Operator* op) { | 162 inline bool OperatorProperties::HasControlOutput(const Operator* op) { |
161 IrOpcode::Value opcode = static_cast<IrOpcode::Value>(op->opcode()); | 163 IrOpcode::Value opcode = static_cast<IrOpcode::Value>(op->opcode()); |
162 return (opcode != IrOpcode::kEnd && IrOpcode::IsControlOpcode(opcode)); | 164 return (opcode != IrOpcode::kEnd && IrOpcode::IsControlOpcode(opcode)); |
163 } | 165 } |
164 | 166 |
165 | 167 |
166 inline int OperatorProperties::GetValueOutputCount(const Operator* op) { | 168 inline int OperatorProperties::GetValueOutputCount(const Operator* op) { |
167 return op->OutputCount(); | 169 return op->OutputCount(); |
(...skipping 15 matching lines...) Expand all Loading... |
183 opcode == IrOpcode::kDead || opcode == IrOpcode::kLoop || | 185 opcode == IrOpcode::kDead || opcode == IrOpcode::kLoop || |
184 opcode == IrOpcode::kMerge || opcode == IrOpcode::kIfTrue || | 186 opcode == IrOpcode::kMerge || opcode == IrOpcode::kIfTrue || |
185 opcode == IrOpcode::kIfFalse; | 187 opcode == IrOpcode::kIfFalse; |
186 } | 188 } |
187 | 189 |
188 } // namespace compiler | 190 } // namespace compiler |
189 } // namespace internal | 191 } // namespace internal |
190 } // namespace v8 | 192 } // namespace v8 |
191 | 193 |
192 #endif // V8_COMPILER_OPERATOR_PROPERTIES_INL_H_ | 194 #endif // V8_COMPILER_OPERATOR_PROPERTIES_INL_H_ |
OLD | NEW |