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_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 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1289 __ Drop(argument_count); | 1289 __ Drop(argument_count); |
1290 } | 1290 } |
1291 | 1291 |
1292 | 1292 |
1293 void FlowGraphCompiler::EmitMegamorphicInstanceCall( | 1293 void FlowGraphCompiler::EmitMegamorphicInstanceCall( |
1294 const ICData& ic_data, | 1294 const ICData& ic_data, |
1295 intptr_t argument_count, | 1295 intptr_t argument_count, |
1296 intptr_t deopt_id, | 1296 intptr_t deopt_id, |
1297 intptr_t token_pos, | 1297 intptr_t token_pos, |
1298 LocationSummary* locs) { | 1298 LocationSummary* locs) { |
1299 MegamorphicCacheTable* table = isolate()->megamorphic_cache_table(); | |
1300 const String& name = String::Handle(zone(), ic_data.target_name()); | 1299 const String& name = String::Handle(zone(), ic_data.target_name()); |
1301 const Array& arguments_descriptor = | 1300 const Array& arguments_descriptor = |
1302 Array::ZoneHandle(zone(), ic_data.arguments_descriptor()); | 1301 Array::ZoneHandle(zone(), ic_data.arguments_descriptor()); |
1303 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); | 1302 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); |
1304 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(), | 1303 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(), |
1305 table->Lookup(name, arguments_descriptor)); | 1304 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor)); |
1306 const Register receiverR = EDI; | 1305 const Register receiverR = EDI; |
1307 const Register cacheR = EBX; | 1306 const Register cacheR = EBX; |
1308 const Register targetR = EBX; | 1307 const Register targetR = EBX; |
1309 __ movl(receiverR, Address(ESP, (argument_count - 1) * kWordSize)); | 1308 __ movl(receiverR, Address(ESP, (argument_count - 1) * kWordSize)); |
1310 __ LoadObject(cacheR, cache); | 1309 __ LoadObject(cacheR, cache); |
1311 | 1310 |
1312 if (FLAG_use_megamorphic_stub) { | 1311 if (FLAG_use_megamorphic_stub) { |
1313 __ Call(*StubCode::MegamorphicLookup_entry()); | 1312 __ Call(*StubCode::MegamorphicLookup_entry()); |
1314 } else { | 1313 } else { |
1315 StubCode::EmitMegamorphicLookup(assembler(), receiverR, cacheR, targetR); | 1314 StubCode::EmitMegamorphicLookup(assembler(), receiverR, cacheR, targetR); |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1848 __ movups(reg, Address(ESP, 0)); | 1847 __ movups(reg, Address(ESP, 0)); |
1849 __ addl(ESP, Immediate(kFpuRegisterSize)); | 1848 __ addl(ESP, Immediate(kFpuRegisterSize)); |
1850 } | 1849 } |
1851 | 1850 |
1852 | 1851 |
1853 #undef __ | 1852 #undef __ |
1854 | 1853 |
1855 } // namespace dart | 1854 } // namespace dart |
1856 | 1855 |
1857 #endif // defined TARGET_ARCH_IA32 | 1856 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |