| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // Null value is valid for any type. | 198 // Null value is valid for any type. |
| 199 __ cmpl(EDI, raw_null); | 199 __ cmpl(EDI, raw_null); |
| 200 __ j(EQUAL, &checked_ok, Assembler::kNearJump); | 200 __ j(EQUAL, &checked_ok, Assembler::kNearJump); |
| 201 | 201 |
| 202 __ movl(EBX, Address(ESP, + 3 * kWordSize)); // Array. | 202 __ movl(EBX, Address(ESP, + 3 * kWordSize)); // Array. |
| 203 __ movl(EBX, FieldAddress(EBX, type_args_field_offset)); | 203 __ movl(EBX, FieldAddress(EBX, type_args_field_offset)); |
| 204 // EBX: Type arguments of array. | 204 // EBX: Type arguments of array. |
| 205 __ cmpl(EBX, raw_null); | 205 __ cmpl(EBX, raw_null); |
| 206 __ j(EQUAL, &checked_ok, Assembler::kNearJump); | 206 __ j(EQUAL, &checked_ok, Assembler::kNearJump); |
| 207 // Check if it's dynamic. | 207 // Check if it's dynamic. |
| 208 // For now handle only TypeArguments and bail out if InstantiatedTypeArgs. | |
| 209 __ CompareClassId(EBX, kTypeArgumentsCid, EAX); | |
| 210 __ j(NOT_EQUAL, &fall_through); | |
| 211 // Get type at index 0. | 208 // Get type at index 0. |
| 212 __ movl(EAX, FieldAddress(EBX, TypeArguments::type_at_offset(0))); | 209 __ movl(EAX, FieldAddress(EBX, TypeArguments::type_at_offset(0))); |
| 213 __ CompareObject(EAX, Type::ZoneHandle(Type::DynamicType())); | 210 __ CompareObject(EAX, Type::ZoneHandle(Type::DynamicType())); |
| 214 __ j(EQUAL, &checked_ok, Assembler::kNearJump); | 211 __ j(EQUAL, &checked_ok, Assembler::kNearJump); |
| 215 // Check for int and num. | 212 // Check for int and num. |
| 216 __ testl(EDI, Immediate(kSmiTagMask)); // Value is Smi? | 213 __ testl(EDI, Immediate(kSmiTagMask)); // Value is Smi? |
| 217 __ j(NOT_ZERO, &fall_through); // Non-smi value. | 214 __ j(NOT_ZERO, &fall_through); // Non-smi value. |
| 218 __ CompareObject(EAX, Type::ZoneHandle(Type::IntType())); | 215 __ CompareObject(EAX, Type::ZoneHandle(Type::IntType())); |
| 219 __ j(EQUAL, &checked_ok, Assembler::kNearJump); | 216 __ j(EQUAL, &checked_ok, Assembler::kNearJump); |
| 220 __ CompareObject(EAX, Type::ZoneHandle(Type::Number())); | 217 __ CompareObject(EAX, Type::ZoneHandle(Type::Number())); |
| (...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1739 | 1736 |
| 1740 | 1737 |
| 1741 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { | 1738 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { |
| 1742 StringEquality(assembler, kTwoByteStringCid); | 1739 StringEquality(assembler, kTwoByteStringCid); |
| 1743 } | 1740 } |
| 1744 | 1741 |
| 1745 #undef __ | 1742 #undef __ |
| 1746 } // namespace dart | 1743 } // namespace dart |
| 1747 | 1744 |
| 1748 #endif // defined TARGET_ARCH_IA32 | 1745 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |