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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
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 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 intptr_t deopt_id, | 1308 intptr_t deopt_id, |
1309 intptr_t token_pos, | 1309 intptr_t token_pos, |
1310 LocationSummary* locs) { | 1310 LocationSummary* locs) { |
1311 __ Comment("SwitchableCall"); | 1311 __ Comment("SwitchableCall"); |
1312 __ lw(T0, Address(SP, (argument_count - 1) * kWordSize)); | 1312 __ lw(T0, Address(SP, (argument_count - 1) * kWordSize)); |
1313 if (ic_data.NumArgsTested() == 1) { | 1313 if (ic_data.NumArgsTested() == 1) { |
1314 __ LoadUniqueObject(S5, ic_data); | 1314 __ LoadUniqueObject(S5, ic_data); |
1315 __ BranchLink(*StubCode::ICLookup_entry()); | 1315 __ BranchLink(*StubCode::ICLookup_entry()); |
1316 } else { | 1316 } else { |
1317 const String& name = String::Handle(zone(), ic_data.target_name()); | 1317 const String& name = String::Handle(zone(), ic_data.target_name()); |
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 | 1318 |
1325 __ LoadUniqueObject(S5, cache); | 1319 if (name.raw() == Symbols::Plus().raw()) { |
1326 __ BranchLink(*StubCode::MegamorphicLookup_entry()); | 1320 __ LoadUniqueObject(S5, ic_data); |
| 1321 __ BranchLink(*StubCode::ICSmiAddLookup_entry()); |
| 1322 } else if (name.raw() == Symbols::Minus().raw()) { |
| 1323 __ LoadUniqueObject(S5, ic_data); |
| 1324 __ BranchLink(*StubCode::ICSmiSubLookup_entry()); |
| 1325 } else if (name.raw() == Symbols::Equals().raw()) { |
| 1326 __ LoadUniqueObject(S5, ic_data); |
| 1327 __ BranchLink(*StubCode::ICSmiEqualLookup_entry()); |
| 1328 } else { |
| 1329 const Array& arguments_descriptor = |
| 1330 Array::ZoneHandle(zone(), ic_data.arguments_descriptor()); |
| 1331 ASSERT(!arguments_descriptor.IsNull() && |
| 1332 (arguments_descriptor.Length() > 0)); |
| 1333 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(), |
| 1334 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor)); |
| 1335 |
| 1336 __ LoadUniqueObject(S5, cache); |
| 1337 __ BranchLink(*StubCode::MegamorphicLookup_entry()); |
| 1338 } |
1327 } | 1339 } |
1328 __ jalr(T1); | 1340 __ jalr(T1); // A fast Smi operation may return past this call. |
1329 | 1341 |
1330 AddCurrentDescriptor(RawPcDescriptors::kOther, | 1342 AddCurrentDescriptor(RawPcDescriptors::kOther, |
1331 Thread::kNoDeoptId, token_pos); | 1343 Thread::kNoDeoptId, token_pos); |
1332 RecordSafepoint(locs); | 1344 RecordSafepoint(locs); |
1333 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); | 1345 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
1334 if (is_optimizing()) { | 1346 if (is_optimizing()) { |
1335 AddDeoptIndexAtCall(deopt_id_after, token_pos); | 1347 AddDeoptIndexAtCall(deopt_id_after, token_pos); |
1336 } else { | 1348 } else { |
1337 // Add deoptimization continuation point after the call and before the | 1349 // Add deoptimization continuation point after the call and before the |
1338 // arguments are removed. | 1350 // arguments are removed. |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1879 __ AddImmediate(SP, kDoubleSize); | 1891 __ AddImmediate(SP, kDoubleSize); |
1880 } | 1892 } |
1881 | 1893 |
1882 | 1894 |
1883 #undef __ | 1895 #undef __ |
1884 | 1896 |
1885 | 1897 |
1886 } // namespace dart | 1898 } // namespace dart |
1887 | 1899 |
1888 #endif // defined TARGET_ARCH_MIPS | 1900 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |