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

Side by Side Diff: src/compiler/mips64/instruction-selector-mips64.cc

Issue 745633002: [turbofan] Clean up and factor out branch generation logic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix IA32 fall through. Created 6 years, 1 month 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/mips64/code-generator-mips64.cc ('k') | src/compiler/x64/code-generator-x64.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 #include "src/base/bits.h" 5 #include "src/base/bits.h"
6 #include "src/compiler/instruction-selector-impl.h" 6 #include "src/compiler/instruction-selector-impl.h"
7 #include "src/compiler/node-matchers.h" 7 #include "src/compiler/node-matchers.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 } 864 }
865 865
866 // Continuation could not be combined with a compare, emit compare against 0. 866 // Continuation could not be combined with a compare, emit compare against 0.
867 EmitWordCompareZero(selector, opcode, value, cont); 867 EmitWordCompareZero(selector, opcode, value, cont);
868 } 868 }
869 869
870 870
871 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, 871 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch,
872 BasicBlock* fbranch) { 872 BasicBlock* fbranch) {
873 FlagsContinuation cont(kNotEqual, tbranch, fbranch); 873 FlagsContinuation cont(kNotEqual, tbranch, fbranch);
874 // If we can fall through to the true block, invert the branch.
875 if (IsNextInAssemblyOrder(tbranch)) {
876 cont.Negate();
877 cont.SwapBlocks();
878 }
879
880 VisitWordCompareZero(this, branch, branch->InputAt(0), &cont); 874 VisitWordCompareZero(this, branch, branch->InputAt(0), &cont);
881 } 875 }
882 876
883 877
884 void InstructionSelector::VisitWord32Equal(Node* const node) { 878 void InstructionSelector::VisitWord32Equal(Node* const node) {
885 FlagsContinuation cont(kEqual, node); 879 FlagsContinuation cont(kEqual, node);
886 Int32BinopMatcher m(node); 880 Int32BinopMatcher m(node);
887 if (m.right().Is(0)) { 881 if (m.right().Is(0)) {
888 return VisitWordCompareZero(this, m.node(), m.left().node(), &cont); 882 return VisitWordCompareZero(this, m.node(), m.left().node(), &cont);
889 } 883 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 979
986 // static 980 // static
987 MachineOperatorBuilder::Flags 981 MachineOperatorBuilder::Flags
988 InstructionSelector::SupportedMachineOperatorFlags() { 982 InstructionSelector::SupportedMachineOperatorFlags() {
989 return MachineOperatorBuilder::kNoFlags; 983 return MachineOperatorBuilder::kNoFlags;
990 } 984 }
991 985
992 } // namespace compiler 986 } // namespace compiler
993 } // namespace internal 987 } // namespace internal
994 } // namespace v8 988 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips64/code-generator-mips64.cc ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698