| 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_NODE_PROPERTIES_INL_H_ | 5 #ifndef V8_COMPILER_NODE_PROPERTIES_INL_H_ |
| 6 #define V8_COMPILER_NODE_PROPERTIES_INL_H_ | 6 #define V8_COMPILER_NODE_PROPERTIES_INL_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 inline int NodeProperties::PastControlIndex(Node* node) { | 87 inline int NodeProperties::PastControlIndex(Node* node) { |
| 88 return FirstControlIndex(node) + GetControlInputCount(node); | 88 return FirstControlIndex(node) + GetControlInputCount(node); |
| 89 } | 89 } |
| 90 | 90 |
| 91 | 91 |
| 92 // ----------------------------------------------------------------------------- | 92 // ----------------------------------------------------------------------------- |
| 93 // Input accessors. | 93 // Input accessors. |
| 94 | 94 |
| 95 inline Node* NodeProperties::GetValueInput(Node* node, int index) { | 95 inline Node* NodeProperties::GetValueInput(Node* node, int index) { |
| 96 ASSERT(0 <= index && index < GetValueInputCount(node)); | 96 DCHECK(0 <= index && index < GetValueInputCount(node)); |
| 97 return node->InputAt(FirstValueIndex(node) + index); | 97 return node->InputAt(FirstValueIndex(node) + index); |
| 98 } | 98 } |
| 99 | 99 |
| 100 inline Node* NodeProperties::GetContextInput(Node* node) { | 100 inline Node* NodeProperties::GetContextInput(Node* node) { |
| 101 ASSERT(GetContextInputCount(node) > 0); | 101 DCHECK(GetContextInputCount(node) > 0); |
| 102 return node->InputAt(FirstContextIndex(node)); | 102 return node->InputAt(FirstContextIndex(node)); |
| 103 } | 103 } |
| 104 | 104 |
| 105 inline Node* NodeProperties::GetEffectInput(Node* node, int index) { | 105 inline Node* NodeProperties::GetEffectInput(Node* node, int index) { |
| 106 ASSERT(0 <= index && index < GetEffectInputCount(node)); | 106 DCHECK(0 <= index && index < GetEffectInputCount(node)); |
| 107 return node->InputAt(FirstEffectIndex(node) + index); | 107 return node->InputAt(FirstEffectIndex(node) + index); |
| 108 } | 108 } |
| 109 | 109 |
| 110 inline Node* NodeProperties::GetControlInput(Node* node, int index) { | 110 inline Node* NodeProperties::GetControlInput(Node* node, int index) { |
| 111 ASSERT(0 <= index && index < GetControlInputCount(node)); | 111 DCHECK(0 <= index && index < GetControlInputCount(node)); |
| 112 return node->InputAt(FirstControlIndex(node) + index); | 112 return node->InputAt(FirstControlIndex(node) + index); |
| 113 } | 113 } |
| 114 | 114 |
| 115 | 115 |
| 116 // ----------------------------------------------------------------------------- | 116 // ----------------------------------------------------------------------------- |
| 117 // Output counts. | 117 // Output counts. |
| 118 | 118 |
| 119 inline bool NodeProperties::HasValueOutput(Node* node) { | 119 inline bool NodeProperties::HasValueOutput(Node* node) { |
| 120 return GetValueOutputCount(node) > 0; | 120 return GetValueOutputCount(node) > 0; |
| 121 } | 121 } |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 inline bool NodeProperties::IsScheduleRoot(Node* node) { | 201 inline bool NodeProperties::IsScheduleRoot(Node* node) { |
| 202 return OperatorProperties::IsScheduleRoot(node->op()); | 202 return OperatorProperties::IsScheduleRoot(node->op()); |
| 203 } | 203 } |
| 204 | 204 |
| 205 | 205 |
| 206 // ----------------------------------------------------------------------------- | 206 // ----------------------------------------------------------------------------- |
| 207 // Miscellaneous mutators. | 207 // Miscellaneous mutators. |
| 208 | 208 |
| 209 inline void NodeProperties::ReplaceEffectInput(Node* node, Node* effect, | 209 inline void NodeProperties::ReplaceEffectInput(Node* node, Node* effect, |
| 210 int index) { | 210 int index) { |
| 211 ASSERT(index < GetEffectInputCount(node)); | 211 DCHECK(index < GetEffectInputCount(node)); |
| 212 return node->ReplaceInput( | 212 return node->ReplaceInput( |
| 213 GetValueInputCount(node) + GetContextInputCount(node) + index, effect); | 213 GetValueInputCount(node) + GetContextInputCount(node) + index, effect); |
| 214 } | 214 } |
| 215 | 215 |
| 216 inline void NodeProperties::RemoveNonValueInputs(Node* node) { | 216 inline void NodeProperties::RemoveNonValueInputs(Node* node) { |
| 217 node->TrimInputCount(GetValueInputCount(node)); | 217 node->TrimInputCount(GetValueInputCount(node)); |
| 218 } | 218 } |
| 219 | 219 |
| 220 | 220 |
| 221 // ----------------------------------------------------------------------------- | 221 // ----------------------------------------------------------------------------- |
| 222 // Type Bounds. | 222 // Type Bounds. |
| 223 | 223 |
| 224 inline Bounds NodeProperties::GetBounds(Node* node) { return node->bounds(); } | 224 inline Bounds NodeProperties::GetBounds(Node* node) { return node->bounds(); } |
| 225 | 225 |
| 226 inline void NodeProperties::SetBounds(Node* node, Bounds b) { | 226 inline void NodeProperties::SetBounds(Node* node, Bounds b) { |
| 227 node->set_bounds(b); | 227 node->set_bounds(b); |
| 228 } | 228 } |
| 229 | 229 |
| 230 | 230 |
| 231 inline bool NodeProperties::CanLazilyDeoptimize(Node* node) { | 231 inline bool NodeProperties::CanLazilyDeoptimize(Node* node) { |
| 232 return OperatorProperties::CanLazilyDeoptimize(node->op()); | 232 return OperatorProperties::CanLazilyDeoptimize(node->op()); |
| 233 } | 233 } |
| 234 } | 234 } |
| 235 } | 235 } |
| 236 } // namespace v8::internal::compiler | 236 } // namespace v8::internal::compiler |
| 237 | 237 |
| 238 #endif // V8_COMPILER_NODE_PROPERTIES_INL_H_ | 238 #endif // V8_COMPILER_NODE_PROPERTIES_INL_H_ |
| OLD | NEW |