| 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/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) | 13 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
| 14 | 14 |
| 15 ASSEMBLER_TEST_EXTERN(StoreIntoObject); | 15 ASSEMBLER_TEST_EXTERN(StoreIntoObject); |
| 16 | 16 |
| 17 ASSEMBLER_TEST_RUN(StoreIntoObject, entry) { | 17 ASSEMBLER_TEST_RUN(StoreIntoObject, test) { |
| 18 typedef void (*StoreData)(RawContext* ctx, | 18 typedef void (*StoreData)(RawContext* ctx, |
| 19 RawObject* value, | 19 RawObject* value, |
| 20 RawObject* growable_array); | 20 RawObject* growable_array); |
| 21 StoreData test_code = reinterpret_cast<StoreData>(entry); | 21 StoreData test_code = reinterpret_cast<StoreData>(test->entry()); |
| 22 | 22 |
| 23 const Array& old_array = Array::Handle(Array::New(3, Heap::kOld)); | 23 const Array& old_array = Array::Handle(Array::New(3, Heap::kOld)); |
| 24 const Array& new_array = Array::Handle(Array::New(3, Heap::kNew)); | 24 const Array& new_array = Array::Handle(Array::New(3, Heap::kNew)); |
| 25 const GrowableObjectArray& grow_old_array = GrowableObjectArray::Handle( | 25 const GrowableObjectArray& grow_old_array = GrowableObjectArray::Handle( |
| 26 GrowableObjectArray::New(old_array, Heap::kOld)); | 26 GrowableObjectArray::New(old_array, Heap::kOld)); |
| 27 const GrowableObjectArray& grow_new_array = GrowableObjectArray::Handle( | 27 const GrowableObjectArray& grow_new_array = GrowableObjectArray::Handle( |
| 28 GrowableObjectArray::New(old_array, Heap::kNew)); | 28 GrowableObjectArray::New(old_array, Heap::kNew)); |
| 29 Smi& smi = Smi::Handle(); | 29 Smi& smi = Smi::Handle(); |
| 30 const Context& ctx = Context::Handle(Context::New(0)); | 30 const Context& ctx = Context::Handle(Context::New(0)); |
| 31 | 31 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 test_code(ctx.raw(), old_array.raw(), grow_new_array.raw()); | 73 test_code(ctx.raw(), old_array.raw(), grow_new_array.raw()); |
| 74 EXPECT(old_array.raw() == grow_new_array.data()); | 74 EXPECT(old_array.raw() == grow_new_array.data()); |
| 75 EXPECT(!Isolate::Current()->store_buffer_block()->Contains( | 75 EXPECT(!Isolate::Current()->store_buffer_block()->Contains( |
| 76 reinterpret_cast<uword>(grow_new_array.raw()) + | 76 reinterpret_cast<uword>(grow_new_array.raw()) + |
| 77 GrowableObjectArray::data_offset() - kHeapObjectTag)); | 77 GrowableObjectArray::data_offset() - kHeapObjectTag)); |
| 78 } | 78 } |
| 79 | 79 |
| 80 #endif | 80 #endif |
| 81 | 81 |
| 82 } // namespace dart | 82 } // namespace dart |
| OLD | NEW |