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