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

Side by Side Diff: runtime/vm/flow_graph_compiler_ia32.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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 intptr_t deopt_id, 1275 intptr_t deopt_id,
1276 intptr_t token_pos, 1276 intptr_t token_pos,
1277 LocationSummary* locs) { 1277 LocationSummary* locs) {
1278 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); 1278 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table();
1279 const String& name = String::Handle(ic_data.target_name()); 1279 const String& name = String::Handle(ic_data.target_name());
1280 const Array& arguments_descriptor = 1280 const Array& arguments_descriptor =
1281 Array::ZoneHandle(ic_data.arguments_descriptor()); 1281 Array::ZoneHandle(ic_data.arguments_descriptor());
1282 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); 1282 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0));
1283 const MegamorphicCache& cache = 1283 const MegamorphicCache& cache =
1284 MegamorphicCache::ZoneHandle(table->Lookup(name, arguments_descriptor)); 1284 MegamorphicCache::ZoneHandle(table->Lookup(name, arguments_descriptor));
1285 Label not_smi, load_cache; 1285 Label load_cache;
1286 __ movl(EAX, Address(ESP, (argument_count - 1) * kWordSize)); 1286 __ movl(EAX, Address(ESP, (argument_count - 1) * kWordSize));
1287 __ testl(EAX, Immediate(kSmiTagMask)); 1287 __ LoadTaggedClassIdMayBeSmi(EAX, EAX);
1288 __ j(NOT_ZERO, &not_smi, Assembler::kNearJump);
1289 __ movl(EAX, Immediate(Smi::RawValue(kSmiCid)));
1290 __ jmp(&load_cache);
1291
1292 __ Bind(&not_smi);
1293 __ LoadClassId(EAX, EAX);
1294 __ SmiTag(EAX);
1295 1288
1296 // EAX: class ID of the receiver (smi). 1289 // EAX: class ID of the receiver (smi).
1297 __ Bind(&load_cache); 1290 __ Bind(&load_cache);
1298 __ LoadObject(EBX, cache); 1291 __ LoadObject(EBX, cache);
1299 __ movl(EDI, FieldAddress(EBX, MegamorphicCache::buckets_offset())); 1292 __ movl(EDI, FieldAddress(EBX, MegamorphicCache::buckets_offset()));
1300 __ movl(EBX, FieldAddress(EBX, MegamorphicCache::mask_offset())); 1293 __ movl(EBX, FieldAddress(EBX, MegamorphicCache::mask_offset()));
1301 // EDI: cache buckets array. 1294 // EDI: cache buckets array.
1302 // EBX: mask. 1295 // EBX: mask.
1303 __ movl(ECX, EAX); 1296 __ movl(ECX, EAX);
1304 1297
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
1766 __ movups(reg, Address(ESP, 0)); 1759 __ movups(reg, Address(ESP, 0));
1767 __ addl(ESP, Immediate(kFpuRegisterSize)); 1760 __ addl(ESP, Immediate(kFpuRegisterSize));
1768 } 1761 }
1769 1762
1770 1763
1771 #undef __ 1764 #undef __
1772 1765
1773 } // namespace dart 1766 } // namespace dart
1774 1767
1775 #endif // defined TARGET_ARCH_IA32 1768 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698