| 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 // TODO(zra): Remove when test is ready to enable. | |
| 6 #include "platform/globals.h" | |
| 7 #if !defined(TARGET_ARCH_ARM64) | |
| 8 | |
| 9 #include "vm/assembler.h" | 5 #include "vm/assembler.h" |
| 10 #include "vm/globals.h" | 6 #include "vm/globals.h" |
| 11 #include "vm/os.h" | 7 #include "vm/os.h" |
| 12 #include "vm/simulator.h" | 8 #include "vm/simulator.h" |
| 13 #include "vm/unit_test.h" | 9 #include "vm/unit_test.h" |
| 14 #include "vm/virtual_memory.h" | 10 #include "vm/virtual_memory.h" |
| 15 | 11 |
| 16 namespace dart { | 12 namespace dart { |
| 17 | 13 |
| 18 ASSEMBLER_TEST_EXTERN(StoreIntoObject); | 14 ASSEMBLER_TEST_EXTERN(StoreIntoObject); |
| 19 | 15 |
| 20 ASSEMBLER_TEST_RUN(StoreIntoObject, test) { | 16 ASSEMBLER_TEST_RUN(StoreIntoObject, test) { |
| 21 #if defined(USING_SIMULATOR) | 17 #if defined(USING_SIMULATOR) |
| 22 #define test_code(ctx, value, growable_array) \ | 18 #define test_code(ctx, value, growable_array) \ |
| 23 Simulator::Current()->Call( \ | 19 Simulator::Current()->Call( \ |
| 24 bit_cast<int32_t, uword>(test->entry()), \ | 20 bit_cast<intptr_t, uword>(test->entry()), \ |
| 25 reinterpret_cast<int32_t>(ctx), \ | 21 reinterpret_cast<intptr_t>(ctx), \ |
| 26 reinterpret_cast<int32_t>(value), \ | 22 reinterpret_cast<intptr_t>(value), \ |
| 27 reinterpret_cast<int32_t>(growable_array), \ | 23 reinterpret_cast<intptr_t>(growable_array), \ |
| 28 0) | 24 0) |
| 29 #else | 25 #else |
| 30 typedef void (*StoreData)(RawContext* ctx, | 26 typedef void (*StoreData)(RawContext* ctx, |
| 31 RawObject* value, | 27 RawObject* value, |
| 32 RawObject* growable_array); | 28 RawObject* growable_array); |
| 33 StoreData test_code = reinterpret_cast<StoreData>(test->entry()); | 29 StoreData test_code = reinterpret_cast<StoreData>(test->entry()); |
| 34 #endif | 30 #endif |
| 35 | 31 |
| 36 const Array& old_array = Array::Handle(Array::New(3, Heap::kOld)); | 32 const Array& old_array = Array::Handle(Array::New(3, Heap::kOld)); |
| 37 const Array& new_array = Array::Handle(Array::New(3, Heap::kNew)); | 33 const Array& new_array = Array::Handle(Array::New(3, Heap::kNew)); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 EXPECT(new_array.raw() == grow_new_array.data()); | 66 EXPECT(new_array.raw() == grow_new_array.data()); |
| 71 EXPECT(!Isolate::Current()->store_buffer()->Contains(grow_new_array.raw())); | 67 EXPECT(!Isolate::Current()->store_buffer()->Contains(grow_new_array.raw())); |
| 72 | 68 |
| 73 // Store an old object into the new object. | 69 // Store an old object into the new object. |
| 74 test_code(ctx.raw(), old_array.raw(), grow_new_array.raw()); | 70 test_code(ctx.raw(), old_array.raw(), grow_new_array.raw()); |
| 75 EXPECT(old_array.raw() == grow_new_array.data()); | 71 EXPECT(old_array.raw() == grow_new_array.data()); |
| 76 EXPECT(!Isolate::Current()->store_buffer()->Contains(grow_new_array.raw())); | 72 EXPECT(!Isolate::Current()->store_buffer()->Contains(grow_new_array.raw())); |
| 77 } | 73 } |
| 78 | 74 |
| 79 } // namespace dart | 75 } // namespace dart |
| 80 | |
| 81 #endif // !defined(TARGET_ARCH_ARM64) | |
| OLD | NEW |