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

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

Issue 2005723004: Fraction class prototype and test (not to be committed). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: work in progress Created 4 years, 5 months 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
« no previous file with comments | « runtime/vm/intrinsifier_mips.cc ('k') | runtime/vm/method_recognizer.h » ('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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 __ LoadObject(RAX, Bool::True()); 653 __ LoadObject(RAX, Bool::True());
654 __ ret(); 654 __ ret();
655 655
656 // At least one of the arguments was not Smi. 656 // At least one of the arguments was not Smi.
657 Label receiver_not_smi; 657 Label receiver_not_smi;
658 __ Bind(&check_for_mint); 658 __ Bind(&check_for_mint);
659 __ movq(RAX, Address(RSP, + kReceiverOffset * kWordSize)); 659 __ movq(RAX, Address(RSP, + kReceiverOffset * kWordSize));
660 __ testq(RAX, Immediate(kSmiTagMask)); 660 __ testq(RAX, Immediate(kSmiTagMask));
661 __ j(NOT_ZERO, &receiver_not_smi); 661 __ j(NOT_ZERO, &receiver_not_smi);
662 662
663 // Left (receiver) is Smi, return false if right is not Double. 663 // Left (receiver) is Smi, return false if right is not Double or Fraction.
664 // Note that an instance of Mint or Bigint never contains a value that can be 664 // Note that an instance of Mint or Bigint never contains a value that can be
665 // represented by Smi. 665 // represented by Smi.
666 __ movq(RAX, Address(RSP, + kArgumentOffset * kWordSize)); 666 __ movq(RAX, Address(RSP, + kArgumentOffset * kWordSize));
667 __ CompareClassId(RAX, kDoubleCid); 667 __ LoadClassId(TMP, RAX);
668 __ cmpl(TMP, Immediate(kDoubleCid));
669 __ j(EQUAL, &fall_through);
670 __ cmpl(TMP, Immediate(kFractionCid));
668 __ j(EQUAL, &fall_through); 671 __ j(EQUAL, &fall_through);
669 __ LoadObject(RAX, Bool::False()); 672 __ LoadObject(RAX, Bool::False());
670 __ ret(); 673 __ ret();
671 674
672 __ Bind(&receiver_not_smi); 675 __ Bind(&receiver_not_smi);
673 // RAX:: receiver. 676 // RAX:: receiver.
674 __ CompareClassId(RAX, kMintCid); 677 __ CompareClassId(RAX, kMintCid);
675 __ j(NOT_EQUAL, &fall_through); 678 __ j(NOT_EQUAL, &fall_through);
676 // Receiver is Mint, return false if right is Smi. 679 // Receiver is Mint, return false if right is Smi.
677 __ movq(RAX, Address(RSP, + kArgumentOffset * kWordSize)); 680 __ movq(RAX, Address(RSP, + kArgumentOffset * kWordSize));
(...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after
2124 __ Bind(&true_label); 2127 __ Bind(&true_label);
2125 __ LoadObject(RAX, Bool::True()); 2128 __ LoadObject(RAX, Bool::True());
2126 __ ret(); 2129 __ ret();
2127 } 2130 }
2128 2131
2129 #undef __ 2132 #undef __
2130 2133
2131 } // namespace dart 2134 } // namespace dart
2132 2135
2133 #endif // defined TARGET_ARCH_X64 2136 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_mips.cc ('k') | runtime/vm/method_recognizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698