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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/arm/macro-assembler-arm.h" | 7 #include "src/arm/macro-assembler-arm.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 } | 680 } |
681 | 681 |
682 | 682 |
683 // Assembles branches after an instruction. | 683 // Assembles branches after an instruction. |
684 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { | 684 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { |
685 ArmOperandConverter i(this, instr); | 685 ArmOperandConverter i(this, instr); |
686 Label* tlabel = branch->true_label; | 686 Label* tlabel = branch->true_label; |
687 Label* flabel = branch->false_label; | 687 Label* flabel = branch->false_label; |
688 switch (branch->condition) { | 688 switch (branch->condition) { |
689 case kUnorderedEqual: | 689 case kUnorderedEqual: |
690 __ b(vs, flabel); | 690 // The "eq" condition will not catch the unordered case. |
691 // Fall through. | 691 // The jump/fall through to false label will be used if the comparison |
| 692 // was unordered. |
692 case kEqual: | 693 case kEqual: |
693 __ b(eq, tlabel); | 694 __ b(eq, tlabel); |
694 break; | 695 break; |
695 case kUnorderedNotEqual: | 696 case kUnorderedNotEqual: |
696 // Unordered or not equal can be tested with "ne" condtion. | 697 // Unordered or not equal can be tested with "ne" condtion. |
697 // See ARMv7 manual A8.3 - Conditional execution. | 698 // See ARMv7 manual A8.3 - Conditional execution. |
698 case kNotEqual: | 699 case kNotEqual: |
699 __ b(ne, tlabel); | 700 __ b(ne, tlabel); |
700 break; | 701 break; |
701 case kSignedLessThan: | 702 case kSignedLessThan: |
702 __ b(lt, tlabel); | 703 __ b(lt, tlabel); |
703 break; | 704 break; |
704 case kSignedGreaterThanOrEqual: | 705 case kSignedGreaterThanOrEqual: |
705 __ b(ge, tlabel); | 706 __ b(ge, tlabel); |
706 break; | 707 break; |
707 case kSignedLessThanOrEqual: | 708 case kSignedLessThanOrEqual: |
708 __ b(le, tlabel); | 709 __ b(le, tlabel); |
709 break; | 710 break; |
710 case kSignedGreaterThan: | 711 case kSignedGreaterThan: |
711 __ b(gt, tlabel); | 712 __ b(gt, tlabel); |
712 break; | 713 break; |
713 case kUnorderedLessThan: | 714 case kUnorderedLessThan: |
714 __ b(vs, flabel); | 715 // The "lo" condition will not catch the unordered case. |
715 // Fall through. | 716 // The jump/fall through to false label will be used if the comparison |
| 717 // was unordered. |
716 case kUnsignedLessThan: | 718 case kUnsignedLessThan: |
717 __ b(lo, tlabel); | 719 __ b(lo, tlabel); |
718 break; | 720 break; |
719 case kUnorderedGreaterThanOrEqual: | 721 case kUnorderedGreaterThanOrEqual: |
720 // Unordered, greater than or equal can be tested with "hs" condtion. | 722 // Unordered, greater than or equal can be tested with "hs" condtion. |
721 // See ARMv7 manual A8.3 - Conditional execution. | 723 // See ARMv7 manual A8.3 - Conditional execution. |
722 case kUnsignedGreaterThanOrEqual: | 724 case kUnsignedGreaterThanOrEqual: |
723 __ b(hs, tlabel); | 725 __ b(hs, tlabel); |
724 break; | 726 break; |
725 case kUnorderedLessThanOrEqual: | 727 case kUnorderedLessThanOrEqual: |
726 __ b(vs, flabel); | 728 // The "ls" condition will not catch the unordered case. |
727 // Fall through. | 729 // The jump/fall through to false label will be used if the comparison |
| 730 // was unordered. |
728 case kUnsignedLessThanOrEqual: | 731 case kUnsignedLessThanOrEqual: |
729 __ b(ls, tlabel); | 732 __ b(ls, tlabel); |
730 break; | 733 break; |
731 case kUnorderedGreaterThan: | 734 case kUnorderedGreaterThan: |
732 // Unordered or greater than can be tested with "hi" condtion. | 735 // Unordered or greater than can be tested with "hi" condtion. |
733 // See ARMv7 manual A8.3 - Conditional execution. | 736 // See ARMv7 manual A8.3 - Conditional execution. |
734 case kUnsignedGreaterThan: | 737 case kUnsignedGreaterThan: |
735 __ b(hi, tlabel); | 738 __ b(hi, tlabel); |
736 break; | 739 break; |
737 case kOverflow: | 740 case kOverflow: |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1102 } | 1105 } |
1103 } | 1106 } |
1104 MarkLazyDeoptSite(); | 1107 MarkLazyDeoptSite(); |
1105 } | 1108 } |
1106 | 1109 |
1107 #undef __ | 1110 #undef __ |
1108 | 1111 |
1109 } // namespace compiler | 1112 } // namespace compiler |
1110 } // namespace internal | 1113 } // namespace internal |
1111 } // namespace v8 | 1114 } // namespace v8 |
OLD | NEW |