OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
7 | 7 |
8 #include "vm/intrinsifier.h" | 8 #include "vm/intrinsifier.h" |
9 | 9 |
10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 // cannot tag the result. | 781 // cannot tag the result. |
782 __ CompareImmediate(R0, 0x40000000); | 782 __ CompareImmediate(R0, 0x40000000); |
783 __ SmiTag(R0, NE); // Not equal. Okay to tag and return. | 783 __ SmiTag(R0, NE); // Not equal. Okay to tag and return. |
784 __ bx(LR, NE); // Return. | 784 __ bx(LR, NE); // Return. |
785 __ Bind(&fall_through); | 785 __ Bind(&fall_through); |
786 return false; | 786 return false; |
787 } | 787 } |
788 | 788 |
789 | 789 |
790 bool Intrinsifier::Integer_negate(Assembler* assembler) { | 790 bool Intrinsifier::Integer_negate(Assembler* assembler) { |
| 791 Label fall_through; |
791 __ ldr(R0, Address(SP, + 0 * kWordSize)); // Grab first argument. | 792 __ ldr(R0, Address(SP, + 0 * kWordSize)); // Grab first argument. |
792 __ tst(R0, ShifterOperand(kSmiTagMask)); // Test for Smi. | 793 __ tst(R0, ShifterOperand(kSmiTagMask)); // Test for Smi. |
793 __ rsb(R0, R0, ShifterOperand(0), EQ); // R0 is a Smi. R0 <- 0 - R0. | 794 __ b(&fall_through, NE); |
794 __ bx(LR, EQ); // Return. | 795 __ rsbs(R0, R0, ShifterOperand(0)); // R0 is a Smi. R0 <- 0 - R0. |
| 796 __ bx(LR, VC); // Return if there wasn't overflow, fall through otherwise. |
795 // R0 is not a Smi. Fall through. | 797 // R0 is not a Smi. Fall through. |
| 798 __ Bind(&fall_through); |
796 return false; | 799 return false; |
797 } | 800 } |
798 | 801 |
799 | 802 |
800 bool Intrinsifier::Integer_bitAndFromInteger(Assembler* assembler) { | 803 bool Intrinsifier::Integer_bitAndFromInteger(Assembler* assembler) { |
801 Label fall_through; | 804 Label fall_through; |
802 | 805 |
803 TestBothArgumentsSmis(assembler, &fall_through); // checks two smis | 806 TestBothArgumentsSmis(assembler, &fall_through); // checks two smis |
804 __ and_(R0, R0, ShifterOperand(R1)); | 807 __ and_(R0, R0, ShifterOperand(R1)); |
805 | 808 |
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1687 __ Bind(&ok); | 1690 __ Bind(&ok); |
1688 __ Ret(); | 1691 __ Ret(); |
1689 | 1692 |
1690 __ Bind(&fall_through); | 1693 __ Bind(&fall_through); |
1691 return false; | 1694 return false; |
1692 } | 1695 } |
1693 | 1696 |
1694 } // namespace dart | 1697 } // namespace dart |
1695 | 1698 |
1696 #endif // defined TARGET_ARCH_ARM | 1699 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |