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 2641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2652 ASSEMBLER_TEST_GENERATE(PackedLogicalNot, assembler) { | 2652 ASSEMBLER_TEST_GENERATE(PackedLogicalNot, assembler) { |
2653 static const struct ALIGN16 { | 2653 static const struct ALIGN16 { |
2654 uint32_t a; | 2654 uint32_t a; |
2655 uint32_t b; | 2655 uint32_t b; |
2656 uint32_t c; | 2656 uint32_t c; |
2657 uint32_t d; | 2657 uint32_t d; |
2658 } constant1 = | 2658 } constant1 = |
2659 { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; | 2659 { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; |
2660 __ pushq(PP); // Save caller's pool pointer and load a new one here. | 2660 __ pushq(PP); // Save caller's pool pointer and load a new one here. |
2661 __ LoadPoolPointer(PP); | 2661 __ LoadPoolPointer(PP); |
2662 __ LoadImmediate(RAX, Immediate(reinterpret_cast<intptr_t>(&constant1)), PP); | 2662 __ LoadImmediate(RAX, Immediate(reinterpret_cast<intptr_t>(&constant1))); |
2663 __ movups(XMM9, Address(RAX, 0)); | 2663 __ movups(XMM9, Address(RAX, 0)); |
2664 __ notps(XMM9); | 2664 __ notps(XMM9); |
2665 __ movaps(XMM0, XMM9); | 2665 __ movaps(XMM0, XMM9); |
2666 __ pushq(RAX); | 2666 __ pushq(RAX); |
2667 __ movss(Address(RSP, 0), XMM0); | 2667 __ movss(Address(RSP, 0), XMM0); |
2668 __ popq(RAX); | 2668 __ popq(RAX); |
2669 __ popq(PP); // Restore caller's pool pointer. | 2669 __ popq(PP); // Restore caller's pool pointer. |
2670 __ ret(); | 2670 __ ret(); |
2671 } | 2671 } |
2672 | 2672 |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3061 } | 3061 } |
3062 | 3062 |
3063 | 3063 |
3064 ASSEMBLER_TEST_GENERATE(TestObjectCompare, assembler) { | 3064 ASSEMBLER_TEST_GENERATE(TestObjectCompare, assembler) { |
3065 ObjectStore* object_store = Isolate::Current()->object_store(); | 3065 ObjectStore* object_store = Isolate::Current()->object_store(); |
3066 const Object& obj = Object::ZoneHandle(object_store->smi_class()); | 3066 const Object& obj = Object::ZoneHandle(object_store->smi_class()); |
3067 Label fail; | 3067 Label fail; |
3068 __ EnterFrame(0); | 3068 __ EnterFrame(0); |
3069 __ pushq(PP); // Save caller's pool pointer and load a new one here. | 3069 __ pushq(PP); // Save caller's pool pointer and load a new one here. |
3070 __ LoadPoolPointer(PP); | 3070 __ LoadPoolPointer(PP); |
3071 __ LoadObject(RAX, obj, PP); | 3071 __ LoadObject(RAX, obj); |
3072 __ CompareObject(RAX, obj, PP); | 3072 __ CompareObject(RAX, obj); |
3073 __ j(NOT_EQUAL, &fail); | 3073 __ j(NOT_EQUAL, &fail); |
3074 __ LoadObject(RCX, obj, PP); | 3074 __ LoadObject(RCX, obj); |
3075 __ CompareObject(RCX, obj, PP); | 3075 __ CompareObject(RCX, obj); |
3076 __ j(NOT_EQUAL, &fail); | 3076 __ j(NOT_EQUAL, &fail); |
3077 const Smi& smi = Smi::ZoneHandle(Smi::New(15)); | 3077 const Smi& smi = Smi::ZoneHandle(Smi::New(15)); |
3078 __ LoadObject(RCX, smi, PP); | 3078 __ LoadObject(RCX, smi); |
3079 __ CompareObject(RCX, smi, PP); | 3079 __ CompareObject(RCX, smi); |
3080 __ j(NOT_EQUAL, &fail); | 3080 __ j(NOT_EQUAL, &fail); |
3081 __ pushq(RAX); | 3081 __ pushq(RAX); |
3082 __ StoreObject(Address(RSP, 0), obj, PP); | 3082 __ StoreObject(Address(RSP, 0), obj); |
3083 __ popq(RCX); | 3083 __ popq(RCX); |
3084 __ CompareObject(RCX, obj, PP); | 3084 __ CompareObject(RCX, obj); |
3085 __ j(NOT_EQUAL, &fail); | 3085 __ j(NOT_EQUAL, &fail); |
3086 __ pushq(RAX); | 3086 __ pushq(RAX); |
3087 __ StoreObject(Address(RSP, 0), smi, PP); | 3087 __ StoreObject(Address(RSP, 0), smi); |
3088 __ popq(RCX); | 3088 __ popq(RCX); |
3089 __ CompareObject(RCX, smi, PP); | 3089 __ CompareObject(RCX, smi); |
3090 __ j(NOT_EQUAL, &fail); | 3090 __ j(NOT_EQUAL, &fail); |
3091 __ movl(RAX, Immediate(1)); // OK | 3091 __ movl(RAX, Immediate(1)); // OK |
3092 __ popq(PP); // Restore caller's pool pointer. | 3092 __ popq(PP); // Restore caller's pool pointer. |
3093 __ LeaveFrame(); | 3093 __ LeaveFrame(); |
3094 __ ret(); | 3094 __ ret(); |
3095 __ Bind(&fail); | 3095 __ Bind(&fail); |
3096 __ movl(RAX, Immediate(0)); // Fail. | 3096 __ movl(RAX, Immediate(0)); // Fail. |
3097 __ popq(PP); // Restore caller's pool pointer. | 3097 __ popq(PP); // Restore caller's pool pointer. |
3098 __ LeaveFrame(); | 3098 __ LeaveFrame(); |
3099 __ ret(); | 3099 __ ret(); |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3642 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMaxInt64))); | 3642 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMaxInt64))); |
3643 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMinInt64))); | 3643 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMinInt64))); |
3644 | 3644 |
3645 EXPECT_EQ(0, range_of(Bool::True().raw())); | 3645 EXPECT_EQ(0, range_of(Bool::True().raw())); |
3646 } | 3646 } |
3647 | 3647 |
3648 | 3648 |
3649 } // namespace dart | 3649 } // namespace dart |
3650 | 3650 |
3651 #endif // defined TARGET_ARCH_X64 | 3651 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |