| 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 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1268 ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0); | 1268 ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0); |
| 1269 __ Comment("InstanceCall"); | 1269 __ Comment("InstanceCall"); |
| 1270 __ LoadObject(S5, ic_data); | 1270 __ LoadObject(S5, ic_data); |
| 1271 GenerateDartCall(deopt_id, | 1271 GenerateDartCall(deopt_id, |
| 1272 token_pos, | 1272 token_pos, |
| 1273 target_label, | 1273 target_label, |
| 1274 RawPcDescriptors::kIcCall, | 1274 RawPcDescriptors::kIcCall, |
| 1275 locs); | 1275 locs); |
| 1276 __ Comment("InstanceCall return"); | 1276 __ Comment("InstanceCall return"); |
| 1277 __ Drop(argument_count); | 1277 __ Drop(argument_count); |
| 1278 #if defined(DEBUG) | |
| 1279 __ LoadImmediate(S4, kInvalidObjectPointer); | |
| 1280 #endif | |
| 1281 } | 1278 } |
| 1282 | 1279 |
| 1283 | 1280 |
| 1284 void FlowGraphCompiler::EmitMegamorphicInstanceCall( | 1281 void FlowGraphCompiler::EmitMegamorphicInstanceCall( |
| 1285 const ICData& ic_data, | 1282 const ICData& ic_data, |
| 1286 intptr_t argument_count, | 1283 intptr_t argument_count, |
| 1287 intptr_t deopt_id, | 1284 intptr_t deopt_id, |
| 1288 intptr_t token_pos, | 1285 intptr_t token_pos, |
| 1289 LocationSummary* locs) { | 1286 LocationSummary* locs) { |
| 1290 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); | 1287 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1354 StubCode* stub_code = isolate()->stub_code(); | 1351 StubCode* stub_code = isolate()->stub_code(); |
| 1355 const uword label_address = | 1352 const uword label_address = |
| 1356 stub_code->UnoptimizedStaticCallEntryPoint(ic_data.NumArgsTested()); | 1353 stub_code->UnoptimizedStaticCallEntryPoint(ic_data.NumArgsTested()); |
| 1357 ExternalLabel target_label(label_address); | 1354 ExternalLabel target_label(label_address); |
| 1358 __ LoadObject(S5, ic_data); | 1355 __ LoadObject(S5, ic_data); |
| 1359 GenerateDartCall(deopt_id, | 1356 GenerateDartCall(deopt_id, |
| 1360 token_pos, | 1357 token_pos, |
| 1361 &target_label, | 1358 &target_label, |
| 1362 RawPcDescriptors::kUnoptStaticCall, | 1359 RawPcDescriptors::kUnoptStaticCall, |
| 1363 locs); | 1360 locs); |
| 1364 #if defined(DEBUG) | |
| 1365 __ LoadImmediate(S4, kInvalidObjectPointer); | |
| 1366 __ LoadImmediate(S5, kInvalidObjectPointer); | |
| 1367 #endif | |
| 1368 __ Drop(argument_count); | 1361 __ Drop(argument_count); |
| 1369 } | 1362 } |
| 1370 | 1363 |
| 1371 | 1364 |
| 1372 void FlowGraphCompiler::EmitOptimizedStaticCall( | 1365 void FlowGraphCompiler::EmitOptimizedStaticCall( |
| 1373 const Function& function, | 1366 const Function& function, |
| 1374 const Array& arguments_descriptor, | 1367 const Array& arguments_descriptor, |
| 1375 intptr_t argument_count, | 1368 intptr_t argument_count, |
| 1376 intptr_t deopt_id, | 1369 intptr_t deopt_id, |
| 1377 intptr_t token_pos, | 1370 intptr_t token_pos, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1446 &stub_code->OptimizedIdenticalWithNumberCheckLabel()); | 1439 &stub_code->OptimizedIdenticalWithNumberCheckLabel()); |
| 1447 } else { | 1440 } else { |
| 1448 __ BranchLinkPatchable( | 1441 __ BranchLinkPatchable( |
| 1449 &stub_code->UnoptimizedIdenticalWithNumberCheckLabel()); | 1442 &stub_code->UnoptimizedIdenticalWithNumberCheckLabel()); |
| 1450 } | 1443 } |
| 1451 if (token_pos != Scanner::kNoSourcePos) { | 1444 if (token_pos != Scanner::kNoSourcePos) { |
| 1452 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, | 1445 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, |
| 1453 Isolate::kNoDeoptId, | 1446 Isolate::kNoDeoptId, |
| 1454 token_pos); | 1447 token_pos); |
| 1455 } | 1448 } |
| 1456 #if defined(DEBUG) | |
| 1457 if (!is_optimizing()) { | |
| 1458 // Do this *after* adding the pc descriptor! | |
| 1459 __ LoadImmediate(S4, kInvalidObjectPointer); | |
| 1460 __ LoadImmediate(S5, kInvalidObjectPointer); | |
| 1461 } | |
| 1462 #endif | |
| 1463 __ Comment("EqualityRegRegCompare return"); | 1449 __ Comment("EqualityRegRegCompare return"); |
| 1464 // Stub returns result in CMPRES1 (if it is 0, then left and right are | 1450 // Stub returns result in CMPRES1 (if it is 0, then left and right are |
| 1465 // equal). | 1451 // equal). |
| 1466 __ lw(right, Address(SP, 0 * kWordSize)); | 1452 __ lw(right, Address(SP, 0 * kWordSize)); |
| 1467 __ lw(left, Address(SP, 1 * kWordSize)); | 1453 __ lw(left, Address(SP, 1 * kWordSize)); |
| 1468 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 1454 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
| 1469 return Condition(CMPRES1, ZR, EQ); | 1455 return Condition(CMPRES1, ZR, EQ); |
| 1470 } else { | 1456 } else { |
| 1471 return Condition(left, right, EQ); | 1457 return Condition(left, right, EQ); |
| 1472 } | 1458 } |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1860 __ AddImmediate(SP, kDoubleSize); | 1846 __ AddImmediate(SP, kDoubleSize); |
| 1861 } | 1847 } |
| 1862 | 1848 |
| 1863 | 1849 |
| 1864 #undef __ | 1850 #undef __ |
| 1865 | 1851 |
| 1866 | 1852 |
| 1867 } // namespace dart | 1853 } // namespace dart |
| 1868 | 1854 |
| 1869 #endif // defined TARGET_ARCH_MIPS | 1855 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |