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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
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 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1260 intptr_t token_pos, | 1260 intptr_t token_pos, |
1261 LocationSummary* locs) { | 1261 LocationSummary* locs) { |
1262 const String& name = String::Handle(zone(), ic_data.target_name()); | 1262 const String& name = String::Handle(zone(), ic_data.target_name()); |
1263 const Array& arguments_descriptor = | 1263 const Array& arguments_descriptor = |
1264 Array::ZoneHandle(zone(), ic_data.arguments_descriptor()); | 1264 Array::ZoneHandle(zone(), ic_data.arguments_descriptor()); |
1265 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); | 1265 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); |
1266 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(), | 1266 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(), |
1267 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor)); | 1267 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor)); |
1268 | 1268 |
1269 __ Comment("MegamorphicCall"); | 1269 __ Comment("MegamorphicCall"); |
1270 __ LoadFromOffset(kWord, R0, SP, (argument_count - 1) * kWordSize); | 1270 __ LoadFromOffset(kWord, R1, SP, (argument_count - 1) * kWordSize); |
1271 __ LoadObject(R9, cache); | 1271 __ LoadObject(R9, cache); |
1272 if (FLAG_use_megamorphic_stub) { | 1272 if (FLAG_use_megamorphic_stub) { |
1273 __ BranchLink(*StubCode::MegamorphicLookup_entry()); | 1273 __ BranchLink(*StubCode::MegamorphicLookup_entry()); |
1274 } else { | 1274 } else { |
1275 StubCode::EmitMegamorphicLookup(assembler()); | 1275 StubCode::EmitMegamorphicLookup(assembler()); |
1276 } | 1276 } |
1277 __ blx(R1); | 1277 __ blx(R1); |
1278 | 1278 |
1279 AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos); | 1279 AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos); |
1280 RecordSafepoint(locs); | 1280 RecordSafepoint(locs); |
(...skipping 10 matching lines...) Expand all Loading... |
1291 } | 1291 } |
1292 | 1292 |
1293 | 1293 |
1294 void FlowGraphCompiler::EmitSwitchableInstanceCall( | 1294 void FlowGraphCompiler::EmitSwitchableInstanceCall( |
1295 const ICData& ic_data, | 1295 const ICData& ic_data, |
1296 intptr_t argument_count, | 1296 intptr_t argument_count, |
1297 intptr_t deopt_id, | 1297 intptr_t deopt_id, |
1298 intptr_t token_pos, | 1298 intptr_t token_pos, |
1299 LocationSummary* locs) { | 1299 LocationSummary* locs) { |
1300 __ Comment("SwitchableCall"); | 1300 __ Comment("SwitchableCall"); |
1301 __ LoadFromOffset(kWord, R0, SP, (argument_count - 1) * kWordSize); | 1301 __ LoadFromOffset(kWord, R1, SP, (argument_count - 1) * kWordSize); |
1302 if (ic_data.NumArgsTested() == 1) { | 1302 if (ic_data.NumArgsTested() == 1) { |
1303 __ LoadUniqueObject(R9, ic_data); | 1303 __ LoadUniqueObject(R9, ic_data); |
1304 __ BranchLinkPatchable(*StubCode::ICLookup_entry()); | 1304 __ BranchLinkPatchable(*StubCode::ICLookup_entry()); |
1305 } else { | 1305 } else { |
1306 const String& name = String::Handle(zone(), ic_data.target_name()); | 1306 const String& name = String::Handle(zone(), ic_data.target_name()); |
1307 const Array& arguments_descriptor = | |
1308 Array::ZoneHandle(zone(), ic_data.arguments_descriptor()); | |
1309 ASSERT(!arguments_descriptor.IsNull() && | |
1310 (arguments_descriptor.Length() > 0)); | |
1311 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(), | |
1312 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor)); | |
1313 | 1307 |
1314 __ LoadUniqueObject(R9, cache); | 1308 if (name.raw() == Symbols::Plus().raw()) { |
1315 __ BranchLinkPatchable(*StubCode::MegamorphicLookup_entry()); | 1309 __ LoadUniqueObject(R9, ic_data); |
| 1310 __ BranchLinkPatchable(*StubCode::ICSmiAddLookup_entry()); |
| 1311 } else if (name.raw() == Symbols::Minus().raw()) { |
| 1312 __ LoadUniqueObject(R9, ic_data); |
| 1313 __ BranchLinkPatchable(*StubCode::ICSmiSubLookup_entry()); |
| 1314 } else if (name.raw() == Symbols::Equals().raw()) { |
| 1315 __ LoadUniqueObject(R9, ic_data); |
| 1316 __ BranchLinkPatchable(*StubCode::ICSmiEqualLookup_entry()); |
| 1317 } else { |
| 1318 const Array& arguments_descriptor = |
| 1319 Array::ZoneHandle(zone(), ic_data.arguments_descriptor()); |
| 1320 ASSERT(!arguments_descriptor.IsNull() && |
| 1321 (arguments_descriptor.Length() > 0)); |
| 1322 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(), |
| 1323 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor)); |
| 1324 |
| 1325 __ LoadUniqueObject(R9, cache); |
| 1326 __ BranchLinkPatchable(*StubCode::MegamorphicLookup_entry()); |
| 1327 } |
1316 } | 1328 } |
1317 __ blx(R1); | 1329 __ blx(R1); // A fast Smi operation may return past this call. |
1318 | 1330 |
1319 AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos); | 1331 AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos); |
1320 RecordSafepoint(locs); | 1332 RecordSafepoint(locs); |
1321 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); | 1333 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
1322 if (is_optimizing()) { | 1334 if (is_optimizing()) { |
1323 AddDeoptIndexAtCall(deopt_id_after, token_pos); | 1335 AddDeoptIndexAtCall(deopt_id_after, token_pos); |
1324 } else { | 1336 } else { |
1325 // Add deoptimization continuation point after the call and before the | 1337 // Add deoptimization continuation point after the call and before the |
1326 // arguments are removed. | 1338 // arguments are removed. |
1327 AddCurrentDescriptor(RawPcDescriptors::kDeopt, | 1339 AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1910 DRegister dreg = EvenDRegisterOf(reg); | 1922 DRegister dreg = EvenDRegisterOf(reg); |
1911 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); | 1923 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); |
1912 } | 1924 } |
1913 | 1925 |
1914 | 1926 |
1915 #undef __ | 1927 #undef __ |
1916 | 1928 |
1917 } // namespace dart | 1929 } // namespace dart |
1918 | 1930 |
1919 #endif // defined TARGET_ARCH_ARM | 1931 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |