| 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 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 // cannot tag the result. | 716 // cannot tag the result. |
| 717 __ cmpl(EAX, Immediate(0x40000000)); | 717 __ cmpl(EAX, Immediate(0x40000000)); |
| 718 __ j(EQUAL, &fall_through); | 718 __ j(EQUAL, &fall_through); |
| 719 __ SmiTag(EAX); | 719 __ SmiTag(EAX); |
| 720 __ ret(); | 720 __ ret(); |
| 721 __ Bind(&fall_through); | 721 __ Bind(&fall_through); |
| 722 return false; | 722 return false; |
| 723 } | 723 } |
| 724 | 724 |
| 725 | 725 |
| 726 bool Intrinsifier::Integer_negate(Assembler* assembler) { |
| 727 Label fall_through; |
| 728 __ movl(EAX, Address(ESP, + 1 * kWordSize)); |
| 729 __ testl(EAX, Immediate(kSmiTagMask)); |
| 730 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); // Non-smi value. |
| 731 __ negl(EAX); |
| 732 __ j(OVERFLOW, &fall_through, Assembler::kNearJump); |
| 733 // Result is in EAX. |
| 734 __ ret(); |
| 735 __ Bind(&fall_through); |
| 736 return false; |
| 737 } |
| 738 |
| 739 |
| 726 bool Intrinsifier::Integer_bitAndFromInteger(Assembler* assembler) { | 740 bool Intrinsifier::Integer_bitAndFromInteger(Assembler* assembler) { |
| 727 Label fall_through; | 741 Label fall_through; |
| 728 TestBothArgumentsSmis(assembler, &fall_through); | 742 TestBothArgumentsSmis(assembler, &fall_through); |
| 729 __ movl(EBX, Address(ESP, + 2 * kWordSize)); | 743 __ movl(EBX, Address(ESP, + 2 * kWordSize)); |
| 730 __ andl(EAX, EBX); | 744 __ andl(EAX, EBX); |
| 731 // Result is in EAX. | 745 // Result is in EAX. |
| 732 __ ret(); | 746 __ ret(); |
| 733 __ Bind(&fall_through); | 747 __ Bind(&fall_through); |
| 734 return false; | 748 return false; |
| 735 } | 749 } |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1447 __ Bind(&is_true); | 1461 __ Bind(&is_true); |
| 1448 __ LoadObject(EAX, bool_true); | 1462 __ LoadObject(EAX, bool_true); |
| 1449 __ ret(); | 1463 __ ret(); |
| 1450 return true; | 1464 return true; |
| 1451 } | 1465 } |
| 1452 | 1466 |
| 1453 #undef __ | 1467 #undef __ |
| 1454 } // namespace dart | 1468 } // namespace dart |
| 1455 | 1469 |
| 1456 #endif // defined TARGET_ARCH_IA32 | 1470 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |