| 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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 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 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 } | 1202 } |
| 1203 | 1203 |
| 1204 | 1204 |
| 1205 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, | 1205 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, |
| 1206 const ICData& ic_data, | 1206 const ICData& ic_data, |
| 1207 intptr_t argument_count, | 1207 intptr_t argument_count, |
| 1208 intptr_t deopt_id, | 1208 intptr_t deopt_id, |
| 1209 intptr_t token_pos, | 1209 intptr_t token_pos, |
| 1210 LocationSummary* locs) { | 1210 LocationSummary* locs) { |
| 1211 ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0); | 1211 ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0); |
| 1212 __ LoadImmediate(R4, 0); |
| 1212 __ LoadObject(R5, ic_data); | 1213 __ LoadObject(R5, ic_data); |
| 1213 GenerateDartCall(deopt_id, | 1214 GenerateDartCall(deopt_id, |
| 1214 token_pos, | 1215 token_pos, |
| 1215 target_label, | 1216 target_label, |
| 1216 PcDescriptors::kIcCall, | 1217 PcDescriptors::kIcCall, |
| 1217 locs); | 1218 locs); |
| 1218 __ Drop(argument_count); | 1219 __ Drop(argument_count); |
| 1220 #if defined(DEBUG) |
| 1221 __ LoadImmediate(R4, 1); // Garbage that looks like an object. |
| 1222 #endif |
| 1219 } | 1223 } |
| 1220 | 1224 |
| 1221 | 1225 |
| 1222 void FlowGraphCompiler::EmitMegamorphicInstanceCall( | 1226 void FlowGraphCompiler::EmitMegamorphicInstanceCall( |
| 1223 const ICData& ic_data, | 1227 const ICData& ic_data, |
| 1224 intptr_t argument_count, | 1228 intptr_t argument_count, |
| 1225 intptr_t deopt_id, | 1229 intptr_t deopt_id, |
| 1226 intptr_t token_pos, | 1230 intptr_t token_pos, |
| 1227 LocationSummary* locs) { | 1231 LocationSummary* locs) { |
| 1228 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); | 1232 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 const ICData& ic_data) { | 1292 const ICData& ic_data) { |
| 1289 uword label_address = 0; | 1293 uword label_address = 0; |
| 1290 if (ic_data.NumArgsTested() == 0) { | 1294 if (ic_data.NumArgsTested() == 0) { |
| 1291 label_address = StubCode::ZeroArgsUnoptimizedStaticCallEntryPoint(); | 1295 label_address = StubCode::ZeroArgsUnoptimizedStaticCallEntryPoint(); |
| 1292 } else if (ic_data.NumArgsTested() == 2) { | 1296 } else if (ic_data.NumArgsTested() == 2) { |
| 1293 label_address = StubCode::TwoArgsUnoptimizedStaticCallEntryPoint(); | 1297 label_address = StubCode::TwoArgsUnoptimizedStaticCallEntryPoint(); |
| 1294 } else { | 1298 } else { |
| 1295 UNIMPLEMENTED(); | 1299 UNIMPLEMENTED(); |
| 1296 } | 1300 } |
| 1297 ExternalLabel target_label(label_address); | 1301 ExternalLabel target_label(label_address); |
| 1302 __ LoadImmediate(R4, 0); |
| 1298 __ LoadObject(R5, ic_data); | 1303 __ LoadObject(R5, ic_data); |
| 1299 GenerateDartCall(deopt_id, | 1304 GenerateDartCall(deopt_id, |
| 1300 token_pos, | 1305 token_pos, |
| 1301 &target_label, | 1306 &target_label, |
| 1302 PcDescriptors::kUnoptStaticCall, | 1307 PcDescriptors::kUnoptStaticCall, |
| 1303 locs); | 1308 locs); |
| 1304 __ Drop(argument_count); | 1309 __ Drop(argument_count); |
| 1310 #if defined(DEBUG) |
| 1311 __ LoadImmediate(R4, 1); // Garbage that looks like an object. |
| 1312 #endif |
| 1305 } | 1313 } |
| 1306 | 1314 |
| 1307 | 1315 |
| 1308 void FlowGraphCompiler::EmitOptimizedStaticCall( | 1316 void FlowGraphCompiler::EmitOptimizedStaticCall( |
| 1309 const Function& function, | 1317 const Function& function, |
| 1310 const Array& arguments_descriptor, | 1318 const Array& arguments_descriptor, |
| 1311 intptr_t argument_count, | 1319 intptr_t argument_count, |
| 1312 intptr_t deopt_id, | 1320 intptr_t deopt_id, |
| 1313 intptr_t token_pos, | 1321 intptr_t token_pos, |
| 1314 LocationSummary* locs) { | 1322 LocationSummary* locs) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1358 Register right, | 1366 Register right, |
| 1359 bool needs_number_check, | 1367 bool needs_number_check, |
| 1360 intptr_t token_pos) { | 1368 intptr_t token_pos) { |
| 1361 if (needs_number_check) { | 1369 if (needs_number_check) { |
| 1362 __ Push(left); | 1370 __ Push(left); |
| 1363 __ Push(right); | 1371 __ Push(right); |
| 1364 if (is_optimizing()) { | 1372 if (is_optimizing()) { |
| 1365 __ BranchLinkPatchable( | 1373 __ BranchLinkPatchable( |
| 1366 &StubCode::OptimizedIdenticalWithNumberCheckLabel()); | 1374 &StubCode::OptimizedIdenticalWithNumberCheckLabel()); |
| 1367 } else { | 1375 } else { |
| 1376 __ LoadImmediate(R4, 0); |
| 1377 __ LoadImmediate(R5, 0); |
| 1368 __ BranchLinkPatchable( | 1378 __ BranchLinkPatchable( |
| 1369 &StubCode::UnoptimizedIdenticalWithNumberCheckLabel()); | 1379 &StubCode::UnoptimizedIdenticalWithNumberCheckLabel()); |
| 1370 } | 1380 } |
| 1371 if (token_pos != Scanner::kNoSourcePos) { | 1381 if (token_pos != Scanner::kNoSourcePos) { |
| 1372 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, | 1382 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, |
| 1373 Isolate::kNoDeoptId, | 1383 Isolate::kNoDeoptId, |
| 1374 token_pos); | 1384 token_pos); |
| 1375 } | 1385 } |
| 1386 #if defined(DEBUG) |
| 1387 if (!is_optimizing()) { |
| 1388 // Do this *after* adding the pc descriptor! |
| 1389 __ LoadImmediate(R4, 1); // Garbage that looks like an object. |
| 1390 __ LoadImmediate(R5, 1); |
| 1391 } |
| 1392 #endif |
| 1376 // Stub returns result in flags (result of a cmpl, we need ZF computed). | 1393 // Stub returns result in flags (result of a cmpl, we need ZF computed). |
| 1377 __ Pop(right); | 1394 __ Pop(right); |
| 1378 __ Pop(left); | 1395 __ Pop(left); |
| 1379 } else { | 1396 } else { |
| 1380 __ cmp(left, Operand(right)); | 1397 __ cmp(left, Operand(right)); |
| 1381 } | 1398 } |
| 1382 } | 1399 } |
| 1383 | 1400 |
| 1384 | 1401 |
| 1385 // This function must be in sync with FlowGraphCompiler::RecordSafepoint and | 1402 // This function must be in sync with FlowGraphCompiler::RecordSafepoint and |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1745 DRegister dreg = EvenDRegisterOf(reg); | 1762 DRegister dreg = EvenDRegisterOf(reg); |
| 1746 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); | 1763 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); |
| 1747 } | 1764 } |
| 1748 | 1765 |
| 1749 | 1766 |
| 1750 #undef __ | 1767 #undef __ |
| 1751 | 1768 |
| 1752 } // namespace dart | 1769 } // namespace dart |
| 1753 | 1770 |
| 1754 #endif // defined TARGET_ARCH_ARM | 1771 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |