| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 239 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 240 Label checked_ok; | 240 Label checked_ok; |
| 241 __ movl(EDI, Address(ESP, + 1 * kWordSize)); // Value. | 241 __ movl(EDI, Address(ESP, + 1 * kWordSize)); // Value. |
| 242 // Null value is valid for any type. | 242 // Null value is valid for any type. |
| 243 __ cmpl(EDI, raw_null); | 243 __ cmpl(EDI, raw_null); |
| 244 __ j(EQUAL, &checked_ok, Assembler::kNearJump); | 244 __ j(EQUAL, &checked_ok, Assembler::kNearJump); |
| 245 | 245 |
| 246 __ movl(EBX, Address(ESP, + 3 * kWordSize)); // Array. | 246 __ movl(EBX, Address(ESP, + 3 * kWordSize)); // Array. |
| 247 __ movl(EBX, FieldAddress(EBX, type_args_field_offset)); | 247 __ movl(EBX, FieldAddress(EBX, type_args_field_offset)); |
| 248 // EBX: Type arguments of array. | 248 // EBX: Type arguments of array. |
| 249 __ cmpl(EBX, raw_null); |
| 250 __ j(EQUAL, &checked_ok, Assembler::kNearJump); |
| 251 // Check if it's Dynamic. |
| 252 // For now handle only TypeArguments and bail out if InstantiatedTypeArgs. |
| 249 __ movl(EAX, FieldAddress(EBX, Object::class_offset())); | 253 __ movl(EAX, FieldAddress(EBX, Object::class_offset())); |
| 250 // Check if it's Dynamic. | |
| 251 __ cmpl(EAX, raw_null); | |
| 252 __ j(EQUAL, &checked_ok, Assembler::kNearJump); | |
| 253 // For now handle only TypeArguments and bail out if InstantiatedTypeArgs. | |
| 254 __ CompareObject(EAX, Object::ZoneHandle(Object::type_arguments_class())); | 254 __ CompareObject(EAX, Object::ZoneHandle(Object::type_arguments_class())); |
| 255 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); | 255 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); |
| 256 // Get type at index 0. | 256 // Get type at index 0. |
| 257 __ movl(EAX, FieldAddress(EBX, TypeArguments::type_at_offset(0))); | 257 __ movl(EAX, FieldAddress(EBX, TypeArguments::type_at_offset(0))); |
| 258 __ CompareObject(EAX, Type::ZoneHandle(Type::DynamicType())); | 258 __ CompareObject(EAX, Type::ZoneHandle(Type::DynamicType())); |
| 259 __ j(EQUAL, &checked_ok, Assembler::kNearJump); | 259 __ j(EQUAL, &checked_ok, Assembler::kNearJump); |
| 260 // Check for int and num. | 260 // Check for int and num. |
| 261 __ testl(EDI, Immediate(kSmiTagMask)); // Value is Smi? | 261 __ testl(EDI, Immediate(kSmiTagMask)); // Value is Smi? |
| 262 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); // Non-smi value. | 262 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); // Non-smi value. |
| 263 __ CompareObject(EAX, Type::ZoneHandle(Type::IntInterface())); | 263 __ CompareObject(EAX, Type::ZoneHandle(Type::IntInterface())); |
| (...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 } \ | 1289 } \ |
| 1290 | 1290 |
| 1291 INTRINSIC_LIST(FIND_INTRINSICS); | 1291 INTRINSIC_LIST(FIND_INTRINSICS); |
| 1292 #undef FIND_INTRINSICS | 1292 #undef FIND_INTRINSICS |
| 1293 return false; | 1293 return false; |
| 1294 } | 1294 } |
| 1295 | 1295 |
| 1296 } // namespace dart | 1296 } // namespace dart |
| 1297 | 1297 |
| 1298 #endif // defined TARGET_ARCH_IA32 | 1298 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |