| 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 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 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1440 } | 1440 } |
| 1441 | 1441 |
| 1442 if (needs_number_check) { | 1442 if (needs_number_check) { |
| 1443 __ pushq(reg); | 1443 __ pushq(reg); |
| 1444 __ PushObject(obj, PP); | 1444 __ PushObject(obj, PP); |
| 1445 if (is_optimizing()) { | 1445 if (is_optimizing()) { |
| 1446 __ CallPatchable(&StubCode::OptimizedIdenticalWithNumberCheckLabel()); | 1446 __ CallPatchable(&StubCode::OptimizedIdenticalWithNumberCheckLabel()); |
| 1447 } else { | 1447 } else { |
| 1448 __ CallPatchable(&StubCode::UnoptimizedIdenticalWithNumberCheckLabel()); | 1448 __ CallPatchable(&StubCode::UnoptimizedIdenticalWithNumberCheckLabel()); |
| 1449 } | 1449 } |
| 1450 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, | 1450 if (token_pos != Scanner::kDummyTokenIndex) { |
| 1451 Isolate::kNoDeoptId, | 1451 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, |
| 1452 token_pos); | 1452 Isolate::kNoDeoptId, |
| 1453 token_pos); |
| 1454 } |
| 1453 __ popq(reg); // Discard constant. | 1455 __ popq(reg); // Discard constant. |
| 1454 __ popq(reg); // Restore 'reg'. | 1456 __ popq(reg); // Restore 'reg'. |
| 1455 return; | 1457 return; |
| 1456 } | 1458 } |
| 1457 | 1459 |
| 1458 __ CompareObject(reg, obj, PP); | 1460 __ CompareObject(reg, obj, PP); |
| 1459 } | 1461 } |
| 1460 | 1462 |
| 1461 | 1463 |
| 1462 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, | 1464 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, |
| 1463 Register right, | 1465 Register right, |
| 1464 bool needs_number_check, | 1466 bool needs_number_check, |
| 1465 intptr_t token_pos) { | 1467 intptr_t token_pos) { |
| 1466 if (needs_number_check) { | 1468 if (needs_number_check) { |
| 1467 __ pushq(left); | 1469 __ pushq(left); |
| 1468 __ pushq(right); | 1470 __ pushq(right); |
| 1469 if (is_optimizing()) { | 1471 if (is_optimizing()) { |
| 1470 __ CallPatchable(&StubCode::OptimizedIdenticalWithNumberCheckLabel()); | 1472 __ CallPatchable(&StubCode::OptimizedIdenticalWithNumberCheckLabel()); |
| 1471 } else { | 1473 } else { |
| 1472 __ CallPatchable(&StubCode::UnoptimizedIdenticalWithNumberCheckLabel()); | 1474 __ CallPatchable(&StubCode::UnoptimizedIdenticalWithNumberCheckLabel()); |
| 1473 } | 1475 } |
| 1474 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, | 1476 if (token_pos != Scanner::kDummyTokenIndex) { |
| 1475 Isolate::kNoDeoptId, | 1477 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, |
| 1476 token_pos); | 1478 Isolate::kNoDeoptId, |
| 1479 token_pos); |
| 1480 } |
| 1477 // Stub returns result in flags (result of a cmpl, we need ZF computed). | 1481 // Stub returns result in flags (result of a cmpl, we need ZF computed). |
| 1478 __ popq(right); | 1482 __ popq(right); |
| 1479 __ popq(left); | 1483 __ popq(left); |
| 1480 } else { | 1484 } else { |
| 1481 __ cmpl(left, right); | 1485 __ cmpl(left, right); |
| 1482 } | 1486 } |
| 1483 } | 1487 } |
| 1484 | 1488 |
| 1485 | 1489 |
| 1486 // This function must be in sync with FlowGraphCompiler::RecordSafepoint and | 1490 // This function must be in sync with FlowGraphCompiler::RecordSafepoint and |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1847 __ movups(reg, Address(RSP, 0)); | 1851 __ movups(reg, Address(RSP, 0)); |
| 1848 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); | 1852 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); |
| 1849 } | 1853 } |
| 1850 | 1854 |
| 1851 | 1855 |
| 1852 #undef __ | 1856 #undef __ |
| 1853 | 1857 |
| 1854 } // namespace dart | 1858 } // namespace dart |
| 1855 | 1859 |
| 1856 #endif // defined TARGET_ARCH_X64 | 1860 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |