| 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 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1318 // ECX: IC data object (preserved). | 1318 // ECX: IC data object (preserved). |
| 1319 __ movl(EBX, FieldAddress(ECX, ICData::ic_data_offset())); | 1319 __ movl(EBX, FieldAddress(ECX, ICData::ic_data_offset())); |
| 1320 // EBX: ic_data_array with check entries: classes and target functions. | 1320 // EBX: ic_data_array with check entries: classes and target functions. |
| 1321 __ leal(EBX, FieldAddress(EBX, Array::data_offset())); | 1321 __ leal(EBX, FieldAddress(EBX, Array::data_offset())); |
| 1322 // EBX: points directly to the first ic data array element. | 1322 // EBX: points directly to the first ic data array element. |
| 1323 | 1323 |
| 1324 // Get the receiver's class ID (first read number of arguments from | 1324 // Get the receiver's class ID (first read number of arguments from |
| 1325 // arguments descriptor array and then access the receiver from the stack). | 1325 // arguments descriptor array and then access the receiver from the stack). |
| 1326 __ movl(EAX, FieldAddress(EDX, ArgumentsDescriptor::count_offset())); | 1326 __ movl(EAX, FieldAddress(EDX, ArgumentsDescriptor::count_offset())); |
| 1327 __ movl(EAX, Address(ESP, EAX, TIMES_2, 0)); // EAX (argument_count) is smi. | 1327 __ movl(EAX, Address(ESP, EAX, TIMES_2, 0)); // EAX (argument_count) is smi. |
| 1328 __ LoadTaggedClassIdMayBeSmi(EAX, EAX); | 1328 __ LoadTaggedClassIdMayBeSmi(EAX, EAX, EDI); |
| 1329 | 1329 |
| 1330 // EAX: receiver's class ID (smi). | 1330 // EAX: receiver's class ID (smi). |
| 1331 __ movl(EDI, Address(EBX, 0)); // First class id (smi) to check. | 1331 __ movl(EDI, Address(EBX, 0)); // First class id (smi) to check. |
| 1332 __ jmp(&test); | 1332 __ jmp(&test); |
| 1333 | 1333 |
| 1334 __ Bind(&loop); | 1334 __ Bind(&loop); |
| 1335 for (int i = 0; i < num_args; i++) { | 1335 for (int i = 0; i < num_args; i++) { |
| 1336 if (i > 0) { | 1336 if (i > 0) { |
| 1337 // If not the first, load the next argument's class ID. | 1337 // If not the first, load the next argument's class ID. |
| 1338 __ movl(EAX, FieldAddress(EDX, ArgumentsDescriptor::count_offset())); | 1338 __ movl(EAX, FieldAddress(EDX, ArgumentsDescriptor::count_offset())); |
| 1339 __ movl(EAX, Address(ESP, EAX, TIMES_2, - i * kWordSize)); | 1339 __ movl(EAX, Address(ESP, EAX, TIMES_2, - i * kWordSize)); |
| 1340 __ LoadTaggedClassIdMayBeSmi(EAX, EAX); | 1340 __ LoadTaggedClassIdMayBeSmi(EAX, EAX, EDI); |
| 1341 | 1341 |
| 1342 // EAX: next argument class ID (smi). | 1342 // EAX: next argument class ID (smi). |
| 1343 __ movl(EDI, Address(EBX, i * kWordSize)); | 1343 __ movl(EDI, Address(EBX, i * kWordSize)); |
| 1344 // EDI: next class ID to check (smi). | 1344 // EDI: next class ID to check (smi). |
| 1345 } | 1345 } |
| 1346 __ cmpl(EAX, EDI); // Class id match? | 1346 __ cmpl(EAX, EDI); // Class id match? |
| 1347 if (i < (num_args - 1)) { | 1347 if (i < (num_args - 1)) { |
| 1348 __ j(NOT_EQUAL, &update); // Continue. | 1348 __ j(NOT_EQUAL, &update); // Continue. |
| 1349 } else { | 1349 } else { |
| 1350 // Last check, all checks before matched. | 1350 // Last check, all checks before matched. |
| 1351 __ j(EQUAL, &found, Assembler::kNearJump); // Break. | 1351 __ j(EQUAL, &found, Assembler::kNearJump); // Break. |
| 1352 } | 1352 } |
| 1353 } | 1353 } |
| 1354 __ Bind(&update); | 1354 __ Bind(&update); |
| 1355 // Reload receiver class ID. It has not been destroyed when num_args == 1. | 1355 // Reload receiver class ID. It has not been destroyed when num_args == 1. |
| 1356 if (num_args > 1) { | 1356 if (num_args > 1) { |
| 1357 __ movl(EAX, FieldAddress(EDX, ArgumentsDescriptor::count_offset())); | 1357 __ movl(EAX, FieldAddress(EDX, ArgumentsDescriptor::count_offset())); |
| 1358 __ movl(EAX, Address(ESP, EAX, TIMES_2, 0)); | 1358 __ movl(EAX, Address(ESP, EAX, TIMES_2, 0)); |
| 1359 __ LoadTaggedClassIdMayBeSmi(EAX, EAX); | 1359 __ LoadTaggedClassIdMayBeSmi(EAX, EAX, EDI); |
| 1360 } | 1360 } |
| 1361 | 1361 |
| 1362 const intptr_t entry_size = ICData::TestEntryLengthFor(num_args) * kWordSize; | 1362 const intptr_t entry_size = ICData::TestEntryLengthFor(num_args) * kWordSize; |
| 1363 __ addl(EBX, Immediate(entry_size)); // Next entry. | 1363 __ addl(EBX, Immediate(entry_size)); // Next entry. |
| 1364 __ movl(EDI, Address(EBX, 0)); // Next class ID. | 1364 __ movl(EDI, Address(EBX, 0)); // Next class ID. |
| 1365 | 1365 |
| 1366 __ Bind(&test); | 1366 __ Bind(&test); |
| 1367 __ cmpl(EDI, Immediate(Smi::RawValue(kIllegalCid))); // Done? | 1367 __ cmpl(EDI, Immediate(Smi::RawValue(kIllegalCid))); // Done? |
| 1368 __ j(NOT_EQUAL, &loop, Assembler::kNearJump); | 1368 __ j(NOT_EQUAL, &loop, Assembler::kNearJump); |
| 1369 | 1369 |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1894 const Register temp = ECX; | 1894 const Register temp = ECX; |
| 1895 __ movl(left, Address(ESP, 2 * kWordSize)); | 1895 __ movl(left, Address(ESP, 2 * kWordSize)); |
| 1896 __ movl(right, Address(ESP, 1 * kWordSize)); | 1896 __ movl(right, Address(ESP, 1 * kWordSize)); |
| 1897 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 1897 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 1898 __ ret(); | 1898 __ ret(); |
| 1899 } | 1899 } |
| 1900 | 1900 |
| 1901 } // namespace dart | 1901 } // namespace dart |
| 1902 | 1902 |
| 1903 #endif // defined TARGET_ARCH_IA32 | 1903 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |