Index: src/compiler/node.cc |
diff --git a/src/compiler/node.cc b/src/compiler/node.cc |
index 1a9c326f20be0f37fd5aa36ba049f5bf8133cc51..724c9f173ec55bff234a8de7db7eddcfd06b7c75 100644 |
--- a/src/compiler/node.cc |
+++ b/src/compiler/node.cc |
@@ -138,6 +138,21 @@ void Node::ReplaceUses(Node* that) { |
} |
+bool Node::OwnedBy(Node const* owner1, Node const* owner2) const { |
+ unsigned mask = 0; |
+ for (Use* use = first_use_; use; use = use->next) { |
+ if (use->from == owner1) { |
+ mask |= 1; |
+ } else if (use->from == owner2) { |
+ mask |= 2; |
+ } else { |
+ return false; |
+ } |
+ } |
+ return mask == 3; |
+} |
+ |
+ |
void Node::Input::Update(Node* new_to) { |
Node* old_to = this->to; |
if (new_to == old_to) return; // Nothing to do. |