OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 __ LoadObject(R0, Bool::True()); | 601 __ LoadObject(R0, Bool::True()); |
602 __ ret(); | 602 __ ret(); |
603 | 603 |
604 // At least one of the arguments was not Smi. | 604 // At least one of the arguments was not Smi. |
605 Label receiver_not_smi; | 605 Label receiver_not_smi; |
606 __ Bind(&check_for_mint); | 606 __ Bind(&check_for_mint); |
607 | 607 |
608 __ tsti(R1, Immediate(kSmiTagMask)); // Check receiver. | 608 __ tsti(R1, Immediate(kSmiTagMask)); // Check receiver. |
609 __ b(&receiver_not_smi, NE); | 609 __ b(&receiver_not_smi, NE); |
610 | 610 |
611 // Left (receiver) is Smi, return false if right is not Double. | 611 // Left (receiver) is Smi, return false if right is not Double or Fraction. |
612 // Note that an instance of Mint or Bigint never contains a value that can be | 612 // Note that an instance of Mint or Bigint never contains a value that can be |
613 // represented by Smi. | 613 // represented by Smi. |
614 | 614 |
615 __ CompareClassId(R0, kDoubleCid); | 615 __ LoadClassId(TMP, R0); |
| 616 __ CompareImmediate(TMP, kDoubleCid); |
| 617 __ b(&fall_through, EQ); |
| 618 __ CompareImmediate(TMP, kFractionCid); |
616 __ b(&fall_through, EQ); | 619 __ b(&fall_through, EQ); |
617 __ LoadObject(R0, Bool::False()); // Smi == Mint -> false. | 620 __ LoadObject(R0, Bool::False()); // Smi == Mint -> false. |
618 __ ret(); | 621 __ ret(); |
619 | 622 |
620 __ Bind(&receiver_not_smi); | 623 __ Bind(&receiver_not_smi); |
621 // R1: receiver. | 624 // R1: receiver. |
622 | 625 |
623 __ CompareClassId(R1, kMintCid); | 626 __ CompareClassId(R1, kMintCid); |
624 __ b(&fall_through, NE); | 627 __ b(&fall_through, NE); |
625 // Receiver is Mint, return false if right is Smi. | 628 // Receiver is Mint, return false if right is Smi. |
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2212 __ cmp(R0, Operand(0)); | 2215 __ cmp(R0, Operand(0)); |
2213 __ LoadObject(R0, Bool::False()); | 2216 __ LoadObject(R0, Bool::False()); |
2214 __ LoadObject(TMP, Bool::True()); | 2217 __ LoadObject(TMP, Bool::True()); |
2215 __ csel(R0, TMP, R0, NE); | 2218 __ csel(R0, TMP, R0, NE); |
2216 __ ret(); | 2219 __ ret(); |
2217 } | 2220 } |
2218 | 2221 |
2219 } // namespace dart | 2222 } // namespace dart |
2220 | 2223 |
2221 #endif // defined TARGET_ARCH_ARM64 | 2224 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |