| 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 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 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1265 intptr_t deopt_id, | 1265 intptr_t deopt_id, |
| 1266 intptr_t token_pos, | 1266 intptr_t token_pos, |
| 1267 LocationSummary* locs) { | 1267 LocationSummary* locs) { |
| 1268 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); | 1268 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); |
| 1269 const String& name = String::Handle(ic_data.target_name()); | 1269 const String& name = String::Handle(ic_data.target_name()); |
| 1270 const Array& arguments_descriptor = | 1270 const Array& arguments_descriptor = |
| 1271 Array::ZoneHandle(ic_data.arguments_descriptor()); | 1271 Array::ZoneHandle(ic_data.arguments_descriptor()); |
| 1272 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); | 1272 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); |
| 1273 const MegamorphicCache& cache = | 1273 const MegamorphicCache& cache = |
| 1274 MegamorphicCache::ZoneHandle(table->Lookup(name, arguments_descriptor)); | 1274 MegamorphicCache::ZoneHandle(table->Lookup(name, arguments_descriptor)); |
| 1275 Label not_smi, load_cache; | |
| 1276 __ TraceSimMsg("MegamorphicInstanceCall"); | 1275 __ TraceSimMsg("MegamorphicInstanceCall"); |
| 1277 __ lw(T0, Address(SP, (argument_count - 1) * kWordSize)); | 1276 __ lw(T0, Address(SP, (argument_count - 1) * kWordSize)); |
| 1278 __ andi(CMPRES1, T0, Immediate(kSmiTagMask)); | 1277 __ LoadTaggedClassIdMayBeSmi(T0, T0); |
| 1279 __ bne(CMPRES1, ZR, ¬_smi); | |
| 1280 __ LoadImmediate(T0, Smi::RawValue(kSmiCid)); | |
| 1281 __ b(&load_cache); | |
| 1282 | |
| 1283 __ Bind(¬_smi); | |
| 1284 __ LoadClassId(T0, T0); | |
| 1285 __ SmiTag(T0); | |
| 1286 | 1278 |
| 1287 // T0: class ID of the receiver (smi). | 1279 // T0: class ID of the receiver (smi). |
| 1288 __ Bind(&load_cache); | |
| 1289 __ LoadObject(T1, cache); | 1280 __ LoadObject(T1, cache); |
| 1290 __ lw(T2, FieldAddress(T1, MegamorphicCache::buckets_offset())); | 1281 __ lw(T2, FieldAddress(T1, MegamorphicCache::buckets_offset())); |
| 1291 __ lw(T1, FieldAddress(T1, MegamorphicCache::mask_offset())); | 1282 __ lw(T1, FieldAddress(T1, MegamorphicCache::mask_offset())); |
| 1292 // T2: cache buckets array. | 1283 // T2: cache buckets array. |
| 1293 // T1: mask. | 1284 // T1: mask. |
| 1294 __ mov(T3, T0); | 1285 __ mov(T3, T0); |
| 1295 | 1286 |
| 1296 Label loop, update, call_target_function; | 1287 Label loop, update, call_target_function; |
| 1297 __ b(&loop); | 1288 __ b(&loop); |
| 1298 | 1289 |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1815 __ AddImmediate(SP, kDoubleSize); | 1806 __ AddImmediate(SP, kDoubleSize); |
| 1816 } | 1807 } |
| 1817 | 1808 |
| 1818 | 1809 |
| 1819 #undef __ | 1810 #undef __ |
| 1820 | 1811 |
| 1821 | 1812 |
| 1822 } // namespace dart | 1813 } // namespace dart |
| 1823 | 1814 |
| 1824 #endif // defined TARGET_ARCH_MIPS | 1815 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |