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

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

Issue 23757016: Simplify compilation of relational operators. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intrinsifier_arm.cc ('k') | runtime/vm/intrinsifier_mips.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 // The intrinsic code below is executed before a method has built its frame. 5 // The intrinsic code below is executed before a method has built its frame.
6 // The return address is on the stack and the arguments below it. 6 // The return address is on the stack and the arguments below it.
7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. 7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved.
8 // Each intrinsification method returns true if the corresponding 8 // Each intrinsification method returns true if the corresponding
9 // Dart method was intrinsified. 9 // Dart method was intrinsified.
10 10
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 __ cmpl(EBX, Immediate(0)); 716 __ cmpl(EBX, Immediate(0));
717 __ j(LESS, &subtract, Assembler::kNearJump); 717 __ j(LESS, &subtract, Assembler::kNearJump);
718 __ addl(EAX, EBX); 718 __ addl(EAX, EBX);
719 __ SmiTag(EAX); 719 __ SmiTag(EAX);
720 __ ret(); 720 __ ret();
721 721
722 __ Bind(&subtract); 722 __ Bind(&subtract);
723 __ subl(EAX, EBX); 723 __ subl(EAX, EBX);
724 724
725 __ Bind(&done); 725 __ Bind(&done);
726 // The remainder of two Smi-s is always a Smi, no overflow check needed. 726 // The remainder of two smis is always a smi, no overflow check needed.
727 __ SmiTag(EAX); 727 __ SmiTag(EAX);
728 __ ret(); 728 __ ret();
729 729
730 __ Bind(&fall_through); 730 __ Bind(&fall_through);
731 } 731 }
732 732
733 733
734 void Intrinsifier::Integer_remainder(Assembler* assembler) { 734 void Intrinsifier::Integer_remainder(Assembler* assembler) {
735 Label fall_through; 735 Label fall_through;
736 TestBothArgumentsSmis(assembler, &fall_through); 736 TestBothArgumentsSmis(assembler, &fall_through);
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 1206
1207 1207
1208 void Intrinsifier::Double_div(Assembler* assembler) { 1208 void Intrinsifier::Double_div(Assembler* assembler) {
1209 return DoubleArithmeticOperations(assembler, Token::kDIV); 1209 return DoubleArithmeticOperations(assembler, Token::kDIV);
1210 } 1210 }
1211 1211
1212 1212
1213 // Left is double right is integer (Bigint, Mint or Smi) 1213 // Left is double right is integer (Bigint, Mint or Smi)
1214 void Intrinsifier::Double_mulFromInteger(Assembler* assembler) { 1214 void Intrinsifier::Double_mulFromInteger(Assembler* assembler) {
1215 Label fall_through; 1215 Label fall_through;
1216 // Only Smi-s allowed. 1216 // Only smis allowed.
1217 __ movl(EAX, Address(ESP, + 1 * kWordSize)); 1217 __ movl(EAX, Address(ESP, + 1 * kWordSize));
1218 __ testl(EAX, Immediate(kSmiTagMask)); 1218 __ testl(EAX, Immediate(kSmiTagMask));
1219 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); 1219 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);
1220 // Is Smi. 1220 // Is Smi.
1221 __ SmiUntag(EAX); 1221 __ SmiUntag(EAX);
1222 __ cvtsi2sd(XMM1, EAX); 1222 __ cvtsi2sd(XMM1, EAX);
1223 __ movl(EAX, Address(ESP, + 2 * kWordSize)); 1223 __ movl(EAX, Address(ESP, + 2 * kWordSize));
1224 __ movsd(XMM0, FieldAddress(EAX, Double::value_offset())); 1224 __ movsd(XMM0, FieldAddress(EAX, Double::value_offset()));
1225 __ mulsd(XMM0, XMM1); 1225 __ mulsd(XMM0, XMM1);
1226 const Class& double_class = Class::Handle( 1226 const Class& double_class = Class::Handle(
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1717 __ Bind(&ok); 1717 __ Bind(&ok);
1718 __ ret(); 1718 __ ret();
1719 1719
1720 __ Bind(&fall_through); 1720 __ Bind(&fall_through);
1721 } 1721 }
1722 1722
1723 #undef __ 1723 #undef __
1724 } // namespace dart 1724 } // namespace dart
1725 1725
1726 #endif // defined TARGET_ARCH_IA32 1726 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_arm.cc ('k') | runtime/vm/intrinsifier_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698