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

Side by Side Diff: runtime/vm/flow_graph_compiler_arm64.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) 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 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 intptr_t deopt_id, 1235 intptr_t deopt_id,
1236 intptr_t token_pos, 1236 intptr_t token_pos,
1237 LocationSummary* locs) { 1237 LocationSummary* locs) {
1238 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); 1238 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table();
1239 const String& name = String::Handle(ic_data.target_name()); 1239 const String& name = String::Handle(ic_data.target_name());
1240 const Array& arguments_descriptor = 1240 const Array& arguments_descriptor =
1241 Array::ZoneHandle(ic_data.arguments_descriptor()); 1241 Array::ZoneHandle(ic_data.arguments_descriptor());
1242 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); 1242 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0));
1243 const MegamorphicCache& cache = 1243 const MegamorphicCache& cache =
1244 MegamorphicCache::ZoneHandle(table->Lookup(name, arguments_descriptor)); 1244 MegamorphicCache::ZoneHandle(table->Lookup(name, arguments_descriptor));
1245 Label not_smi, load_cache;
1246 __ LoadFromOffset(R0, SP, (argument_count - 1) * kWordSize, PP); 1245 __ LoadFromOffset(R0, SP, (argument_count - 1) * kWordSize, PP);
1247 __ tsti(R0, kSmiTagMask); 1246 __ LoadTaggedClassIdMayBeSmi(R0, R0);
1248 __ b(&not_smi, NE);
1249 __ LoadImmediate(R0, Smi::RawValue(kSmiCid), PP);
1250 __ b(&load_cache);
1251
1252 __ Bind(&not_smi);
1253 __ LoadClassId(R0, R0, PP);
1254 __ SmiTag(R0);
1255 1247
1256 // R0: class ID of the receiver (smi). 1248 // R0: class ID of the receiver (smi).
1257 __ Bind(&load_cache);
1258 __ LoadObject(R1, cache, PP); 1249 __ LoadObject(R1, cache, PP);
1259 __ LoadFieldFromOffset(R2, R1, MegamorphicCache::buckets_offset(), PP); 1250 __ LoadFieldFromOffset(R2, R1, MegamorphicCache::buckets_offset(), PP);
1260 __ LoadFieldFromOffset(R1, R1, MegamorphicCache::mask_offset(), PP); 1251 __ LoadFieldFromOffset(R1, R1, MegamorphicCache::mask_offset(), PP);
1261 // R2: cache buckets array. 1252 // R2: cache buckets array.
1262 // R1: mask. 1253 // R1: mask.
1263 __ mov(R3, R0); 1254 __ mov(R3, R0);
1264 1255
1265 Label loop, update, call_target_function; 1256 Label loop, update, call_target_function;
1266 __ b(&loop); 1257 __ b(&loop);
1267 1258
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1738 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { 1729 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
1739 UNIMPLEMENTED(); 1730 UNIMPLEMENTED();
1740 } 1731 }
1741 1732
1742 1733
1743 #undef __ 1734 #undef __
1744 1735
1745 } // namespace dart 1736 } // namespace dart
1746 1737
1747 #endif // defined TARGET_ARCH_ARM64 1738 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698