| 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 namespace v8 { | 7 namespace v8 { |
| 8 namespace internal { | 8 namespace internal { |
| 9 namespace compiler { | 9 namespace compiler { |
| 10 | 10 |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 mask |= 1; | 289 mask |= 1; |
| 290 } else if (from == owner2) { | 290 } else if (from == owner2) { |
| 291 mask |= 2; | 291 mask |= 2; |
| 292 } else { | 292 } else { |
| 293 return false; | 293 return false; |
| 294 } | 294 } |
| 295 } | 295 } |
| 296 return mask == 3; | 296 return mask == 3; |
| 297 } | 297 } |
| 298 | 298 |
| 299 bool Node::OwnedByAddressingOperand() const { |
| 300 for (Use* use = first_use_; use; use = use->next) { |
| 301 Node* from = use->from(); |
| 302 if (from->opcode() != IrOpcode::kLoad && |
| 303 // If {from} is store, make sure it does not use {this} as value |
| 304 (from->opcode() != IrOpcode::kStore || from->InputAt(2) == this) && |
| 305 from->opcode() != IrOpcode::kInt32Add && |
| 306 from->opcode() != IrOpcode::kInt64Add) { |
| 307 return false; |
| 308 } |
| 309 } |
| 310 return true; |
| 311 } |
| 299 | 312 |
| 300 void Node::Print() const { | 313 void Node::Print() const { |
| 301 OFStream os(stdout); | 314 OFStream os(stdout); |
| 302 os << *this << std::endl; | 315 os << *this << std::endl; |
| 303 for (Node* input : this->inputs()) { | 316 for (Node* input : this->inputs()) { |
| 304 os << " " << *input << std::endl; | 317 os << " " << *input << std::endl; |
| 305 } | 318 } |
| 306 } | 319 } |
| 307 | 320 |
| 308 std::ostream& operator<<(std::ostream& os, const Node& n) { | 321 std::ostream& operator<<(std::ostream& os, const Node& n) { |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 ++(*this); | 439 ++(*this); |
| 427 return result; | 440 return result; |
| 428 } | 441 } |
| 429 | 442 |
| 430 | 443 |
| 431 bool Node::Uses::empty() const { return begin() == end(); } | 444 bool Node::Uses::empty() const { return begin() == end(); } |
| 432 | 445 |
| 433 } // namespace compiler | 446 } // namespace compiler |
| 434 } // namespace internal | 447 } // namespace internal |
| 435 } // namespace v8 | 448 } // namespace v8 |
| OLD | NEW |