Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Side by Side Diff: runtime/vm/flow_graph_compiler_mips.cc

Issue 313083008: Add LoadTaggedClassIdMayBeSmi to assembly and improve performance of inline cache stubs. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 intptr_t deopt_id, 1269 intptr_t deopt_id,
1270 intptr_t token_pos, 1270 intptr_t token_pos,
1271 LocationSummary* locs) { 1271 LocationSummary* locs) {
1272 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); 1272 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table();
1273 const String& name = String::Handle(ic_data.target_name()); 1273 const String& name = String::Handle(ic_data.target_name());
1274 const Array& arguments_descriptor = 1274 const Array& arguments_descriptor =
1275 Array::ZoneHandle(ic_data.arguments_descriptor()); 1275 Array::ZoneHandle(ic_data.arguments_descriptor());
1276 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); 1276 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0));
1277 const MegamorphicCache& cache = 1277 const MegamorphicCache& cache =
1278 MegamorphicCache::ZoneHandle(table->Lookup(name, arguments_descriptor)); 1278 MegamorphicCache::ZoneHandle(table->Lookup(name, arguments_descriptor));
1279 Label not_smi, load_cache;
1280 __ TraceSimMsg("MegamorphicInstanceCall"); 1279 __ TraceSimMsg("MegamorphicInstanceCall");
1281 __ lw(T0, Address(SP, (argument_count - 1) * kWordSize)); 1280 __ lw(T0, Address(SP, (argument_count - 1) * kWordSize));
1282 __ andi(CMPRES1, T0, Immediate(kSmiTagMask)); 1281 __ LoadTaggedClassIdMayBeSmi(T0, T0);
1283 __ bne(CMPRES1, ZR, &not_smi);
1284 __ LoadImmediate(T0, Smi::RawValue(kSmiCid));
1285 __ b(&load_cache);
1286
1287 __ Bind(&not_smi);
1288 __ LoadClassId(T0, T0);
1289 __ SmiTag(T0);
1290 1282
1291 // T0: class ID of the receiver (smi). 1283 // T0: class ID of the receiver (smi).
1292 __ Bind(&load_cache);
1293 __ LoadObject(T1, cache); 1284 __ LoadObject(T1, cache);
1294 __ lw(T2, FieldAddress(T1, MegamorphicCache::buckets_offset())); 1285 __ lw(T2, FieldAddress(T1, MegamorphicCache::buckets_offset()));
1295 __ lw(T1, FieldAddress(T1, MegamorphicCache::mask_offset())); 1286 __ lw(T1, FieldAddress(T1, MegamorphicCache::mask_offset()));
1296 // T2: cache buckets array. 1287 // T2: cache buckets array.
1297 // T1: mask. 1288 // T1: mask.
1298 __ mov(T3, T0); 1289 __ mov(T3, T0);
1299 1290
1300 Label loop, update, call_target_function; 1291 Label loop, update, call_target_function;
1301 __ b(&loop); 1292 __ b(&loop);
1302 1293
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
1819 __ AddImmediate(SP, kDoubleSize); 1810 __ AddImmediate(SP, kDoubleSize);
1820 } 1811 }
1821 1812
1822 1813
1823 #undef __ 1814 #undef __
1824 1815
1825 1816
1826 } // namespace dart 1817 } // namespace dart
1827 1818
1828 #endif // defined TARGET_ARCH_MIPS 1819 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698