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

Side by Side Diff: src/compiler/mips/instruction-selector-mips.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/mips/code-generator-mips.cc ('k') | src/compiler/mips64/code-generator-mips64.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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 } else { 627 } else {
628 selector->Emit(opcode, g.DefineAsRegister(cont->result()), value_operand, 628 selector->Emit(opcode, g.DefineAsRegister(cont->result()), value_operand,
629 g.TempImmediate(0)); 629 g.TempImmediate(0));
630 } 630 }
631 } 631 }
632 632
633 633
634 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, 634 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch,
635 BasicBlock* fbranch) { 635 BasicBlock* fbranch) {
636 FlagsContinuation cont(kNotEqual, tbranch, fbranch); 636 FlagsContinuation cont(kNotEqual, tbranch, fbranch);
637 // If we can fall through to the true block, invert the branch.
638 if (IsNextInAssemblyOrder(tbranch)) {
639 cont.Negate();
640 cont.SwapBlocks();
641 }
642 VisitWordCompareZero(this, branch, branch->InputAt(0), &cont); 637 VisitWordCompareZero(this, branch, branch->InputAt(0), &cont);
643 } 638 }
644 639
645 640
646 void InstructionSelector::VisitWord32Equal(Node* const node) { 641 void InstructionSelector::VisitWord32Equal(Node* const node) {
647 FlagsContinuation cont(kEqual, node); 642 FlagsContinuation cont(kEqual, node);
648 Int32BinopMatcher m(node); 643 Int32BinopMatcher m(node);
649 if (m.right().Is(0)) { 644 if (m.right().Is(0)) {
650 return VisitWordCompareZero(this, m.node(), m.left().node(), &cont); 645 return VisitWordCompareZero(this, m.node(), m.left().node(), &cont);
651 } 646 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 712
718 // static 713 // static
719 MachineOperatorBuilder::Flags 714 MachineOperatorBuilder::Flags
720 InstructionSelector::SupportedMachineOperatorFlags() { 715 InstructionSelector::SupportedMachineOperatorFlags() {
721 return MachineOperatorBuilder::kNoFlags; 716 return MachineOperatorBuilder::kNoFlags;
722 } 717 }
723 718
724 } // namespace compiler 719 } // namespace compiler
725 } // namespace internal 720 } // namespace internal
726 } // namespace v8 721 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips/code-generator-mips.cc ('k') | src/compiler/mips64/code-generator-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698