| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |