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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 // For now handle only TypeArguments and bail out if InstantiatedTypeArgs. | 208 // For now handle only TypeArguments and bail out if InstantiatedTypeArgs. |
209 __ CompareClassId(EBX, kTypeArgumentsCid, EAX); | 209 __ CompareClassId(EBX, kTypeArgumentsCid, EAX); |
210 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); | 210 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); |
211 // Get type at index 0. | 211 // Get type at index 0. |
212 __ movl(EAX, FieldAddress(EBX, TypeArguments::type_at_offset(0))); | 212 __ movl(EAX, FieldAddress(EBX, TypeArguments::type_at_offset(0))); |
213 __ CompareObject(EAX, Type::ZoneHandle(Type::DynamicType())); | 213 __ CompareObject(EAX, Type::ZoneHandle(Type::DynamicType())); |
214 __ j(EQUAL, &checked_ok, Assembler::kNearJump); | 214 __ j(EQUAL, &checked_ok, Assembler::kNearJump); |
215 // Check for int and num. | 215 // Check for int and num. |
216 __ testl(EDI, Immediate(kSmiTagMask)); // Value is Smi? | 216 __ testl(EDI, Immediate(kSmiTagMask)); // Value is Smi? |
217 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); // Non-smi value. | 217 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); // Non-smi value. |
218 __ CompareObject(EAX, Type::ZoneHandle(Type::IntInterface())); | 218 __ CompareObject(EAX, Type::ZoneHandle(Type::IntType())); |
219 __ j(EQUAL, &checked_ok, Assembler::kNearJump); | 219 __ j(EQUAL, &checked_ok, Assembler::kNearJump); |
220 __ CompareObject(EAX, Type::ZoneHandle(Type::Number())); | 220 __ CompareObject(EAX, Type::ZoneHandle(Type::Number())); |
221 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); | 221 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); |
222 __ Bind(&checked_ok); | 222 __ Bind(&checked_ok); |
223 } | 223 } |
224 __ movl(EBX, Address(ESP, + 2 * kWordSize)); // Index. | 224 __ movl(EBX, Address(ESP, + 2 * kWordSize)); // Index. |
225 __ testl(EBX, Immediate(kSmiTagMask)); | 225 __ testl(EBX, Immediate(kSmiTagMask)); |
226 // Index not Smi. | 226 // Index not Smi. |
227 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); | 227 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); |
228 __ movl(EAX, Address(ESP, + 3 * kWordSize)); // Array. | 228 __ movl(EAX, Address(ESP, + 3 * kWordSize)); // Array. |
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1423 __ Bind(&is_true); | 1423 __ Bind(&is_true); |
1424 __ LoadObject(EAX, bool_true); | 1424 __ LoadObject(EAX, bool_true); |
1425 __ ret(); | 1425 __ ret(); |
1426 return true; | 1426 return true; |
1427 } | 1427 } |
1428 | 1428 |
1429 #undef __ | 1429 #undef __ |
1430 } // namespace dart | 1430 } // namespace dart |
1431 | 1431 |
1432 #endif // defined TARGET_ARCH_IA32 | 1432 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |