Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Side by Side Diff: runtime/vm/assembler_test.cc

Issue 1168483003: Thread-local store buffers, v2 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review comments. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/gc_marker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/simulator.h" 8 #include "vm/simulator.h"
9 #include "vm/unit_test.h" 9 #include "vm/unit_test.h"
10 #include "vm/virtual_memory.h" 10 #include "vm/virtual_memory.h"
(...skipping 23 matching lines...) Expand all
34 const Array& new_array = Array::Handle(Array::New(3, Heap::kNew)); 34 const Array& new_array = Array::Handle(Array::New(3, Heap::kNew));
35 const GrowableObjectArray& grow_old_array = GrowableObjectArray::Handle( 35 const GrowableObjectArray& grow_old_array = GrowableObjectArray::Handle(
36 GrowableObjectArray::New(old_array, Heap::kOld)); 36 GrowableObjectArray::New(old_array, Heap::kOld));
37 const GrowableObjectArray& grow_new_array = GrowableObjectArray::Handle( 37 const GrowableObjectArray& grow_new_array = GrowableObjectArray::Handle(
38 GrowableObjectArray::New(old_array, Heap::kNew)); 38 GrowableObjectArray::New(old_array, Heap::kNew));
39 Smi& smi = Smi::Handle(); 39 Smi& smi = Smi::Handle();
40 const Context& ctx = Context::Handle(Context::New(0)); 40 const Context& ctx = Context::Handle(Context::New(0));
41 Thread* thread = Thread::Current(); 41 Thread* thread = Thread::Current();
42 42
43 EXPECT(old_array.raw() == grow_old_array.data()); 43 EXPECT(old_array.raw() == grow_old_array.data());
44 EXPECT(!Isolate::Current()->store_buffer()->Contains(grow_old_array.raw())); 44 EXPECT(!thread->StoreBufferContains(grow_old_array.raw()));
45 EXPECT(old_array.raw() == grow_new_array.data()); 45 EXPECT(old_array.raw() == grow_new_array.data());
46 EXPECT(!Isolate::Current()->store_buffer()->Contains(grow_new_array.raw())); 46 EXPECT(!thread->StoreBufferContains(grow_new_array.raw()));
47 47
48 // Store Smis into the old object. 48 // Store Smis into the old object.
49 for (int i = -128; i < 128; i++) { 49 for (int i = -128; i < 128; i++) {
50 smi = Smi::New(i); 50 smi = Smi::New(i);
51 test_code(ctx.raw(), smi.raw(), grow_old_array.raw(), thread); 51 test_code(ctx.raw(), smi.raw(), grow_old_array.raw(), thread);
52 EXPECT(reinterpret_cast<RawArray*>(smi.raw()) == grow_old_array.data()); 52 EXPECT(reinterpret_cast<RawArray*>(smi.raw()) == grow_old_array.data());
53 EXPECT(!Isolate::Current()->store_buffer()->Contains(grow_old_array.raw())); 53 EXPECT(!thread->StoreBufferContains(grow_old_array.raw()));
54 } 54 }
55 55
56 // Store an old object into the old object. 56 // Store an old object into the old object.
57 test_code(ctx.raw(), old_array.raw(), grow_old_array.raw(), thread); 57 test_code(ctx.raw(), old_array.raw(), grow_old_array.raw(), thread);
58 EXPECT(old_array.raw() == grow_old_array.data()); 58 EXPECT(old_array.raw() == grow_old_array.data());
59 EXPECT(!Isolate::Current()->store_buffer()->Contains(grow_old_array.raw())); 59 EXPECT(!thread->StoreBufferContains(grow_old_array.raw()));
60 60
61 // Store a new object into the old object. 61 // Store a new object into the old object.
62 test_code(ctx.raw(), new_array.raw(), grow_old_array.raw(), thread); 62 test_code(ctx.raw(), new_array.raw(), grow_old_array.raw(), thread);
63 EXPECT(new_array.raw() == grow_old_array.data()); 63 EXPECT(new_array.raw() == grow_old_array.data());
64 EXPECT(Isolate::Current()->store_buffer()->Contains(grow_old_array.raw())); 64 EXPECT(thread->StoreBufferContains(grow_old_array.raw()));
65 65
66 // Store a new object into the new object. 66 // Store a new object into the new object.
67 test_code(ctx.raw(), new_array.raw(), grow_new_array.raw(), thread); 67 test_code(ctx.raw(), new_array.raw(), grow_new_array.raw(), thread);
68 EXPECT(new_array.raw() == grow_new_array.data()); 68 EXPECT(new_array.raw() == grow_new_array.data());
69 EXPECT(!Isolate::Current()->store_buffer()->Contains(grow_new_array.raw())); 69 EXPECT(!thread->StoreBufferContains(grow_new_array.raw()));
70 70
71 // Store an old object into the new object. 71 // Store an old object into the new object.
72 test_code(ctx.raw(), old_array.raw(), grow_new_array.raw(), thread); 72 test_code(ctx.raw(), old_array.raw(), grow_new_array.raw(), thread);
73 EXPECT(old_array.raw() == grow_new_array.data()); 73 EXPECT(old_array.raw() == grow_new_array.data());
74 EXPECT(!Isolate::Current()->store_buffer()->Contains(grow_new_array.raw())); 74 EXPECT(!thread->StoreBufferContains(grow_new_array.raw()));
75 } 75 }
76 76
77 } // namespace dart 77 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/gc_marker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698