| 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 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1241 | 1241 |
| 1242 | 1242 |
| 1243 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, | 1243 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, |
| 1244 const ICData& ic_data, | 1244 const ICData& ic_data, |
| 1245 intptr_t argument_count, | 1245 intptr_t argument_count, |
| 1246 intptr_t deopt_id, | 1246 intptr_t deopt_id, |
| 1247 intptr_t token_pos, | 1247 intptr_t token_pos, |
| 1248 LocationSummary* locs) { | 1248 LocationSummary* locs) { |
| 1249 ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0); | 1249 ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0); |
| 1250 __ TraceSimMsg("InstanceCall"); | 1250 __ TraceSimMsg("InstanceCall"); |
| 1251 __ LoadImmediate(S4, 0); |
| 1251 __ LoadObject(S5, ic_data); | 1252 __ LoadObject(S5, ic_data); |
| 1252 GenerateDartCall(deopt_id, | 1253 GenerateDartCall(deopt_id, |
| 1253 token_pos, | 1254 token_pos, |
| 1254 target_label, | 1255 target_label, |
| 1255 PcDescriptors::kIcCall, | 1256 PcDescriptors::kIcCall, |
| 1256 locs); | 1257 locs); |
| 1257 __ TraceSimMsg("InstanceCall return"); | 1258 __ TraceSimMsg("InstanceCall return"); |
| 1258 __ Drop(argument_count); | 1259 __ Drop(argument_count); |
| 1260 #if defined(DEBUG) |
| 1261 __ LoadImmediate(S4, kInvalidObjectPointer); |
| 1262 #endif |
| 1259 } | 1263 } |
| 1260 | 1264 |
| 1261 | 1265 |
| 1262 void FlowGraphCompiler::EmitMegamorphicInstanceCall( | 1266 void FlowGraphCompiler::EmitMegamorphicInstanceCall( |
| 1263 const ICData& ic_data, | 1267 const ICData& ic_data, |
| 1264 intptr_t argument_count, | 1268 intptr_t argument_count, |
| 1265 intptr_t deopt_id, | 1269 intptr_t deopt_id, |
| 1266 intptr_t token_pos, | 1270 intptr_t token_pos, |
| 1267 LocationSummary* locs) { | 1271 LocationSummary* locs) { |
| 1268 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); | 1272 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1330 const ICData& ic_data) { | 1334 const ICData& ic_data) { |
| 1331 uword label_address = 0; | 1335 uword label_address = 0; |
| 1332 if (ic_data.NumArgsTested() == 0) { | 1336 if (ic_data.NumArgsTested() == 0) { |
| 1333 label_address = StubCode::ZeroArgsUnoptimizedStaticCallEntryPoint(); | 1337 label_address = StubCode::ZeroArgsUnoptimizedStaticCallEntryPoint(); |
| 1334 } else if (ic_data.NumArgsTested() == 2) { | 1338 } else if (ic_data.NumArgsTested() == 2) { |
| 1335 label_address = StubCode::TwoArgsUnoptimizedStaticCallEntryPoint(); | 1339 label_address = StubCode::TwoArgsUnoptimizedStaticCallEntryPoint(); |
| 1336 } else { | 1340 } else { |
| 1337 UNIMPLEMENTED(); | 1341 UNIMPLEMENTED(); |
| 1338 } | 1342 } |
| 1339 ExternalLabel target_label(label_address); | 1343 ExternalLabel target_label(label_address); |
| 1344 __ LoadImmediate(S4, 0); |
| 1340 __ LoadObject(S5, ic_data); | 1345 __ LoadObject(S5, ic_data); |
| 1341 GenerateDartCall(deopt_id, | 1346 GenerateDartCall(deopt_id, |
| 1342 token_pos, | 1347 token_pos, |
| 1343 &target_label, | 1348 &target_label, |
| 1344 PcDescriptors::kUnoptStaticCall, | 1349 PcDescriptors::kUnoptStaticCall, |
| 1345 locs); | 1350 locs); |
| 1351 #if defined(DEBUG) |
| 1352 __ LoadImmediate(S4, kInvalidObjectPointer); |
| 1353 #endif |
| 1346 __ Drop(argument_count); | 1354 __ Drop(argument_count); |
| 1347 } | 1355 } |
| 1348 | 1356 |
| 1349 | 1357 |
| 1350 void FlowGraphCompiler::EmitOptimizedStaticCall( | 1358 void FlowGraphCompiler::EmitOptimizedStaticCall( |
| 1351 const Function& function, | 1359 const Function& function, |
| 1352 const Array& arguments_descriptor, | 1360 const Array& arguments_descriptor, |
| 1353 intptr_t argument_count, | 1361 intptr_t argument_count, |
| 1354 intptr_t deopt_id, | 1362 intptr_t deopt_id, |
| 1355 intptr_t token_pos, | 1363 intptr_t token_pos, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1407 __ TraceSimMsg("EqualityRegRegCompare"); | 1415 __ TraceSimMsg("EqualityRegRegCompare"); |
| 1408 __ Comment("EqualityRegRegCompare"); | 1416 __ Comment("EqualityRegRegCompare"); |
| 1409 if (needs_number_check) { | 1417 if (needs_number_check) { |
| 1410 __ addiu(SP, SP, Immediate(-2 * kWordSize)); | 1418 __ addiu(SP, SP, Immediate(-2 * kWordSize)); |
| 1411 __ sw(left, Address(SP, 1 * kWordSize)); | 1419 __ sw(left, Address(SP, 1 * kWordSize)); |
| 1412 __ sw(right, Address(SP, 0 * kWordSize)); | 1420 __ sw(right, Address(SP, 0 * kWordSize)); |
| 1413 if (is_optimizing()) { | 1421 if (is_optimizing()) { |
| 1414 __ BranchLinkPatchable( | 1422 __ BranchLinkPatchable( |
| 1415 &StubCode::OptimizedIdenticalWithNumberCheckLabel()); | 1423 &StubCode::OptimizedIdenticalWithNumberCheckLabel()); |
| 1416 } else { | 1424 } else { |
| 1425 __ LoadImmediate(S4, 0); |
| 1426 __ LoadImmediate(S5, 0); |
| 1417 __ BranchLinkPatchable( | 1427 __ BranchLinkPatchable( |
| 1418 &StubCode::UnoptimizedIdenticalWithNumberCheckLabel()); | 1428 &StubCode::UnoptimizedIdenticalWithNumberCheckLabel()); |
| 1419 } | 1429 } |
| 1420 if (token_pos != Scanner::kNoSourcePos) { | 1430 if (token_pos != Scanner::kNoSourcePos) { |
| 1421 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, | 1431 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, |
| 1422 Isolate::kNoDeoptId, | 1432 Isolate::kNoDeoptId, |
| 1423 token_pos); | 1433 token_pos); |
| 1424 } | 1434 } |
| 1435 #if defined(DEBUG) |
| 1436 if (!is_optimizing()) { |
| 1437 // Do this *after* adding the pc descriptor! |
| 1438 __ LoadImmediate(S4, kInvalidObjectPointer); |
| 1439 __ LoadImmediate(S5, kInvalidObjectPointer); |
| 1440 } |
| 1441 #endif |
| 1425 __ TraceSimMsg("EqualityRegRegCompare return"); | 1442 __ TraceSimMsg("EqualityRegRegCompare return"); |
| 1426 // Stub returns result in CMPRES1. If it is 0, then left and right are | 1443 // Stub returns result in CMPRES1. If it is 0, then left and right are |
| 1427 // equal. | 1444 // equal. |
| 1428 __ lw(right, Address(SP, 0 * kWordSize)); | 1445 __ lw(right, Address(SP, 0 * kWordSize)); |
| 1429 __ lw(left, Address(SP, 1 * kWordSize)); | 1446 __ lw(left, Address(SP, 1 * kWordSize)); |
| 1430 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 1447 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
| 1431 } else { | 1448 } else { |
| 1432 __ slt(CMPRES1, left, right); | 1449 __ slt(CMPRES1, left, right); |
| 1433 __ slt(CMPRES2, right, left); | 1450 __ slt(CMPRES2, right, left); |
| 1434 } | 1451 } |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1790 __ AddImmediate(SP, kDoubleSize); | 1807 __ AddImmediate(SP, kDoubleSize); |
| 1791 } | 1808 } |
| 1792 | 1809 |
| 1793 | 1810 |
| 1794 #undef __ | 1811 #undef __ |
| 1795 | 1812 |
| 1796 | 1813 |
| 1797 } // namespace dart | 1814 } // namespace dart |
| 1798 | 1815 |
| 1799 #endif // defined TARGET_ARCH_MIPS | 1816 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |