| 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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 __ xorl(EAX, ECX); | 880 __ xorl(EAX, ECX); |
| 881 // BSR does not write the destination register if source is zero. Put a 1 in | 881 // BSR does not write the destination register if source is zero. Put a 1 in |
| 882 // the Smi tag bit to ensure BSR writes to destination register. | 882 // the Smi tag bit to ensure BSR writes to destination register. |
| 883 __ orl(EAX, Immediate(kSmiTagMask)); | 883 __ orl(EAX, Immediate(kSmiTagMask)); |
| 884 __ bsrl(EAX, EAX); | 884 __ bsrl(EAX, EAX); |
| 885 __ SmiTag(EAX); | 885 __ SmiTag(EAX); |
| 886 __ ret(); | 886 __ ret(); |
| 887 } | 887 } |
| 888 | 888 |
| 889 | 889 |
| 890 void Intrinsifier::Bigint_getNeg(Assembler* assembler) { | |
| 891 __ movl(EAX, Address(ESP, + 1 * kWordSize)); | |
| 892 __ movl(EAX, FieldAddress(EAX, Bigint::neg_offset())); | |
| 893 __ ret(); | |
| 894 } | |
| 895 | |
| 896 | |
| 897 void Intrinsifier::Bigint_setNeg(Assembler* assembler) { | 890 void Intrinsifier::Bigint_setNeg(Assembler* assembler) { |
| 898 __ movl(EAX, Address(ESP, + 1 * kWordSize)); | 891 __ movl(EAX, Address(ESP, + 1 * kWordSize)); |
| 899 __ movl(ECX, Address(ESP, + 2 * kWordSize)); | 892 __ movl(ECX, Address(ESP, + 2 * kWordSize)); |
| 900 __ StoreIntoObject(ECX, FieldAddress(ECX, Bigint::neg_offset()), EAX, false); | 893 __ StoreIntoObject(ECX, FieldAddress(ECX, Bigint::neg_offset()), EAX, false); |
| 901 __ ret(); | 894 __ ret(); |
| 902 } | 895 } |
| 903 | 896 |
| 904 | 897 |
| 905 void Intrinsifier::Bigint_getUsed(Assembler* assembler) { | |
| 906 __ movl(EAX, Address(ESP, + 1 * kWordSize)); | |
| 907 __ movl(EAX, FieldAddress(EAX, Bigint::used_offset())); | |
| 908 __ ret(); | |
| 909 } | |
| 910 | |
| 911 | |
| 912 void Intrinsifier::Bigint_setUsed(Assembler* assembler) { | 898 void Intrinsifier::Bigint_setUsed(Assembler* assembler) { |
| 913 __ movl(EAX, Address(ESP, + 1 * kWordSize)); | 899 __ movl(EAX, Address(ESP, + 1 * kWordSize)); |
| 914 __ movl(ECX, Address(ESP, + 2 * kWordSize)); | 900 __ movl(ECX, Address(ESP, + 2 * kWordSize)); |
| 915 __ StoreIntoObject(ECX, FieldAddress(ECX, Bigint::used_offset()), EAX); | 901 __ StoreIntoObject(ECX, FieldAddress(ECX, Bigint::used_offset()), EAX); |
| 916 __ ret(); | 902 __ ret(); |
| 917 } | 903 } |
| 918 | 904 |
| 919 | 905 |
| 920 void Intrinsifier::Bigint_getDigits(Assembler* assembler) { | |
| 921 __ movl(EAX, Address(ESP, + 1 * kWordSize)); | |
| 922 __ movl(EAX, FieldAddress(EAX, Bigint::digits_offset())); | |
| 923 __ ret(); | |
| 924 } | |
| 925 | |
| 926 | |
| 927 void Intrinsifier::Bigint_setDigits(Assembler* assembler) { | 906 void Intrinsifier::Bigint_setDigits(Assembler* assembler) { |
| 928 __ movl(EAX, Address(ESP, + 1 * kWordSize)); | 907 __ movl(EAX, Address(ESP, + 1 * kWordSize)); |
| 929 __ movl(ECX, Address(ESP, + 2 * kWordSize)); | 908 __ movl(ECX, Address(ESP, + 2 * kWordSize)); |
| 930 __ StoreIntoObject(ECX, | 909 __ StoreIntoObject(ECX, |
| 931 FieldAddress(ECX, Bigint::digits_offset()), EAX, false); | 910 FieldAddress(ECX, Bigint::digits_offset()), EAX, false); |
| 932 __ ret(); | 911 __ ret(); |
| 933 } | 912 } |
| 934 | 913 |
| 935 | 914 |
| 936 // Check if the last argument is a double, jump to label 'is_smi' if smi | 915 // Check if the last argument is a double, jump to label 'is_smi' if smi |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1663 Isolate::current_tag_offset()); | 1642 Isolate::current_tag_offset()); |
| 1664 // Set return value to Isolate::current_tag_. | 1643 // Set return value to Isolate::current_tag_. |
| 1665 __ movl(EAX, current_tag_addr); | 1644 __ movl(EAX, current_tag_addr); |
| 1666 __ ret(); | 1645 __ ret(); |
| 1667 } | 1646 } |
| 1668 | 1647 |
| 1669 #undef __ | 1648 #undef __ |
| 1670 } // namespace dart | 1649 } // namespace dart |
| 1671 | 1650 |
| 1672 #endif // defined TARGET_ARCH_IA32 | 1651 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |