| 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 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 __ movl(EAX, Address(ESP, + 1 * kWordSize)); | 907 __ movl(EAX, Address(ESP, + 1 * kWordSize)); |
| 908 __ movl(ECX, Address(ESP, + 2 * kWordSize)); | 908 __ movl(ECX, Address(ESP, + 2 * kWordSize)); |
| 909 __ StoreIntoObject(ECX, | 909 __ StoreIntoObject(ECX, |
| 910 FieldAddress(ECX, Bigint::digits_offset()), EAX, false); | 910 FieldAddress(ECX, Bigint::digits_offset()), EAX, false); |
| 911 __ ret(); | 911 __ ret(); |
| 912 } | 912 } |
| 913 | 913 |
| 914 | 914 |
| 915 // TODO(regis): Once this intrinsic is implemented on all architectures, the | 915 // TODO(regis): Once this intrinsic is implemented on all architectures, the |
| 916 // corresponding Dart method will be untested. Add a test with --no-intrinsify. | 916 // corresponding Dart method will be untested. Add a test with --no-intrinsify. |
| 917 void Intrinsifier::Bigint_add(Assembler* assembler) { | 917 void Intrinsifier::Bigint_absAdd(Assembler* assembler) { |
| 918 // static void _add(Uint32List digits, int used, | 918 #if 0 // TODO(regis): Re-enable when the optimizer issue is fixed. |
| 919 // Uint32List a_digits, int a_used, | 919 // static void _absAdd(Uint32List digits, int used, |
| 920 // Uint32List r_digits) | 920 // Uint32List a_digits, int a_used, |
| 921 // Uint32List r_digits) |
| 921 | 922 |
| 922 // Preserve CTX to free ESI. | 923 // Preserve CTX to free ESI. |
| 923 __ pushl(CTX); | 924 __ pushl(CTX); |
| 924 ASSERT(CTX == ESI); | 925 ASSERT(CTX == ESI); |
| 925 | 926 |
| 926 __ movl(EDI, Address(ESP, 6 * kWordSize)); // digits | 927 __ movl(EDI, Address(ESP, 6 * kWordSize)); // digits |
| 927 __ movl(EAX, Address(ESP, 5 * kWordSize)); // used is Smi | 928 __ movl(EAX, Address(ESP, 5 * kWordSize)); // used is Smi |
| 928 __ SmiUntag(EAX); // used > 0. | 929 __ SmiUntag(EAX); // used > 0. |
| 929 __ movl(ESI, Address(ESP, 4 * kWordSize)); // a_digits | 930 __ movl(ESI, Address(ESP, 4 * kWordSize)); // a_digits |
| 930 __ movl(ECX, Address(ESP, 3 * kWordSize)); // a_used is Smi | 931 __ movl(ECX, Address(ESP, 3 * kWordSize)); // a_used is Smi |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 | 963 |
| 963 __ Bind(&last_carry); | 964 __ Bind(&last_carry); |
| 964 __ movl(EAX, Immediate(0)); | 965 __ movl(EAX, Immediate(0)); |
| 965 __ adcl(EAX, Immediate(0)); | 966 __ adcl(EAX, Immediate(0)); |
| 966 __ movl(FieldAddress(EBX, EDX, TIMES_4, TypedData::data_offset()), EAX); | 967 __ movl(FieldAddress(EBX, EDX, TIMES_4, TypedData::data_offset()), EAX); |
| 967 | 968 |
| 968 // Restore CTX and return. | 969 // Restore CTX and return. |
| 969 __ popl(CTX); | 970 __ popl(CTX); |
| 970 // TODO(regis): Confirm that returning Object::null() is not required. | 971 // TODO(regis): Confirm that returning Object::null() is not required. |
| 971 __ ret(); | 972 __ ret(); |
| 973 #endif |
| 972 } | 974 } |
| 973 | 975 |
| 974 | 976 |
| 975 // TODO(regis): Once this intrinsic is implemented on all architectures, the | 977 // TODO(regis): Once this intrinsic is implemented on all architectures, the |
| 976 // corresponding Dart method will be untested. Add a test with --no-intrinsify. | 978 // corresponding Dart method will be untested. Add a test with --no-intrinsify. |
| 977 void Intrinsifier::Bigint_sub(Assembler* assembler) { | 979 void Intrinsifier::Bigint_absSub(Assembler* assembler) { |
| 978 // static void _sub(Uint32List digits, int used, | 980 #if 0 // TODO(regis): Re-enable when the optimizer issue is fixed. |
| 979 // Uint32List a_digits, int a_used, | 981 // static void _absSub(Uint32List digits, int used, |
| 980 // Uint32List r_digits) | 982 // Uint32List a_digits, int a_used, |
| 983 // Uint32List r_digits) |
| 981 | 984 |
| 982 // Preserve CTX to free ESI. | 985 // Preserve CTX to free ESI. |
| 983 __ pushl(CTX); | 986 __ pushl(CTX); |
| 984 ASSERT(CTX == ESI); | 987 ASSERT(CTX == ESI); |
| 985 | 988 |
| 986 __ movl(EDI, Address(ESP, 6 * kWordSize)); // digits | 989 __ movl(EDI, Address(ESP, 6 * kWordSize)); // digits |
| 987 __ movl(EAX, Address(ESP, 5 * kWordSize)); // used is Smi | 990 __ movl(EAX, Address(ESP, 5 * kWordSize)); // used is Smi |
| 988 __ SmiUntag(EAX); // used > 0. | 991 __ SmiUntag(EAX); // used > 0. |
| 989 __ movl(ESI, Address(ESP, 4 * kWordSize)); // a_digits | 992 __ movl(ESI, Address(ESP, 4 * kWordSize)); // a_digits |
| 990 __ movl(ECX, Address(ESP, 3 * kWordSize)); // a_used is Smi | 993 __ movl(ECX, Address(ESP, 3 * kWordSize)); // a_used is Smi |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1018 __ movl(FieldAddress(EBX, EDX, TIMES_4, TypedData::data_offset()), EAX); | 1021 __ movl(FieldAddress(EBX, EDX, TIMES_4, TypedData::data_offset()), EAX); |
| 1019 __ incl(EDX); // Does not affect CF. | 1022 __ incl(EDX); // Does not affect CF. |
| 1020 __ decl(ECX); // Does not affect CF. | 1023 __ decl(ECX); // Does not affect CF. |
| 1021 __ j(NOT_ZERO, &carry_loop, Assembler::kNearJump); | 1024 __ j(NOT_ZERO, &carry_loop, Assembler::kNearJump); |
| 1022 | 1025 |
| 1023 __ Bind(&done); | 1026 __ Bind(&done); |
| 1024 // Restore CTX and return. | 1027 // Restore CTX and return. |
| 1025 __ popl(CTX); | 1028 __ popl(CTX); |
| 1026 // TODO(regis): Confirm that returning Object::null() is not required. | 1029 // TODO(regis): Confirm that returning Object::null() is not required. |
| 1027 __ ret(); | 1030 __ ret(); |
| 1031 #endif |
| 1028 } | 1032 } |
| 1029 | 1033 |
| 1030 | 1034 |
| 1031 // TODO(regis): Once this intrinsic is implemented on all architectures, the | 1035 // TODO(regis): Once this intrinsic is implemented on all architectures, the |
| 1032 // corresponding Dart method will be untested. Add a test with --no-intrinsify. | 1036 // corresponding Dart method will be untested. Add a test with --no-intrinsify. |
| 1033 void Intrinsifier::Bigint_mulAdd(Assembler* assembler) { | 1037 void Intrinsifier::Bigint_mulAdd(Assembler* assembler) { |
| 1034 // Pseudo code: | 1038 // Pseudo code: |
| 1035 // static void _mulAdd(Uint32List x_digits, int xi, | 1039 // static void _mulAdd(Uint32List x_digits, int xi, |
| 1036 // Uint32List m_digits, int i, | 1040 // Uint32List m_digits, int i, |
| 1037 // Uint32List a_digits, int j, int n) { | 1041 // Uint32List a_digits, int j, int n) { |
| (...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2104 Isolate::current_tag_offset()); | 2108 Isolate::current_tag_offset()); |
| 2105 // Set return value to Isolate::current_tag_. | 2109 // Set return value to Isolate::current_tag_. |
| 2106 __ movl(EAX, current_tag_addr); | 2110 __ movl(EAX, current_tag_addr); |
| 2107 __ ret(); | 2111 __ ret(); |
| 2108 } | 2112 } |
| 2109 | 2113 |
| 2110 #undef __ | 2114 #undef __ |
| 2111 } // namespace dart | 2115 } // namespace dart |
| 2112 | 2116 |
| 2113 #endif // defined TARGET_ARCH_IA32 | 2117 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |