Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Side by Side Diff: src/compiler/node-matchers.h

Issue 1061303002: [turbofan] Match selects in control reducer (configurable). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/control-reducer.cc ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #ifndef V8_COMPILER_NODE_MATCHERS_H_ 5 #ifndef V8_COMPILER_NODE_MATCHERS_H_
6 #define V8_COMPILER_NODE_MATCHERS_H_ 6 #define V8_COMPILER_NODE_MATCHERS_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 9
10 // TODO(turbofan): Move ExternalReference out of assembler.h 10 // TODO(turbofan): Move ExternalReference out of assembler.h
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 bool Matched() const { return branch_; } 563 bool Matched() const { return branch_; }
564 bool IfProjectionsAreOwned() const { 564 bool IfProjectionsAreOwned() const {
565 return if_true_->OwnedBy(node()) && if_false_->OwnedBy(node()); 565 return if_true_->OwnedBy(node()) && if_false_->OwnedBy(node());
566 } 566 }
567 567
568 Node* Branch() const { return branch_; } 568 Node* Branch() const { return branch_; }
569 Node* IfTrue() const { return if_true_; } 569 Node* IfTrue() const { return if_true_; }
570 Node* IfFalse() const { return if_false_; } 570 Node* IfFalse() const { return if_false_; }
571 Node* Merge() const { return node(); } 571 Node* Merge() const { return node(); }
572 572
573 Node* TrueInputOf(Node* phi) const {
574 DCHECK(IrOpcode::IsPhiOpcode(phi->opcode()));
575 DCHECK_EQ(3, phi->InputCount());
576 DCHECK_EQ(Merge(), phi->InputAt(2));
577 return phi->InputAt(if_true_ == Merge()->InputAt(0) ? 0 : 1);
578 }
579
580 Node* FalseInputOf(Node* phi) const {
581 DCHECK(IrOpcode::IsPhiOpcode(phi->opcode()));
582 DCHECK_EQ(3, phi->InputCount());
583 DCHECK_EQ(Merge(), phi->InputAt(2));
584 return phi->InputAt(if_true_ == Merge()->InputAt(0) ? 1 : 0);
585 }
586
573 private: 587 private:
574 Node* branch_; 588 Node* branch_;
575 Node* if_true_; 589 Node* if_true_;
576 Node* if_false_; 590 Node* if_false_;
577 }; 591 };
578 592
579 } // namespace compiler 593 } // namespace compiler
580 } // namespace internal 594 } // namespace internal
581 } // namespace v8 595 } // namespace v8
582 596
583 #endif // V8_COMPILER_NODE_MATCHERS_H_ 597 #endif // V8_COMPILER_NODE_MATCHERS_H_
OLDNEW
« no previous file with comments | « src/compiler/control-reducer.cc ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698