| 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 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 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 intptr_t deopt_id, | 1310 intptr_t deopt_id, |
| 1311 intptr_t token_pos, | 1311 intptr_t token_pos, |
| 1312 LocationSummary* locs) { | 1312 LocationSummary* locs) { |
| 1313 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); | 1313 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); |
| 1314 const String& name = String::Handle(ic_data.target_name()); | 1314 const String& name = String::Handle(ic_data.target_name()); |
| 1315 const Array& arguments_descriptor = | 1315 const Array& arguments_descriptor = |
| 1316 Array::ZoneHandle(ic_data.arguments_descriptor()); | 1316 Array::ZoneHandle(ic_data.arguments_descriptor()); |
| 1317 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); | 1317 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); |
| 1318 const MegamorphicCache& cache = | 1318 const MegamorphicCache& cache = |
| 1319 MegamorphicCache::ZoneHandle(table->Lookup(name, arguments_descriptor)); | 1319 MegamorphicCache::ZoneHandle(table->Lookup(name, arguments_descriptor)); |
| 1320 Label not_smi, load_cache; | |
| 1321 __ movq(RAX, Address(RSP, (argument_count - 1) * kWordSize)); | 1320 __ movq(RAX, Address(RSP, (argument_count - 1) * kWordSize)); |
| 1322 __ testq(RAX, Immediate(kSmiTagMask)); | 1321 __ LoadTaggedClassIdMayBeSmi(RAX, RAX); |
| 1323 __ j(NOT_ZERO, ¬_smi, Assembler::kNearJump); | |
| 1324 __ LoadImmediate(RAX, Immediate(Smi::RawValue(kSmiCid)), PP); | |
| 1325 __ jmp(&load_cache); | |
| 1326 | |
| 1327 __ Bind(¬_smi); | |
| 1328 __ LoadClassId(RAX, RAX); | |
| 1329 __ SmiTag(RAX); | |
| 1330 | 1322 |
| 1331 // RAX: class ID of the receiver (smi). | 1323 // RAX: class ID of the receiver (smi). |
| 1332 __ Bind(&load_cache); | |
| 1333 __ LoadObject(RBX, cache, PP); | 1324 __ LoadObject(RBX, cache, PP); |
| 1334 __ movq(RDI, FieldAddress(RBX, MegamorphicCache::buckets_offset())); | 1325 __ movq(RDI, FieldAddress(RBX, MegamorphicCache::buckets_offset())); |
| 1335 __ movq(RBX, FieldAddress(RBX, MegamorphicCache::mask_offset())); | 1326 __ movq(RBX, FieldAddress(RBX, MegamorphicCache::mask_offset())); |
| 1336 // RDI: cache buckets array. | 1327 // RDI: cache buckets array. |
| 1337 // RBX: mask. | 1328 // RBX: mask. |
| 1338 __ movq(RCX, RAX); | 1329 __ movq(RCX, RAX); |
| 1339 | 1330 |
| 1340 Label loop, update, call_target_function; | 1331 Label loop, update, call_target_function; |
| 1341 __ jmp(&loop); | 1332 __ jmp(&loop); |
| 1342 | 1333 |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1770 __ movups(reg, Address(RSP, 0)); | 1761 __ movups(reg, Address(RSP, 0)); |
| 1771 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); | 1762 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); |
| 1772 } | 1763 } |
| 1773 | 1764 |
| 1774 | 1765 |
| 1775 #undef __ | 1766 #undef __ |
| 1776 | 1767 |
| 1777 } // namespace dart | 1768 } // namespace dart |
| 1778 | 1769 |
| 1779 #endif // defined TARGET_ARCH_X64 | 1770 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |