| 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 #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/assembler_macros.h" | 9 #include "vm/assembler_macros.h" |
| 10 #include "vm/code_generator.h" | 10 #include "vm/code_generator.h" |
| (...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1584 // 'num_args_tested' is stored as an untagged int. | 1584 // 'num_args_tested' is stored as an untagged int. |
| 1585 __ movl(EBX, FieldAddress(ECX, ICData::num_args_tested_offset())); | 1585 __ movl(EBX, FieldAddress(ECX, ICData::num_args_tested_offset())); |
| 1586 __ cmpl(EBX, Immediate(num_args)); | 1586 __ cmpl(EBX, Immediate(num_args)); |
| 1587 __ j(EQUAL, &ok, Assembler::kNearJump); | 1587 __ j(EQUAL, &ok, Assembler::kNearJump); |
| 1588 __ Stop("Incorrect stub for IC data"); | 1588 __ Stop("Incorrect stub for IC data"); |
| 1589 __ Bind(&ok); | 1589 __ Bind(&ok); |
| 1590 } | 1590 } |
| 1591 #endif // DEBUG | 1591 #endif // DEBUG |
| 1592 | 1592 |
| 1593 // Loop that checks if there is an IC data match. | 1593 // Loop that checks if there is an IC data match. |
| 1594 // EAX: receiver's class. | |
| 1595 // ECX: IC data object (preserved). | 1594 // ECX: IC data object (preserved). |
| 1596 __ movl(EBX, FieldAddress(ECX, ICData::ic_data_offset())); | 1595 __ movl(EBX, FieldAddress(ECX, ICData::ic_data_offset())); |
| 1597 // EBX: ic_data_array with check entries: classes and target functions. | 1596 // EBX: ic_data_array with check entries: classes and target functions. |
| 1598 __ leal(EBX, FieldAddress(EBX, Array::data_offset())); | 1597 __ leal(EBX, FieldAddress(EBX, Array::data_offset())); |
| 1599 // EBX: points directly to the first ic data array element. | 1598 // EBX: points directly to the first ic data array element. |
| 1600 Label loop, found; | 1599 Label loop, found; |
| 1601 if (num_args == 1) { | 1600 if (num_args == 1) { |
| 1602 __ call(&get_class); | 1601 __ call(&get_class); |
| 1603 // EAX: receiver's class | 1602 // EAX: receiver's class |
| 1604 __ Bind(&loop); | 1603 __ Bind(&loop); |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1892 // TOS + 2: instance. | 1891 // TOS + 2: instance. |
| 1893 // TOS + 3: cache array. | 1892 // TOS + 3: cache array. |
| 1894 // Result in ECX: null -> not found, otherwise result (true or false). | 1893 // Result in ECX: null -> not found, otherwise result (true or false). |
| 1895 void StubCode::GenerateSubtype3TestCacheStub(Assembler* assembler) { | 1894 void StubCode::GenerateSubtype3TestCacheStub(Assembler* assembler) { |
| 1896 GenerateSubtypeNTestCacheStub(assembler, 3); | 1895 GenerateSubtypeNTestCacheStub(assembler, 3); |
| 1897 } | 1896 } |
| 1898 | 1897 |
| 1899 } // namespace dart | 1898 } // namespace dart |
| 1900 | 1899 |
| 1901 #endif // defined TARGET_ARCH_IA32 | 1900 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |