OLD | NEW |
1 // Copyright (c) 2012, 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/assembler.h" | 5 #include "vm/assembler.h" |
6 #include "vm/globals.h" | 6 #include "vm/globals.h" |
7 #include "vm/os.h" | 7 #include "vm/os.h" |
8 #include "vm/unit_test.h" | 8 #include "vm/unit_test.h" |
9 #include "vm/virtual_memory.h" | 9 #include "vm/virtual_memory.h" |
10 | 10 |
11 namespace dart { | 11 namespace dart { |
12 | 12 |
| 13 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
| 14 |
13 ASSEMBLER_TEST_EXTERN(StoreIntoObject); | 15 ASSEMBLER_TEST_EXTERN(StoreIntoObject); |
14 | 16 |
15 ASSEMBLER_TEST_RUN(StoreIntoObject, entry) { | 17 ASSEMBLER_TEST_RUN(StoreIntoObject, entry) { |
16 typedef void (*StoreData)(RawContext* ctx, | 18 typedef void (*StoreData)(RawContext* ctx, |
17 RawObject* value, | 19 RawObject* value, |
18 RawObject* growable_array); | 20 RawObject* growable_array); |
19 StoreData test_code = reinterpret_cast<StoreData>(entry); | 21 StoreData test_code = reinterpret_cast<StoreData>(entry); |
20 | 22 |
21 const Array& old_array = Array::Handle(Array::New(3, Heap::kOld)); | 23 const Array& old_array = Array::Handle(Array::New(3, Heap::kOld)); |
22 const Array& new_array = Array::Handle(Array::New(3, Heap::kNew)); | 24 const Array& new_array = Array::Handle(Array::New(3, Heap::kNew)); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 GrowableObjectArray::data_offset() - kHeapObjectTag)); | 70 GrowableObjectArray::data_offset() - kHeapObjectTag)); |
69 | 71 |
70 // Store an old object into the new object. | 72 // Store an old object into the new object. |
71 test_code(ctx.raw(), old_array.raw(), grow_new_array.raw()); | 73 test_code(ctx.raw(), old_array.raw(), grow_new_array.raw()); |
72 EXPECT(old_array.raw() == grow_new_array.data()); | 74 EXPECT(old_array.raw() == grow_new_array.data()); |
73 EXPECT(!Isolate::Current()->store_buffer_block()->Contains( | 75 EXPECT(!Isolate::Current()->store_buffer_block()->Contains( |
74 reinterpret_cast<uword>(grow_new_array.raw()) + | 76 reinterpret_cast<uword>(grow_new_array.raw()) + |
75 GrowableObjectArray::data_offset() - kHeapObjectTag)); | 77 GrowableObjectArray::data_offset() - kHeapObjectTag)); |
76 } | 78 } |
77 | 79 |
| 80 #endif |
| 81 |
78 } // namespace dart | 82 } // namespace dart |
OLD | NEW |