Chromium Code Reviews| 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 from->opcode() != IrOpcode::kStore && | |
|
danno
2017/02/21 16:11:01
Careful here, don't you have to make sure that the
shiyu.zhang
2017/02/23 01:20:48
OwnedByAddressingOperand is only used by left oper
danno
2017/02/23 08:49:34
Well, this builds in a pretty explicit and fragile
| |
| 304 from->opcode() != IrOpcode::kInt32Add && | |
| 305 from->opcode() != IrOpcode::kInt64Add) { | |
| 306 return false; | |
| 307 } | |
| 308 } | |
| 309 return true; | |
| 310 } | |
| 299 | 311 |
| 300 void Node::Print() const { | 312 void Node::Print() const { |
| 301 OFStream os(stdout); | 313 OFStream os(stdout); |
| 302 os << *this << std::endl; | 314 os << *this << std::endl; |
| 303 for (Node* input : this->inputs()) { | 315 for (Node* input : this->inputs()) { |
| 304 os << " " << *input << std::endl; | 316 os << " " << *input << std::endl; |
| 305 } | 317 } |
| 306 } | 318 } |
| 307 | 319 |
| 308 std::ostream& operator<<(std::ostream& os, const Node& n) { | 320 std::ostream& operator<<(std::ostream& os, const Node& n) { |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 426 ++(*this); | 438 ++(*this); |
| 427 return result; | 439 return result; |
| 428 } | 440 } |
| 429 | 441 |
| 430 | 442 |
| 431 bool Node::Uses::empty() const { return begin() == end(); } | 443 bool Node::Uses::empty() const { return begin() == end(); } |
| 432 | 444 |
| 433 } // namespace compiler | 445 } // namespace compiler |
| 434 } // namespace internal | 446 } // namespace internal |
| 435 } // namespace v8 | 447 } // namespace v8 |
| OLD | NEW |