| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 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 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1350 GenerateDartCall(deopt_id, | 1350 GenerateDartCall(deopt_id, |
| 1351 token_pos, | 1351 token_pos, |
| 1352 &stub_code->CallStaticFunctionLabel(), | 1352 &stub_code->CallStaticFunctionLabel(), |
| 1353 RawPcDescriptors::kOptStaticCall, | 1353 RawPcDescriptors::kOptStaticCall, |
| 1354 locs); | 1354 locs); |
| 1355 AddStaticCallTarget(function); | 1355 AddStaticCallTarget(function); |
| 1356 __ Drop(argument_count); | 1356 __ Drop(argument_count); |
| 1357 } | 1357 } |
| 1358 | 1358 |
| 1359 | 1359 |
| 1360 void FlowGraphCompiler::EmitEqualityRegConstCompare(Register reg, | 1360 Condition FlowGraphCompiler::EmitEqualityRegConstCompare( |
| 1361 const Object& obj, | 1361 Register reg, |
| 1362 bool needs_number_check, | 1362 const Object& obj, |
| 1363 intptr_t token_pos) { | 1363 bool needs_number_check, |
| 1364 intptr_t token_pos) { |
| 1364 if (needs_number_check) { | 1365 if (needs_number_check) { |
| 1365 StubCode* stub_code = isolate()->stub_code(); | 1366 StubCode* stub_code = isolate()->stub_code(); |
| 1366 ASSERT(!obj.IsMint() && !obj.IsDouble() && !obj.IsBigint()); | 1367 ASSERT(!obj.IsMint() && !obj.IsDouble() && !obj.IsBigint()); |
| 1367 __ Push(reg); | 1368 __ Push(reg); |
| 1368 __ PushObject(obj, PP); | 1369 __ PushObject(obj, PP); |
| 1369 if (is_optimizing()) { | 1370 if (is_optimizing()) { |
| 1370 __ BranchLinkPatchable( | 1371 __ BranchLinkPatchable( |
| 1371 &stub_code->OptimizedIdenticalWithNumberCheckLabel()); | 1372 &stub_code->OptimizedIdenticalWithNumberCheckLabel()); |
| 1372 } else { | 1373 } else { |
| 1373 __ BranchLinkPatchable( | 1374 __ BranchLinkPatchable( |
| 1374 &stub_code->UnoptimizedIdenticalWithNumberCheckLabel()); | 1375 &stub_code->UnoptimizedIdenticalWithNumberCheckLabel()); |
| 1375 } | 1376 } |
| 1376 if (token_pos != Scanner::kNoSourcePos) { | 1377 if (token_pos != Scanner::kNoSourcePos) { |
| 1377 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, | 1378 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, |
| 1378 Isolate::kNoDeoptId, | 1379 Isolate::kNoDeoptId, |
| 1379 token_pos); | 1380 token_pos); |
| 1380 } | 1381 } |
| 1382 // Stub returns result in flags (result of a cmp, we need Z computed). |
| 1381 __ Drop(1); // Discard constant. | 1383 __ Drop(1); // Discard constant. |
| 1382 __ Pop(reg); // Restore 'reg'. | 1384 __ Pop(reg); // Restore 'reg'. |
| 1383 return; | 1385 } else { |
| 1386 __ CompareObject(reg, obj, PP); |
| 1384 } | 1387 } |
| 1385 | 1388 return EQ; |
| 1386 __ CompareObject(reg, obj, PP); | |
| 1387 } | 1389 } |
| 1388 | 1390 |
| 1389 | 1391 |
| 1390 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, | 1392 Condition FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, |
| 1391 Register right, | 1393 Register right, |
| 1392 bool needs_number_check, | 1394 bool needs_number_check, |
| 1393 intptr_t token_pos) { | 1395 intptr_t token_pos) { |
| 1394 if (needs_number_check) { | 1396 if (needs_number_check) { |
| 1395 StubCode* stub_code = isolate()->stub_code(); | 1397 StubCode* stub_code = isolate()->stub_code(); |
| 1396 __ Push(left); | 1398 __ Push(left); |
| 1397 __ Push(right); | 1399 __ Push(right); |
| 1398 if (is_optimizing()) { | 1400 if (is_optimizing()) { |
| 1399 __ BranchLinkPatchable( | 1401 __ BranchLinkPatchable( |
| 1400 &stub_code->OptimizedIdenticalWithNumberCheckLabel()); | 1402 &stub_code->OptimizedIdenticalWithNumberCheckLabel()); |
| 1401 } else { | 1403 } else { |
| 1402 __ BranchLinkPatchable( | 1404 __ BranchLinkPatchable( |
| 1403 &stub_code->UnoptimizedIdenticalWithNumberCheckLabel()); | 1405 &stub_code->UnoptimizedIdenticalWithNumberCheckLabel()); |
| 1404 } | 1406 } |
| 1405 if (token_pos != Scanner::kNoSourcePos) { | 1407 if (token_pos != Scanner::kNoSourcePos) { |
| 1406 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, | 1408 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, |
| 1407 Isolate::kNoDeoptId, | 1409 Isolate::kNoDeoptId, |
| 1408 token_pos); | 1410 token_pos); |
| 1409 } | 1411 } |
| 1410 #if defined(DEBUG) | 1412 #if defined(DEBUG) |
| 1411 if (!is_optimizing()) { | 1413 if (!is_optimizing()) { |
| 1412 // Do this *after* adding the pc descriptor! | 1414 // Do this *after* adding the pc descriptor! |
| 1413 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP); | 1415 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP); |
| 1414 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP); | 1416 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP); |
| 1415 } | 1417 } |
| 1416 #endif | 1418 #endif |
| 1417 // Stub returns result in flags (result of a cmpl, we need ZF computed). | 1419 // Stub returns result in flags (result of a cmp, we need Z computed). |
| 1418 __ Pop(right); | 1420 __ Pop(right); |
| 1419 __ Pop(left); | 1421 __ Pop(left); |
| 1420 } else { | 1422 } else { |
| 1421 __ CompareRegisters(left, right); | 1423 __ CompareRegisters(left, right); |
| 1422 } | 1424 } |
| 1425 return EQ; |
| 1423 } | 1426 } |
| 1424 | 1427 |
| 1425 | 1428 |
| 1426 // This function must be in sync with FlowGraphCompiler::RecordSafepoint and | 1429 // This function must be in sync with FlowGraphCompiler::RecordSafepoint and |
| 1427 // FlowGraphCompiler::SlowPathEnvironmentFor. | 1430 // FlowGraphCompiler::SlowPathEnvironmentFor. |
| 1428 void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) { | 1431 void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) { |
| 1429 #if defined(DEBUG) | 1432 #if defined(DEBUG) |
| 1430 locs->CheckWritableInputs(); | 1433 locs->CheckWritableInputs(); |
| 1431 ClobberDeadTempRegisters(locs); | 1434 ClobberDeadTempRegisters(locs); |
| 1432 #endif | 1435 #endif |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1827 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 1830 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
| 1828 __ PopDouble(reg); | 1831 __ PopDouble(reg); |
| 1829 } | 1832 } |
| 1830 | 1833 |
| 1831 | 1834 |
| 1832 #undef __ | 1835 #undef __ |
| 1833 | 1836 |
| 1834 } // namespace dart | 1837 } // namespace dart |
| 1835 | 1838 |
| 1836 #endif // defined TARGET_ARCH_ARM64 | 1839 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |