| 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 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1283 __ Drop(argument_count); | 1283 __ Drop(argument_count); |
| 1284 } | 1284 } |
| 1285 | 1285 |
| 1286 | 1286 |
| 1287 void FlowGraphCompiler::EmitMegamorphicInstanceCall( | 1287 void FlowGraphCompiler::EmitMegamorphicInstanceCall( |
| 1288 const ICData& ic_data, | 1288 const ICData& ic_data, |
| 1289 intptr_t argument_count, | 1289 intptr_t argument_count, |
| 1290 intptr_t deopt_id, | 1290 intptr_t deopt_id, |
| 1291 TokenPosition token_pos, | 1291 TokenPosition token_pos, |
| 1292 LocationSummary* locs, | 1292 LocationSummary* locs, |
| 1293 intptr_t try_index) { | 1293 intptr_t try_index, |
| 1294 intptr_t slow_path_argument_count) { |
| 1294 const String& name = String::Handle(zone(), ic_data.target_name()); | 1295 const String& name = String::Handle(zone(), ic_data.target_name()); |
| 1295 const Array& arguments_descriptor = | 1296 const Array& arguments_descriptor = |
| 1296 Array::ZoneHandle(zone(), ic_data.arguments_descriptor()); | 1297 Array::ZoneHandle(zone(), ic_data.arguments_descriptor()); |
| 1297 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); | 1298 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); |
| 1298 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(), | 1299 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(), |
| 1299 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor)); | 1300 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor)); |
| 1300 | 1301 |
| 1301 __ Comment("MegamorphicCall"); | 1302 __ Comment("MegamorphicCall"); |
| 1302 __ movl(EBX, Address(ESP, (argument_count - 1) * kWordSize)); | 1303 __ movl(EBX, Address(ESP, (argument_count - 1) * kWordSize)); |
| 1303 __ LoadObject(ECX, cache); | 1304 __ LoadObject(ECX, cache); |
| 1304 if (FLAG_use_megamorphic_stub) { | 1305 if (FLAG_use_megamorphic_stub) { |
| 1305 __ Call(*StubCode::MegamorphicLookup_entry()); | 1306 __ Call(*StubCode::MegamorphicLookup_entry()); |
| 1306 } else { | 1307 } else { |
| 1307 StubCode::EmitMegamorphicLookup(assembler()); | 1308 StubCode::EmitMegamorphicLookup(assembler()); |
| 1308 } | 1309 } |
| 1309 __ call(EBX); | 1310 __ call(EBX); |
| 1310 | 1311 |
| 1311 AddCurrentDescriptor(RawPcDescriptors::kOther, | 1312 AddCurrentDescriptor(RawPcDescriptors::kOther, |
| 1312 Thread::kNoDeoptId, token_pos); | 1313 Thread::kNoDeoptId, token_pos); |
| 1313 RecordSafepoint(locs); | 1314 RecordSafepoint(locs, slow_path_argument_count); |
| 1314 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); | 1315 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
| 1315 // Precompilation not implemented on ia32 platform. | 1316 // Precompilation not implemented on ia32 platform. |
| 1316 ASSERT(!FLAG_precompiled_mode); | 1317 ASSERT(!FLAG_precompiled_mode); |
| 1317 if (is_optimizing()) { | 1318 if (is_optimizing()) { |
| 1318 AddDeoptIndexAtCall(deopt_id_after, token_pos); | 1319 AddDeoptIndexAtCall(deopt_id_after, token_pos); |
| 1319 } else { | 1320 } else { |
| 1320 // Add deoptimization continuation point after the call and before the | 1321 // Add deoptimization continuation point after the call and before the |
| 1321 // arguments are removed. | 1322 // arguments are removed. |
| 1322 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); | 1323 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); |
| 1323 } | 1324 } |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1849 __ movups(reg, Address(ESP, 0)); | 1850 __ movups(reg, Address(ESP, 0)); |
| 1850 __ addl(ESP, Immediate(kFpuRegisterSize)); | 1851 __ addl(ESP, Immediate(kFpuRegisterSize)); |
| 1851 } | 1852 } |
| 1852 | 1853 |
| 1853 | 1854 |
| 1854 #undef __ | 1855 #undef __ |
| 1855 | 1856 |
| 1856 } // namespace dart | 1857 } // namespace dart |
| 1857 | 1858 |
| 1858 #endif // defined TARGET_ARCH_IA32 | 1859 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |