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 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1330 *StubCode::CallStaticFunction_entry(), | 1330 *StubCode::CallStaticFunction_entry(), |
1331 RawPcDescriptors::kOther, locs, function); | 1331 RawPcDescriptors::kOther, locs, function); |
1332 __ Drop(argument_count); | 1332 __ Drop(argument_count); |
1333 } | 1333 } |
1334 | 1334 |
1335 | 1335 |
1336 Condition FlowGraphCompiler::EmitEqualityRegConstCompare( | 1336 Condition FlowGraphCompiler::EmitEqualityRegConstCompare( |
1337 Register reg, | 1337 Register reg, |
1338 const Object& obj, | 1338 const Object& obj, |
1339 bool needs_number_check, | 1339 bool needs_number_check, |
1340 TokenPosition token_pos) { | 1340 TokenPosition token_pos, |
| 1341 intptr_t deopt_id) { |
1341 if (needs_number_check) { | 1342 if (needs_number_check) { |
1342 ASSERT(!obj.IsMint() && !obj.IsDouble() && !obj.IsBigint()); | 1343 ASSERT(!obj.IsMint() && !obj.IsDouble() && !obj.IsBigint()); |
1343 __ Push(reg); | 1344 __ Push(reg); |
1344 __ PushObject(obj); | 1345 __ PushObject(obj); |
1345 if (is_optimizing()) { | 1346 if (is_optimizing()) { |
1346 __ BranchLinkPatchable( | 1347 __ BranchLinkPatchable( |
1347 *StubCode::OptimizedIdenticalWithNumberCheck_entry()); | 1348 *StubCode::OptimizedIdenticalWithNumberCheck_entry()); |
1348 } else { | 1349 } else { |
1349 __ BranchLinkPatchable( | 1350 __ BranchLinkPatchable( |
1350 *StubCode::UnoptimizedIdenticalWithNumberCheck_entry()); | 1351 *StubCode::UnoptimizedIdenticalWithNumberCheck_entry()); |
1351 } | 1352 } |
1352 if (token_pos.IsReal()) { | 1353 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, deopt_id, token_pos); |
1353 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, Thread::kNoDeoptId, | |
1354 token_pos); | |
1355 } | |
1356 // Stub returns result in flags (result of a cmp, we need Z computed). | 1354 // Stub returns result in flags (result of a cmp, we need Z computed). |
1357 __ Drop(1); // Discard constant. | 1355 __ Drop(1); // Discard constant. |
1358 __ Pop(reg); // Restore 'reg'. | 1356 __ Pop(reg); // Restore 'reg'. |
1359 } else { | 1357 } else { |
1360 __ CompareObject(reg, obj); | 1358 __ CompareObject(reg, obj); |
1361 } | 1359 } |
1362 return EQ; | 1360 return EQ; |
1363 } | 1361 } |
1364 | 1362 |
1365 | 1363 |
1366 Condition FlowGraphCompiler::EmitEqualityRegRegCompare( | 1364 Condition FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, |
1367 Register left, | 1365 Register right, |
1368 Register right, | 1366 bool needs_number_check, |
1369 bool needs_number_check, | 1367 TokenPosition token_pos, |
1370 TokenPosition token_pos) { | 1368 intptr_t deopt_id) { |
1371 if (needs_number_check) { | 1369 if (needs_number_check) { |
1372 __ Push(left); | 1370 __ Push(left); |
1373 __ Push(right); | 1371 __ Push(right); |
1374 if (is_optimizing()) { | 1372 if (is_optimizing()) { |
1375 __ BranchLinkPatchable( | 1373 __ BranchLinkPatchable( |
1376 *StubCode::OptimizedIdenticalWithNumberCheck_entry()); | 1374 *StubCode::OptimizedIdenticalWithNumberCheck_entry()); |
1377 } else { | 1375 } else { |
1378 __ BranchLinkPatchable( | 1376 __ BranchLinkPatchable( |
1379 *StubCode::UnoptimizedIdenticalWithNumberCheck_entry()); | 1377 *StubCode::UnoptimizedIdenticalWithNumberCheck_entry()); |
1380 } | 1378 } |
1381 if (token_pos.IsReal()) { | 1379 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, deopt_id, token_pos); |
1382 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, Thread::kNoDeoptId, | |
1383 token_pos); | |
1384 } | |
1385 // Stub returns result in flags (result of a cmp, we need Z computed). | 1380 // Stub returns result in flags (result of a cmp, we need Z computed). |
1386 __ Pop(right); | 1381 __ Pop(right); |
1387 __ Pop(left); | 1382 __ Pop(left); |
1388 } else { | 1383 } else { |
1389 __ CompareRegisters(left, right); | 1384 __ CompareRegisters(left, right); |
1390 } | 1385 } |
1391 return EQ; | 1386 return EQ; |
1392 } | 1387 } |
1393 | 1388 |
1394 | 1389 |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 1766 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
1772 __ PopDouble(reg); | 1767 __ PopDouble(reg); |
1773 } | 1768 } |
1774 | 1769 |
1775 | 1770 |
1776 #undef __ | 1771 #undef __ |
1777 | 1772 |
1778 } // namespace dart | 1773 } // namespace dart |
1779 | 1774 |
1780 #endif // defined TARGET_ARCH_ARM64 | 1775 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |