| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 // cannot tag the result. | 680 // cannot tag the result. |
| 681 __ cmpq(RAX, Immediate(0x4000000000000000)); | 681 __ cmpq(RAX, Immediate(0x4000000000000000)); |
| 682 __ j(EQUAL, &fall_through); | 682 __ j(EQUAL, &fall_through); |
| 683 __ SmiTag(RAX); | 683 __ SmiTag(RAX); |
| 684 __ ret(); | 684 __ ret(); |
| 685 __ Bind(&fall_through); | 685 __ Bind(&fall_through); |
| 686 return false; | 686 return false; |
| 687 } | 687 } |
| 688 | 688 |
| 689 | 689 |
| 690 bool Intrinsifier::Integer_negate(Assembler* assembler) { |
| 691 Label fall_through; |
| 692 __ movq(RAX, Address(RSP, + 1 * kWordSize)); |
| 693 __ testq(RAX, Immediate(kSmiTagMask)); |
| 694 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); // Non-smi value. |
| 695 __ negq(RAX); |
| 696 __ j(OVERFLOW, &fall_through, Assembler::kNearJump); |
| 697 // Result is in RAX. |
| 698 __ ret(); |
| 699 __ Bind(&fall_through); |
| 700 return false; |
| 701 } |
| 702 |
| 703 |
| 690 bool Intrinsifier::Integer_bitAndFromInteger(Assembler* assembler) { | 704 bool Intrinsifier::Integer_bitAndFromInteger(Assembler* assembler) { |
| 691 Label fall_through; | 705 Label fall_through; |
| 692 TestBothArgumentsSmis(assembler, &fall_through); | 706 TestBothArgumentsSmis(assembler, &fall_through); |
| 693 // RAX is the right argument. | 707 // RAX is the right argument. |
| 694 __ andq(RAX, Address(RSP, + 2 * kWordSize)); | 708 __ andq(RAX, Address(RSP, + 2 * kWordSize)); |
| 695 // Result is in RAX. | 709 // Result is in RAX. |
| 696 __ ret(); | 710 __ ret(); |
| 697 __ Bind(&fall_through); | 711 __ Bind(&fall_through); |
| 698 return false; | 712 return false; |
| 699 } | 713 } |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1403 __ LoadObject(RAX, bool_true); | 1417 __ LoadObject(RAX, bool_true); |
| 1404 __ ret(); | 1418 __ ret(); |
| 1405 return true; | 1419 return true; |
| 1406 } | 1420 } |
| 1407 | 1421 |
| 1408 #undef __ | 1422 #undef __ |
| 1409 | 1423 |
| 1410 } // namespace dart | 1424 } // namespace dart |
| 1411 | 1425 |
| 1412 #endif // defined TARGET_ARCH_X64 | 1426 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |