OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/os.h" | 9 #include "vm/os.h" |
10 #include "vm/unit_test.h" | 10 #include "vm/unit_test.h" |
(...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1801 __ jmp(&call1); | 1801 __ jmp(&call1); |
1802 } | 1802 } |
1803 | 1803 |
1804 | 1804 |
1805 ASSEMBLER_TEST_RUN(JumpSimpleLeaf, test) { | 1805 ASSEMBLER_TEST_RUN(JumpSimpleLeaf, test) { |
1806 typedef int (*JumpSimpleLeafCode)(); | 1806 typedef int (*JumpSimpleLeafCode)(); |
1807 EXPECT_EQ(42, reinterpret_cast<JumpSimpleLeafCode>(test->entry())()); | 1807 EXPECT_EQ(42, reinterpret_cast<JumpSimpleLeafCode>(test->entry())()); |
1808 } | 1808 } |
1809 | 1809 |
1810 | 1810 |
| 1811 ASSEMBLER_TEST_GENERATE(JumpIndirect, assembler) { |
| 1812 ExternalLabel call1(reinterpret_cast<uword>(LeafReturn42)); |
| 1813 __ movq(Address(CallingConventions::kArg1Reg, 0), Immediate(call1.address())); |
| 1814 __ jmp(Address(CallingConventions::kArg1Reg, 0)); |
| 1815 } |
| 1816 |
| 1817 |
| 1818 ASSEMBLER_TEST_RUN(JumpIndirect, test) { |
| 1819 uword temp = 0; |
| 1820 typedef int (*JumpIndirect)(uword*); |
| 1821 EXPECT_EQ(42, reinterpret_cast<JumpIndirect>(test->entry())(&temp)); |
| 1822 } |
| 1823 |
| 1824 |
1811 ASSEMBLER_TEST_GENERATE(SingleFPMoves, assembler) { | 1825 ASSEMBLER_TEST_GENERATE(SingleFPMoves, assembler) { |
1812 __ movq(RAX, Immediate(bit_cast<int32_t, float>(234.0f))); | 1826 __ movq(RAX, Immediate(bit_cast<int32_t, float>(234.0f))); |
1813 __ movd(XMM0, RAX); | 1827 __ movd(XMM0, RAX); |
1814 __ movss(XMM1, XMM0); | 1828 __ movss(XMM1, XMM0); |
1815 __ movss(XMM2, XMM1); | 1829 __ movss(XMM2, XMM1); |
1816 __ movss(XMM3, XMM2); | 1830 __ movss(XMM3, XMM2); |
1817 __ movss(XMM4, XMM3); | 1831 __ movss(XMM4, XMM3); |
1818 __ movss(XMM5, XMM4); | 1832 __ movss(XMM5, XMM4); |
1819 __ movss(XMM6, XMM5); | 1833 __ movss(XMM6, XMM5); |
1820 __ movss(XMM7, XMM6); | 1834 __ movss(XMM7, XMM6); |
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3536 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMaxInt64))); | 3550 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMaxInt64))); |
3537 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMinInt64))); | 3551 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMinInt64))); |
3538 | 3552 |
3539 EXPECT_EQ(0, range_of(Bool::True().raw())); | 3553 EXPECT_EQ(0, range_of(Bool::True().raw())); |
3540 } | 3554 } |
3541 | 3555 |
3542 | 3556 |
3543 } // namespace dart | 3557 } // namespace dart |
3544 | 3558 |
3545 #endif // defined TARGET_ARCH_X64 | 3559 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |