| 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 // 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 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1358 &fall_through, | 1358 &fall_through, |
| 1359 Assembler::kNearJump, | 1359 Assembler::kNearJump, |
| 1360 EAX); // Result register. | 1360 EAX); // Result register. |
| 1361 __ movsd(FieldAddress(EAX, Double::value_offset()), XMM0); | 1361 __ movsd(FieldAddress(EAX, Double::value_offset()), XMM0); |
| 1362 __ ret(); | 1362 __ ret(); |
| 1363 __ Bind(&fall_through); | 1363 __ Bind(&fall_through); |
| 1364 return false; | 1364 return false; |
| 1365 } | 1365 } |
| 1366 | 1366 |
| 1367 | 1367 |
| 1368 bool Intrinsifier::Double_isNaN(Assembler* assembler) { | 1368 bool Intrinsifier::Double_getIsNaN(Assembler* assembler) { |
| 1369 const Bool& bool_true = Bool::ZoneHandle(Bool::True()); | 1369 const Bool& bool_true = Bool::ZoneHandle(Bool::True()); |
| 1370 const Bool& bool_false = Bool::ZoneHandle(Bool::False()); | 1370 const Bool& bool_false = Bool::ZoneHandle(Bool::False()); |
| 1371 Label is_true; | 1371 Label is_true; |
| 1372 __ movl(EAX, Address(ESP, +1 * kWordSize)); | 1372 __ movl(EAX, Address(ESP, +1 * kWordSize)); |
| 1373 __ movsd(XMM0, FieldAddress(EAX, Double::value_offset())); | 1373 __ movsd(XMM0, FieldAddress(EAX, Double::value_offset())); |
| 1374 __ comisd(XMM0, XMM0); | 1374 __ comisd(XMM0, XMM0); |
| 1375 __ j(PARITY_EVEN, &is_true, Assembler::kNearJump); // NaN -> true; | 1375 __ j(PARITY_EVEN, &is_true, Assembler::kNearJump); // NaN -> true; |
| 1376 __ LoadObject(EAX, bool_false); | 1376 __ LoadObject(EAX, bool_false); |
| 1377 __ ret(); | 1377 __ ret(); |
| 1378 __ Bind(&is_true); | 1378 __ Bind(&is_true); |
| 1379 __ LoadObject(EAX, bool_true); | 1379 __ LoadObject(EAX, bool_true); |
| 1380 __ ret(); | 1380 __ ret(); |
| 1381 return true; // Method is complete, no slow case. | 1381 return true; // Method is complete, no slow case. |
| 1382 } | 1382 } |
| 1383 | 1383 |
| 1384 | 1384 |
| 1385 bool Intrinsifier::Double_isNegative(Assembler* assembler) { | 1385 bool Intrinsifier::Double_getIsNegative(Assembler* assembler) { |
| 1386 const Bool& bool_true = Bool::ZoneHandle(Bool::True()); | 1386 const Bool& bool_true = Bool::ZoneHandle(Bool::True()); |
| 1387 const Bool& bool_false = Bool::ZoneHandle(Bool::False()); | 1387 const Bool& bool_false = Bool::ZoneHandle(Bool::False()); |
| 1388 Label is_false, is_true, is_zero; | 1388 Label is_false, is_true, is_zero; |
| 1389 __ movl(EAX, Address(ESP, +1 * kWordSize)); | 1389 __ movl(EAX, Address(ESP, +1 * kWordSize)); |
| 1390 __ movsd(XMM0, FieldAddress(EAX, Double::value_offset())); | 1390 __ movsd(XMM0, FieldAddress(EAX, Double::value_offset())); |
| 1391 __ xorpd(XMM1, XMM1); // 0.0 -> XMM1. | 1391 __ xorpd(XMM1, XMM1); // 0.0 -> XMM1. |
| 1392 __ comisd(XMM0, XMM1); | 1392 __ comisd(XMM0, XMM1); |
| 1393 __ j(PARITY_EVEN, &is_false, Assembler::kNearJump); // NaN -> false. | 1393 __ j(PARITY_EVEN, &is_false, Assembler::kNearJump); // NaN -> false. |
| 1394 __ j(EQUAL, &is_zero, Assembler::kNearJump); // Check for negative zero. | 1394 __ j(EQUAL, &is_zero, Assembler::kNearJump); // Check for negative zero. |
| 1395 __ j(ABOVE_EQUAL, &is_false, Assembler::kNearJump); // >= 0 -> false. | 1395 __ j(ABOVE_EQUAL, &is_false, Assembler::kNearJump); // >= 0 -> false. |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1663 __ Bind(&is_true); | 1663 __ Bind(&is_true); |
| 1664 __ LoadObject(EAX, bool_true); | 1664 __ LoadObject(EAX, bool_true); |
| 1665 __ ret(); | 1665 __ ret(); |
| 1666 return true; | 1666 return true; |
| 1667 } | 1667 } |
| 1668 | 1668 |
| 1669 #undef __ | 1669 #undef __ |
| 1670 } // namespace dart | 1670 } // namespace dart |
| 1671 | 1671 |
| 1672 #endif // defined TARGET_ARCH_IA32 | 1672 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |