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 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 | 1365 |
1366 | 1366 |
1367 void FlowGraphCompiler::EmitSwitchableInstanceCall( | 1367 void FlowGraphCompiler::EmitSwitchableInstanceCall( |
1368 const ICData& ic_data, | 1368 const ICData& ic_data, |
1369 intptr_t argument_count, | 1369 intptr_t argument_count, |
1370 intptr_t deopt_id, | 1370 intptr_t deopt_id, |
1371 TokenPosition token_pos, | 1371 TokenPosition token_pos, |
1372 LocationSummary* locs) { | 1372 LocationSummary* locs) { |
1373 __ Comment("SwitchableCall"); | 1373 __ Comment("SwitchableCall"); |
1374 __ lw(T0, Address(SP, (argument_count - 1) * kWordSize)); | 1374 __ lw(T0, Address(SP, (argument_count - 1) * kWordSize)); |
1375 if (ic_data.NumArgsTested() == 1) { | 1375 ASSERT(ic_data.NumArgsTested() == 1); |
1376 __ LoadUniqueObject(S5, ic_data); | 1376 __ LoadUniqueObject(S5, ic_data); |
1377 __ BranchLinkPatchable(*StubCode::ICLookupThroughFunction_entry()); | 1377 __ BranchLinkPatchable(*StubCode::ICLookupThroughFunction_entry()); |
1378 } else { | |
1379 const String& name = String::Handle(zone(), ic_data.target_name()); | |
1380 const Array& arguments_descriptor = | |
1381 Array::ZoneHandle(zone(), ic_data.arguments_descriptor()); | |
1382 ASSERT(!arguments_descriptor.IsNull() && | |
1383 (arguments_descriptor.Length() > 0)); | |
1384 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(), | |
1385 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor)); | |
1386 | |
1387 __ LoadUniqueObject(S5, cache); | |
1388 __ BranchLinkPatchable(*StubCode::MegamorphicLookup_entry()); | |
1389 } | |
1390 __ jalr(T1); | 1378 __ jalr(T1); |
1391 | 1379 |
1392 AddCurrentDescriptor(RawPcDescriptors::kOther, | 1380 AddCurrentDescriptor(RawPcDescriptors::kOther, |
1393 Thread::kNoDeoptId, token_pos); | 1381 Thread::kNoDeoptId, token_pos); |
1394 RecordSafepoint(locs); | 1382 RecordSafepoint(locs); |
1395 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); | 1383 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
1396 if (is_optimizing()) { | 1384 if (is_optimizing()) { |
1397 AddDeoptIndexAtCall(deopt_id_after, token_pos); | 1385 AddDeoptIndexAtCall(deopt_id_after, token_pos); |
1398 } else { | 1386 } else { |
1399 // Add deoptimization continuation point after the call and before the | 1387 // Add deoptimization continuation point after the call and before the |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1952 __ AddImmediate(SP, kDoubleSize); | 1940 __ AddImmediate(SP, kDoubleSize); |
1953 } | 1941 } |
1954 | 1942 |
1955 | 1943 |
1956 #undef __ | 1944 #undef __ |
1957 | 1945 |
1958 | 1946 |
1959 } // namespace dart | 1947 } // namespace dart |
1960 | 1948 |
1961 #endif // defined TARGET_ARCH_MIPS | 1949 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |