| 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 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1246 | 1246 |
| 1247 | 1247 |
| 1248 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, | 1248 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, |
| 1249 const ICData& ic_data, | 1249 const ICData& ic_data, |
| 1250 intptr_t argument_count, | 1250 intptr_t argument_count, |
| 1251 intptr_t deopt_id, | 1251 intptr_t deopt_id, |
| 1252 intptr_t token_pos, | 1252 intptr_t token_pos, |
| 1253 LocationSummary* locs) { | 1253 LocationSummary* locs) { |
| 1254 ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0); | 1254 ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0); |
| 1255 __ TraceSimMsg("InstanceCall"); | 1255 __ TraceSimMsg("InstanceCall"); |
| 1256 __ LoadImmediate(S4, 0); | |
| 1257 __ LoadObject(S5, ic_data); | 1256 __ LoadObject(S5, ic_data); |
| 1258 GenerateDartCall(deopt_id, | 1257 GenerateDartCall(deopt_id, |
| 1259 token_pos, | 1258 token_pos, |
| 1260 target_label, | 1259 target_label, |
| 1261 RawPcDescriptors::kIcCall, | 1260 RawPcDescriptors::kIcCall, |
| 1262 locs); | 1261 locs); |
| 1263 __ TraceSimMsg("InstanceCall return"); | 1262 __ TraceSimMsg("InstanceCall return"); |
| 1264 __ Drop(argument_count); | 1263 __ Drop(argument_count); |
| 1265 #if defined(DEBUG) | 1264 #if defined(DEBUG) |
| 1266 __ LoadImmediate(S4, kInvalidObjectPointer); | 1265 __ LoadImmediate(S4, kInvalidObjectPointer); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1341 uword label_address = 0; | 1340 uword label_address = 0; |
| 1342 StubCode* stub_code = isolate()->stub_code(); | 1341 StubCode* stub_code = isolate()->stub_code(); |
| 1343 if (ic_data.NumArgsTested() == 0) { | 1342 if (ic_data.NumArgsTested() == 0) { |
| 1344 label_address = stub_code->ZeroArgsUnoptimizedStaticCallEntryPoint(); | 1343 label_address = stub_code->ZeroArgsUnoptimizedStaticCallEntryPoint(); |
| 1345 } else if (ic_data.NumArgsTested() == 2) { | 1344 } else if (ic_data.NumArgsTested() == 2) { |
| 1346 label_address = stub_code->TwoArgsUnoptimizedStaticCallEntryPoint(); | 1345 label_address = stub_code->TwoArgsUnoptimizedStaticCallEntryPoint(); |
| 1347 } else { | 1346 } else { |
| 1348 UNIMPLEMENTED(); | 1347 UNIMPLEMENTED(); |
| 1349 } | 1348 } |
| 1350 ExternalLabel target_label(label_address); | 1349 ExternalLabel target_label(label_address); |
| 1351 __ LoadImmediate(S4, 0); | |
| 1352 __ LoadObject(S5, ic_data); | 1350 __ LoadObject(S5, ic_data); |
| 1353 GenerateDartCall(deopt_id, | 1351 GenerateDartCall(deopt_id, |
| 1354 token_pos, | 1352 token_pos, |
| 1355 &target_label, | 1353 &target_label, |
| 1356 RawPcDescriptors::kUnoptStaticCall, | 1354 RawPcDescriptors::kUnoptStaticCall, |
| 1357 locs); | 1355 locs); |
| 1358 #if defined(DEBUG) | 1356 #if defined(DEBUG) |
| 1359 __ LoadImmediate(S4, kInvalidObjectPointer); | 1357 __ LoadImmediate(S4, kInvalidObjectPointer); |
| 1358 __ LoadImmediate(S5, kInvalidObjectPointer); |
| 1360 #endif | 1359 #endif |
| 1361 __ Drop(argument_count); | 1360 __ Drop(argument_count); |
| 1362 } | 1361 } |
| 1363 | 1362 |
| 1364 | 1363 |
| 1365 void FlowGraphCompiler::EmitOptimizedStaticCall( | 1364 void FlowGraphCompiler::EmitOptimizedStaticCall( |
| 1366 const Function& function, | 1365 const Function& function, |
| 1367 const Array& arguments_descriptor, | 1366 const Array& arguments_descriptor, |
| 1368 intptr_t argument_count, | 1367 intptr_t argument_count, |
| 1369 intptr_t deopt_id, | 1368 intptr_t deopt_id, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1425 __ Comment("EqualityRegRegCompare"); | 1424 __ Comment("EqualityRegRegCompare"); |
| 1426 if (needs_number_check) { | 1425 if (needs_number_check) { |
| 1427 StubCode* stub_code = isolate()->stub_code(); | 1426 StubCode* stub_code = isolate()->stub_code(); |
| 1428 __ addiu(SP, SP, Immediate(-2 * kWordSize)); | 1427 __ addiu(SP, SP, Immediate(-2 * kWordSize)); |
| 1429 __ sw(left, Address(SP, 1 * kWordSize)); | 1428 __ sw(left, Address(SP, 1 * kWordSize)); |
| 1430 __ sw(right, Address(SP, 0 * kWordSize)); | 1429 __ sw(right, Address(SP, 0 * kWordSize)); |
| 1431 if (is_optimizing()) { | 1430 if (is_optimizing()) { |
| 1432 __ BranchLinkPatchable( | 1431 __ BranchLinkPatchable( |
| 1433 &stub_code->OptimizedIdenticalWithNumberCheckLabel()); | 1432 &stub_code->OptimizedIdenticalWithNumberCheckLabel()); |
| 1434 } else { | 1433 } else { |
| 1435 __ LoadImmediate(S4, 0); | |
| 1436 __ LoadImmediate(S5, 0); | |
| 1437 __ BranchLinkPatchable( | 1434 __ BranchLinkPatchable( |
| 1438 &stub_code->UnoptimizedIdenticalWithNumberCheckLabel()); | 1435 &stub_code->UnoptimizedIdenticalWithNumberCheckLabel()); |
| 1439 } | 1436 } |
| 1440 if (token_pos != Scanner::kNoSourcePos) { | 1437 if (token_pos != Scanner::kNoSourcePos) { |
| 1441 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, | 1438 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, |
| 1442 Isolate::kNoDeoptId, | 1439 Isolate::kNoDeoptId, |
| 1443 token_pos); | 1440 token_pos); |
| 1444 } | 1441 } |
| 1445 #if defined(DEBUG) | 1442 #if defined(DEBUG) |
| 1446 if (!is_optimizing()) { | 1443 if (!is_optimizing()) { |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1819 __ AddImmediate(SP, kDoubleSize); | 1816 __ AddImmediate(SP, kDoubleSize); |
| 1820 } | 1817 } |
| 1821 | 1818 |
| 1822 | 1819 |
| 1823 #undef __ | 1820 #undef __ |
| 1824 | 1821 |
| 1825 | 1822 |
| 1826 } // namespace dart | 1823 } // namespace dart |
| 1827 | 1824 |
| 1828 #endif // defined TARGET_ARCH_MIPS | 1825 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |