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

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

Issue 11748016: Make ~/, round, ceil, floor, truncate return ints. Remove toInt. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Checked mode fixes. Created 7 years, 11 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
OLDNEW
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 // 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 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after
1458 __ Bind(&is_zero); 1458 __ Bind(&is_zero);
1459 // Check for negative zero (get the sign bit). 1459 // Check for negative zero (get the sign bit).
1460 __ movmskpd(EAX, XMM0); 1460 __ movmskpd(EAX, XMM0);
1461 __ testl(EAX, Immediate(1)); 1461 __ testl(EAX, Immediate(1));
1462 __ j(NOT_ZERO, &is_true, Assembler::kNearJump); 1462 __ j(NOT_ZERO, &is_true, Assembler::kNearJump);
1463 __ jmp(&is_false, Assembler::kNearJump); 1463 __ jmp(&is_false, Assembler::kNearJump);
1464 return true; // Method is complete, no slow case. 1464 return true; // Method is complete, no slow case.
1465 } 1465 }
1466 1466
1467 1467
1468 bool Intrinsifier::Double_toInt(Assembler* assembler) { 1468 bool Intrinsifier::Double_truncate(Assembler* assembler) {
1469 __ movl(EAX, Address(ESP, +1 * kWordSize)); 1469 __ movl(EAX, Address(ESP, +1 * kWordSize));
1470 __ movsd(XMM0, FieldAddress(EAX, Double::value_offset())); 1470 __ movsd(XMM0, FieldAddress(EAX, Double::value_offset()));
1471 __ cvttsd2si(EAX, XMM0); 1471 __ cvttsd2si(EAX, XMM0);
1472 // Overflow is signalled with minint. 1472 // Overflow is signalled with minint.
1473 Label fall_through; 1473 Label fall_through;
1474 // Check for overflow and that it fits into Smi. 1474 // Check for overflow and that it fits into Smi.
1475 __ cmpl(EAX, Immediate(0xC0000000)); 1475 __ cmpl(EAX, Immediate(0xC0000000));
1476 __ j(NEGATIVE, &fall_through, Assembler::kNearJump); 1476 __ j(NEGATIVE, &fall_through, Assembler::kNearJump);
1477 __ SmiTag(EAX); 1477 __ SmiTag(EAX);
1478 __ ret(); 1478 __ ret();
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1638 __ Bind(&is_true); 1638 __ Bind(&is_true);
1639 __ LoadObject(EAX, bool_true); 1639 __ LoadObject(EAX, bool_true);
1640 __ ret(); 1640 __ ret();
1641 return true; 1641 return true;
1642 } 1642 }
1643 1643
1644 #undef __ 1644 #undef __
1645 } // namespace dart 1645 } // namespace dart
1646 1646
1647 #endif // defined TARGET_ARCH_IA32 1647 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698