| 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 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1633 __ Drop(argument_count); | 1633 __ Drop(argument_count); |
| 1634 if (!is_last_check) { | 1634 if (!is_last_check) { |
| 1635 assembler()->jmp(&match_found); | 1635 assembler()->jmp(&match_found); |
| 1636 } | 1636 } |
| 1637 assembler()->Bind(&next_test); | 1637 assembler()->Bind(&next_test); |
| 1638 } | 1638 } |
| 1639 assembler()->Bind(&match_found); | 1639 assembler()->Bind(&match_found); |
| 1640 } | 1640 } |
| 1641 | 1641 |
| 1642 | 1642 |
| 1643 void FlowGraphCompiler::EmitDoubleCompareBranch(Condition true_condition, | |
| 1644 FpuRegister left, | |
| 1645 FpuRegister right, | |
| 1646 BranchInstr* branch) { | |
| 1647 ASSERT(branch != NULL); | |
| 1648 assembler()->comisd(left, right); | |
| 1649 BlockEntryInstr* nan_result = (true_condition == NOT_EQUAL) ? | |
| 1650 branch->true_successor() : branch->false_successor(); | |
| 1651 assembler()->j(PARITY_EVEN, GetJumpLabel(nan_result)); | |
| 1652 branch->EmitBranchOnCondition(this, true_condition); | |
| 1653 } | |
| 1654 | |
| 1655 | |
| 1656 void FlowGraphCompiler::EmitDoubleCompareBool(Condition true_condition, | |
| 1657 FpuRegister left, | |
| 1658 FpuRegister right, | |
| 1659 Register result) { | |
| 1660 assembler()->comisd(left, right); | |
| 1661 Label is_false, is_true, done; | |
| 1662 // x == NaN -> false, x != NaN -> true. | |
| 1663 Label* nan_label = (true_condition == NOT_EQUAL) ? &is_true : &is_false; | |
| 1664 assembler()->j(PARITY_EVEN, nan_label, Assembler::kNearJump); | |
| 1665 assembler()->j(true_condition, &is_true, Assembler::kNearJump); | |
| 1666 assembler()->Bind(&is_false); | |
| 1667 assembler()->LoadObject(result, Bool::False(), PP); | |
| 1668 assembler()->jmp(&done); | |
| 1669 assembler()->Bind(&is_true); | |
| 1670 assembler()->LoadObject(result, Bool::True(), PP); | |
| 1671 assembler()->Bind(&done); | |
| 1672 } | |
| 1673 | |
| 1674 | |
| 1675 FieldAddress FlowGraphCompiler::ElementAddressForIntIndex(intptr_t cid, | 1643 FieldAddress FlowGraphCompiler::ElementAddressForIntIndex(intptr_t cid, |
| 1676 intptr_t index_scale, | 1644 intptr_t index_scale, |
| 1677 Register array, | 1645 Register array, |
| 1678 intptr_t index) { | 1646 intptr_t index) { |
| 1679 const int64_t disp = | 1647 const int64_t disp = |
| 1680 static_cast<int64_t>(index) * index_scale + DataOffsetFor(cid); | 1648 static_cast<int64_t>(index) * index_scale + DataOffsetFor(cid); |
| 1681 ASSERT(Utils::IsInt(32, disp)); | 1649 ASSERT(Utils::IsInt(32, disp)); |
| 1682 return FieldAddress(array, static_cast<int32_t>(disp)); | 1650 return FieldAddress(array, static_cast<int32_t>(disp)); |
| 1683 } | 1651 } |
| 1684 | 1652 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1930 __ movups(reg, Address(RSP, 0)); | 1898 __ movups(reg, Address(RSP, 0)); |
| 1931 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); | 1899 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); |
| 1932 } | 1900 } |
| 1933 | 1901 |
| 1934 | 1902 |
| 1935 #undef __ | 1903 #undef __ |
| 1936 | 1904 |
| 1937 } // namespace dart | 1905 } // namespace dart |
| 1938 | 1906 |
| 1939 #endif // defined TARGET_ARCH_X64 | 1907 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |