| OLD | NEW |
| 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 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 __ xorl(EAX, ECX); | 796 __ xorl(EAX, ECX); |
| 797 // BSR does not write the destination register if source is zero. Put a 1 in | 797 // BSR does not write the destination register if source is zero. Put a 1 in |
| 798 // the Smi tag bit to ensure BSR writes to destination register. | 798 // the Smi tag bit to ensure BSR writes to destination register. |
| 799 __ orl(EAX, Immediate(kSmiTagMask)); | 799 __ orl(EAX, Immediate(kSmiTagMask)); |
| 800 __ bsrl(EAX, EAX); | 800 __ bsrl(EAX, EAX); |
| 801 __ SmiTag(EAX); | 801 __ SmiTag(EAX); |
| 802 __ ret(); | 802 __ ret(); |
| 803 } | 803 } |
| 804 | 804 |
| 805 | 805 |
| 806 void Intrinsifier::Bigint_setNeg(Assembler* assembler) { | |
| 807 __ movl(EAX, Address(ESP, + 1 * kWordSize)); | |
| 808 __ movl(ECX, Address(ESP, + 2 * kWordSize)); | |
| 809 __ StoreIntoObject(ECX, FieldAddress(ECX, Bigint::neg_offset()), EAX, false); | |
| 810 __ ret(); | |
| 811 } | |
| 812 | |
| 813 | |
| 814 void Intrinsifier::Bigint_setUsed(Assembler* assembler) { | |
| 815 __ movl(EAX, Address(ESP, + 1 * kWordSize)); | |
| 816 __ movl(ECX, Address(ESP, + 2 * kWordSize)); | |
| 817 __ StoreIntoObject(ECX, FieldAddress(ECX, Bigint::used_offset()), EAX); | |
| 818 __ ret(); | |
| 819 } | |
| 820 | |
| 821 | |
| 822 void Intrinsifier::Bigint_setDigits(Assembler* assembler) { | |
| 823 __ movl(EAX, Address(ESP, + 1 * kWordSize)); | |
| 824 __ movl(ECX, Address(ESP, + 2 * kWordSize)); | |
| 825 __ StoreIntoObject(ECX, | |
| 826 FieldAddress(ECX, Bigint::digits_offset()), EAX, false); | |
| 827 __ ret(); | |
| 828 } | |
| 829 | |
| 830 | |
| 831 void Intrinsifier::Bigint_absAdd(Assembler* assembler) { | 806 void Intrinsifier::Bigint_absAdd(Assembler* assembler) { |
| 832 // static void _absAdd(Uint32List digits, int used, | 807 // static void _absAdd(Uint32List digits, int used, |
| 833 // Uint32List a_digits, int a_used, | 808 // Uint32List a_digits, int a_used, |
| 834 // Uint32List r_digits) | 809 // Uint32List r_digits) |
| 835 | 810 |
| 836 // Preserve CTX to free ESI. | 811 // Preserve CTX to free ESI. |
| 837 __ pushl(CTX); | 812 __ pushl(CTX); |
| 838 ASSERT(CTX == ESI); | 813 ASSERT(CTX == ESI); |
| 839 | 814 |
| 840 __ movl(EDI, Address(ESP, 6 * kWordSize)); // digits | 815 __ movl(EDI, Address(ESP, 6 * kWordSize)); // digits |
| (...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2053 Isolate::current_tag_offset()); | 2028 Isolate::current_tag_offset()); |
| 2054 // Set return value to Isolate::current_tag_. | 2029 // Set return value to Isolate::current_tag_. |
| 2055 __ movl(EAX, current_tag_addr); | 2030 __ movl(EAX, current_tag_addr); |
| 2056 __ ret(); | 2031 __ ret(); |
| 2057 } | 2032 } |
| 2058 | 2033 |
| 2059 #undef __ | 2034 #undef __ |
| 2060 } // namespace dart | 2035 } // namespace dart |
| 2061 | 2036 |
| 2062 #endif // defined TARGET_ARCH_IA32 | 2037 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |