Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: runtime/vm/intrinsifier_x64.cc

Issue 59933004: In preparation of inlining remainder and modulo binary Smi operations: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intrinsifier_mips.cc ('k') | runtime/vm/native_api_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 705
706 __ Bind(&subtract); 706 __ Bind(&subtract);
707 __ subq(RAX, RCX); 707 __ subq(RAX, RCX);
708 __ SmiTag(RAX); 708 __ SmiTag(RAX);
709 __ ret(); 709 __ ret();
710 710
711 __ Bind(&fall_through); 711 __ Bind(&fall_through);
712 } 712 }
713 713
714 714
715 void Intrinsifier::Integer_remainder(Assembler* assembler) {
716 Label fall_through;
717 TestBothArgumentsSmis(assembler, &fall_through);
718 // RAX: right argument (divisor)
719 __ movq(RCX, RAX);
720 __ movq(RAX, Address(RSP, + 2 * kWordSize)); // Left argument (dividend).
721 // RAX: Tagged left (dividend).
722 // RCX: Tagged right (divisor).
723 __ cmpq(RCX, Immediate(0));
724 __ j(EQUAL, &fall_through);
725 EmitRemainderOperation(assembler);
726 // Untagged remainder result in RAX.
727 __ SmiTag(RAX);
728 __ ret();
729 __ Bind(&fall_through);
730 }
731
732
733 void Intrinsifier::Integer_truncDivide(Assembler* assembler) { 715 void Intrinsifier::Integer_truncDivide(Assembler* assembler) {
734 Label fall_through, not_32bit; 716 Label fall_through, not_32bit;
735 TestBothArgumentsSmis(assembler, &fall_through); 717 TestBothArgumentsSmis(assembler, &fall_through);
736 // RAX: right argument (divisor) 718 // RAX: right argument (divisor)
737 __ cmpq(RAX, Immediate(0)); 719 __ cmpq(RAX, Immediate(0));
738 __ j(EQUAL, &fall_through, Assembler::kNearJump); 720 __ j(EQUAL, &fall_through, Assembler::kNearJump);
739 __ movq(RCX, RAX); 721 __ movq(RCX, RAX);
740 __ movq(RAX, Address(RSP, + 2 * kWordSize)); // Left argument (dividend). 722 __ movq(RAX, Address(RSP, + 2 * kWordSize)); // Left argument (dividend).
741 723
742 // Check if both operands fit into 32bits as idiv with 64bit operands 724 // Check if both operands fit into 32bits as idiv with 64bit operands
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
1716 1698
1717 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { 1699 void Intrinsifier::TwoByteString_equality(Assembler* assembler) {
1718 StringEquality(assembler, kTwoByteStringCid); 1700 StringEquality(assembler, kTwoByteStringCid);
1719 } 1701 }
1720 1702
1721 #undef __ 1703 #undef __
1722 1704
1723 } // namespace dart 1705 } // namespace dart
1724 1706
1725 #endif // defined TARGET_ARCH_X64 1707 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_mips.cc ('k') | runtime/vm/native_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698