| 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" // Needed here to get TARGET_ARCH_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
| (...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 intptr_t deopt_id, | 1272 intptr_t deopt_id, |
| 1273 intptr_t token_pos, | 1273 intptr_t token_pos, |
| 1274 LocationSummary* locs) { | 1274 LocationSummary* locs) { |
| 1275 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); | 1275 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); |
| 1276 const String& name = String::Handle(ic_data.target_name()); | 1276 const String& name = String::Handle(ic_data.target_name()); |
| 1277 const Array& arguments_descriptor = | 1277 const Array& arguments_descriptor = |
| 1278 Array::ZoneHandle(ic_data.arguments_descriptor()); | 1278 Array::ZoneHandle(ic_data.arguments_descriptor()); |
| 1279 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); | 1279 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); |
| 1280 const MegamorphicCache& cache = | 1280 const MegamorphicCache& cache = |
| 1281 MegamorphicCache::ZoneHandle(table->Lookup(name, arguments_descriptor)); | 1281 MegamorphicCache::ZoneHandle(table->Lookup(name, arguments_descriptor)); |
| 1282 Label not_smi, load_cache; | 1282 Label load_cache; |
| 1283 __ movl(EAX, Address(ESP, (argument_count - 1) * kWordSize)); | 1283 __ movl(EAX, Address(ESP, (argument_count - 1) * kWordSize)); |
| 1284 __ testl(EAX, Immediate(kSmiTagMask)); | 1284 __ LoadTaggedClassIdMayBeSmi(EAX, EAX); |
| 1285 __ j(NOT_ZERO, ¬_smi, Assembler::kNearJump); | |
| 1286 __ movl(EAX, Immediate(Smi::RawValue(kSmiCid))); | |
| 1287 __ jmp(&load_cache); | |
| 1288 | |
| 1289 __ Bind(¬_smi); | |
| 1290 __ LoadClassId(EAX, EAX); | |
| 1291 __ SmiTag(EAX); | |
| 1292 | 1285 |
| 1293 // EAX: class ID of the receiver (smi). | 1286 // EAX: class ID of the receiver (smi). |
| 1294 __ Bind(&load_cache); | 1287 __ Bind(&load_cache); |
| 1295 __ LoadObject(EBX, cache); | 1288 __ LoadObject(EBX, cache); |
| 1296 __ movl(EDI, FieldAddress(EBX, MegamorphicCache::buckets_offset())); | 1289 __ movl(EDI, FieldAddress(EBX, MegamorphicCache::buckets_offset())); |
| 1297 __ movl(EBX, FieldAddress(EBX, MegamorphicCache::mask_offset())); | 1290 __ movl(EBX, FieldAddress(EBX, MegamorphicCache::mask_offset())); |
| 1298 // EDI: cache buckets array. | 1291 // EDI: cache buckets array. |
| 1299 // EBX: mask. | 1292 // EBX: mask. |
| 1300 __ movl(ECX, EAX); | 1293 __ movl(ECX, EAX); |
| 1301 | 1294 |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1763 __ movups(reg, Address(ESP, 0)); | 1756 __ movups(reg, Address(ESP, 0)); |
| 1764 __ addl(ESP, Immediate(kFpuRegisterSize)); | 1757 __ addl(ESP, Immediate(kFpuRegisterSize)); |
| 1765 } | 1758 } |
| 1766 | 1759 |
| 1767 | 1760 |
| 1768 #undef __ | 1761 #undef __ |
| 1769 | 1762 |
| 1770 } // namespace dart | 1763 } // namespace dart |
| 1771 | 1764 |
| 1772 #endif // defined TARGET_ARCH_IA32 | 1765 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |