OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #include "src/compiler/node-properties.h" | 5 #include "src/compiler/node-properties.h" |
6 | 6 |
7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/operator-properties.h" | 8 #include "src/compiler/operator-properties.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 // static | 153 // static |
154 void NodeProperties::ReplaceWithValue(Node* node, Node* value, Node* effect) { | 154 void NodeProperties::ReplaceWithValue(Node* node, Node* value, Node* effect) { |
155 DCHECK(node->op()->ControlOutputCount() == 0); | 155 DCHECK(node->op()->ControlOutputCount() == 0); |
156 if (!effect && node->op()->EffectInputCount() > 0) { | 156 if (!effect && node->op()->EffectInputCount() > 0) { |
157 effect = NodeProperties::GetEffectInput(node); | 157 effect = NodeProperties::GetEffectInput(node); |
158 } | 158 } |
159 | 159 |
160 // Requires distinguishing between value and effect edges. | 160 // Requires distinguishing between value and effect edges. |
161 for (Edge edge : node->use_edges()) { | 161 for (Edge edge : node->use_edges()) { |
162 if (IsEffectEdge(edge)) { | 162 if (IsEffectEdge(edge)) { |
163 DCHECK_NOT_NULL(effect); | 163 DCHECK(effect); |
164 edge.UpdateTo(effect); | 164 edge.UpdateTo(effect); |
165 } else { | 165 } else { |
166 edge.UpdateTo(value); | 166 edge.UpdateTo(value); |
167 } | 167 } |
168 } | 168 } |
169 } | 169 } |
170 | 170 |
171 | 171 |
172 // static | 172 // static |
173 Node* NodeProperties::FindProjection(Node* node, size_t projection_index) { | 173 Node* NodeProperties::FindProjection(Node* node, size_t projection_index) { |
(...skipping 20 matching lines...) Expand all Loading... |
194 // static | 194 // static |
195 bool NodeProperties::IsInputRange(Edge edge, int first, int num) { | 195 bool NodeProperties::IsInputRange(Edge edge, int first, int num) { |
196 if (num == 0) return false; | 196 if (num == 0) return false; |
197 int const index = edge.index(); | 197 int const index = edge.index(); |
198 return first <= index && index < first + num; | 198 return first <= index && index < first + num; |
199 } | 199 } |
200 | 200 |
201 } // namespace compiler | 201 } // namespace compiler |
202 } // namespace internal | 202 } // namespace internal |
203 } // namespace v8 | 203 } // namespace v8 |
OLD | NEW |