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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
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 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
997 | 997 |
998 // Argument is Smi (receiver). | 998 // Argument is Smi (receiver). |
999 void Intrinsifier::Smi_bitNegate(Assembler* assembler) { | 999 void Intrinsifier::Smi_bitNegate(Assembler* assembler) { |
1000 __ movq(RAX, Address(RSP, + 1 * kWordSize)); // Index. | 1000 __ movq(RAX, Address(RSP, + 1 * kWordSize)); // Index. |
1001 __ notq(RAX); | 1001 __ notq(RAX); |
1002 __ andq(RAX, Immediate(~kSmiTagMask)); // Remove inverted smi-tag. | 1002 __ andq(RAX, Immediate(~kSmiTagMask)); // Remove inverted smi-tag. |
1003 __ ret(); | 1003 __ ret(); |
1004 } | 1004 } |
1005 | 1005 |
1006 | 1006 |
1007 void Intrinsifier::Smi_bitLength(Assembler* assembler) { | |
srdjan
2013/09/06 15:35:34
ditto
sra1
2013/09/06 22:11:57
Done.
| |
1008 } | |
1009 | |
1010 | |
1007 // Check if the last argument is a double, jump to label 'is_smi' if smi | 1011 // Check if the last argument is a double, jump to label 'is_smi' if smi |
1008 // (easy to convert to double), otherwise jump to label 'not_double_smi', | 1012 // (easy to convert to double), otherwise jump to label 'not_double_smi', |
1009 // Returns the last argument in RAX. | 1013 // Returns the last argument in RAX. |
1010 static void TestLastArgumentIsDouble(Assembler* assembler, | 1014 static void TestLastArgumentIsDouble(Assembler* assembler, |
1011 Label* is_smi, | 1015 Label* is_smi, |
1012 Label* not_double_smi) { | 1016 Label* not_double_smi) { |
1013 __ movq(RAX, Address(RSP, + 1 * kWordSize)); | 1017 __ movq(RAX, Address(RSP, + 1 * kWordSize)); |
1014 __ testq(RAX, Immediate(kSmiTagMask)); | 1018 __ testq(RAX, Immediate(kSmiTagMask)); |
1015 __ j(ZERO, is_smi, Assembler::kNearJump); // Jump if Smi. | 1019 __ j(ZERO, is_smi, Assembler::kNearJump); // Jump if Smi. |
1016 __ CompareClassId(RAX, kDoubleCid); | 1020 __ CompareClassId(RAX, kDoubleCid); |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1633 | 1637 |
1634 __ Bind(&fall_through); | 1638 __ Bind(&fall_through); |
1635 } | 1639 } |
1636 | 1640 |
1637 | 1641 |
1638 #undef __ | 1642 #undef __ |
1639 | 1643 |
1640 } // namespace dart | 1644 } // namespace dart |
1641 | 1645 |
1642 #endif // defined TARGET_ARCH_X64 | 1646 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |