| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 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 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1231 intptr_t deopt_id, | 1231 intptr_t deopt_id, |
| 1232 intptr_t token_pos, | 1232 intptr_t token_pos, |
| 1233 LocationSummary* locs) { | 1233 LocationSummary* locs) { |
| 1234 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); | 1234 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); |
| 1235 const String& name = String::Handle(ic_data.target_name()); | 1235 const String& name = String::Handle(ic_data.target_name()); |
| 1236 const Array& arguments_descriptor = | 1236 const Array& arguments_descriptor = |
| 1237 Array::ZoneHandle(ic_data.arguments_descriptor()); | 1237 Array::ZoneHandle(ic_data.arguments_descriptor()); |
| 1238 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); | 1238 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); |
| 1239 const MegamorphicCache& cache = | 1239 const MegamorphicCache& cache = |
| 1240 MegamorphicCache::ZoneHandle(table->Lookup(name, arguments_descriptor)); | 1240 MegamorphicCache::ZoneHandle(table->Lookup(name, arguments_descriptor)); |
| 1241 Label not_smi, load_cache; | |
| 1242 __ LoadFromOffset(R0, SP, (argument_count - 1) * kWordSize, PP); | 1241 __ LoadFromOffset(R0, SP, (argument_count - 1) * kWordSize, PP); |
| 1243 __ tsti(R0, kSmiTagMask); | 1242 __ LoadTaggedClassIdMayBeSmi(R0, R0); |
| 1244 __ b(¬_smi, NE); | |
| 1245 __ LoadImmediate(R0, Smi::RawValue(kSmiCid), PP); | |
| 1246 __ b(&load_cache); | |
| 1247 | |
| 1248 __ Bind(¬_smi); | |
| 1249 __ LoadClassId(R0, R0, PP); | |
| 1250 __ SmiTag(R0); | |
| 1251 | 1243 |
| 1252 // R0: class ID of the receiver (smi). | 1244 // R0: class ID of the receiver (smi). |
| 1253 __ Bind(&load_cache); | |
| 1254 __ LoadObject(R1, cache, PP); | 1245 __ LoadObject(R1, cache, PP); |
| 1255 __ LoadFieldFromOffset(R2, R1, MegamorphicCache::buckets_offset(), PP); | 1246 __ LoadFieldFromOffset(R2, R1, MegamorphicCache::buckets_offset(), PP); |
| 1256 __ LoadFieldFromOffset(R1, R1, MegamorphicCache::mask_offset(), PP); | 1247 __ LoadFieldFromOffset(R1, R1, MegamorphicCache::mask_offset(), PP); |
| 1257 // R2: cache buckets array. | 1248 // R2: cache buckets array. |
| 1258 // R1: mask. | 1249 // R1: mask. |
| 1259 __ mov(R3, R0); | 1250 __ mov(R3, R0); |
| 1260 | 1251 |
| 1261 Label loop, update, call_target_function; | 1252 Label loop, update, call_target_function; |
| 1262 __ b(&loop); | 1253 __ b(&loop); |
| 1263 | 1254 |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1734 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 1725 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
| 1735 UNIMPLEMENTED(); | 1726 UNIMPLEMENTED(); |
| 1736 } | 1727 } |
| 1737 | 1728 |
| 1738 | 1729 |
| 1739 #undef __ | 1730 #undef __ |
| 1740 | 1731 |
| 1741 } // namespace dart | 1732 } // namespace dart |
| 1742 | 1733 |
| 1743 #endif // defined TARGET_ARCH_ARM64 | 1734 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |