| 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 #include "src/compiler/node.h" | 5 #include "src/compiler/node.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 } | 127 } |
| 128 return use->from; | 128 return use->from; |
| 129 } | 129 } |
| 130 | 130 |
| 131 | 131 |
| 132 void Node::ReplaceUses(Node* replace_to) { | 132 void Node::ReplaceUses(Node* replace_to) { |
| 133 for (Use* use = first_use_; use; use = use->next) { | 133 for (Use* use = first_use_; use; use = use->next) { |
| 134 use->from->GetInputRecordPtr(use->input_index)->to = replace_to; | 134 use->from->GetInputRecordPtr(use->input_index)->to = replace_to; |
| 135 } | 135 } |
| 136 if (!replace_to->last_use_) { | 136 if (!replace_to->last_use_) { |
| 137 DCHECK_EQ(nullptr, replace_to->first_use_); | 137 DCHECK(!replace_to->first_use_); |
| 138 replace_to->first_use_ = first_use_; | 138 replace_to->first_use_ = first_use_; |
| 139 replace_to->last_use_ = last_use_; | 139 replace_to->last_use_ = last_use_; |
| 140 } else if (first_use_) { | 140 } else if (first_use_) { |
| 141 DCHECK_NOT_NULL(replace_to->first_use_); | 141 DCHECK_NOT_NULL(replace_to->first_use_); |
| 142 replace_to->last_use_->next = first_use_; | 142 replace_to->last_use_->next = first_use_; |
| 143 first_use_->prev = replace_to->last_use_; | 143 first_use_->prev = replace_to->last_use_; |
| 144 replace_to->last_use_ = last_use_; | 144 replace_to->last_use_ = last_use_; |
| 145 } | 145 } |
| 146 first_use_ = nullptr; | 146 first_use_ = nullptr; |
| 147 last_use_ = nullptr; | 147 last_use_ = nullptr; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 ++(*this); | 267 ++(*this); |
| 268 return result; | 268 return result; |
| 269 } | 269 } |
| 270 | 270 |
| 271 | 271 |
| 272 bool Node::Uses::empty() const { return begin() == end(); } | 272 bool Node::Uses::empty() const { return begin() == end(); } |
| 273 | 273 |
| 274 } // namespace compiler | 274 } // namespace compiler |
| 275 } // namespace internal | 275 } // namespace internal |
| 276 } // namespace v8 | 276 } // namespace v8 |
| OLD | NEW |