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

Side by Side Diff: test/cctest/heap/test-compaction.cc

Issue 2900603004: [heap] Add --stress-incremental-marking flag. (Closed)
Patch Set: fix test Created 3 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 | « test/cctest/heap/test-array-buffer-tracker.cc ('k') | test/cctest/heap/test-heap.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/factory.h" 5 #include "src/factory.h"
6 #include "src/heap/mark-compact.h" 6 #include "src/heap/mark-compact.h"
7 #include "src/isolate.h" 7 #include "src/isolate.h"
8 // FIXME(mstarzinger, marja): This is weird, but required because of the missing 8 // FIXME(mstarzinger, marja): This is weird, but required because of the missing
9 // (disallowed) include: src/factory.h -> src/objects-inl.h 9 // (disallowed) include: src/factory.h -> src/objects-inl.h
10 #include "src/objects-inl.h" 10 #include "src/objects-inl.h"
(...skipping 29 matching lines...) Expand all
40 40
41 } // namespace 41 } // namespace
42 42
43 HEAP_TEST(CompactionFullAbortedPage) { 43 HEAP_TEST(CompactionFullAbortedPage) {
44 // Test the scenario where we reach OOM during compaction and the whole page 44 // Test the scenario where we reach OOM during compaction and the whole page
45 // is aborted. 45 // is aborted.
46 46
47 // Disable concurrent sweeping to ensure memory is in an expected state, i.e., 47 // Disable concurrent sweeping to ensure memory is in an expected state, i.e.,
48 // we can reach the state of a half aborted page. 48 // we can reach the state of a half aborted page.
49 FLAG_concurrent_sweeping = false; 49 FLAG_concurrent_sweeping = false;
50 FLAG_stress_incremental_marking = false;
50 FLAG_manual_evacuation_candidates_selection = true; 51 FLAG_manual_evacuation_candidates_selection = true;
51 CcTest::InitializeVM(); 52 CcTest::InitializeVM();
52 Isolate* isolate = CcTest::i_isolate(); 53 Isolate* isolate = CcTest::i_isolate();
53 Heap* heap = isolate->heap(); 54 Heap* heap = isolate->heap();
54 { 55 {
55 HandleScope scope1(isolate); 56 HandleScope scope1(isolate);
56 57
57 heap::SealCurrentObjects(heap); 58 heap::SealCurrentObjects(heap);
58 59
59 { 60 {
(...skipping 22 matching lines...) Expand all
82 } 83 }
83 84
84 85
85 HEAP_TEST(CompactionPartiallyAbortedPage) { 86 HEAP_TEST(CompactionPartiallyAbortedPage) {
86 // Test the scenario where we reach OOM during compaction and parts of the 87 // Test the scenario where we reach OOM during compaction and parts of the
87 // page have already been migrated to a new one. 88 // page have already been migrated to a new one.
88 89
89 // Disable concurrent sweeping to ensure memory is in an expected state, i.e., 90 // Disable concurrent sweeping to ensure memory is in an expected state, i.e.,
90 // we can reach the state of a half aborted page. 91 // we can reach the state of a half aborted page.
91 FLAG_concurrent_sweeping = false; 92 FLAG_concurrent_sweeping = false;
93 FLAG_stress_incremental_marking = false;
92 FLAG_manual_evacuation_candidates_selection = true; 94 FLAG_manual_evacuation_candidates_selection = true;
93 95
94 const int objects_per_page = 10; 96 const int objects_per_page = 10;
95 const int object_size = Page::kAllocatableMemory / objects_per_page; 97 const int object_size = Page::kAllocatableMemory / objects_per_page;
96 98
97 CcTest::InitializeVM(); 99 CcTest::InitializeVM();
98 Isolate* isolate = CcTest::i_isolate(); 100 Isolate* isolate = CcTest::i_isolate();
99 Heap* heap = isolate->heap(); 101 Heap* heap = isolate->heap();
100 { 102 {
101 HandleScope scope1(isolate); 103 HandleScope scope1(isolate);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 158
157 HEAP_TEST(CompactionPartiallyAbortedPageIntraAbortedPointers) { 159 HEAP_TEST(CompactionPartiallyAbortedPageIntraAbortedPointers) {
158 // Test the scenario where we reach OOM during compaction and parts of the 160 // Test the scenario where we reach OOM during compaction and parts of the
159 // page have already been migrated to a new one. Objects on the aborted page 161 // page have already been migrated to a new one. Objects on the aborted page
160 // are linked together. This test makes sure that intra-aborted page pointers 162 // are linked together. This test makes sure that intra-aborted page pointers
161 // get properly updated. 163 // get properly updated.
162 164
163 // Disable concurrent sweeping to ensure memory is in an expected state, i.e., 165 // Disable concurrent sweeping to ensure memory is in an expected state, i.e.,
164 // we can reach the state of a half aborted page. 166 // we can reach the state of a half aborted page.
165 FLAG_concurrent_sweeping = false; 167 FLAG_concurrent_sweeping = false;
168 FLAG_stress_incremental_marking = false;
166 FLAG_manual_evacuation_candidates_selection = true; 169 FLAG_manual_evacuation_candidates_selection = true;
167 170
168 const int objects_per_page = 10; 171 const int objects_per_page = 10;
169 const int object_size = Page::kAllocatableMemory / objects_per_page; 172 const int object_size = Page::kAllocatableMemory / objects_per_page;
170 173
171 CcTest::InitializeVM(); 174 CcTest::InitializeVM();
172 Isolate* isolate = CcTest::i_isolate(); 175 Isolate* isolate = CcTest::i_isolate();
173 Heap* heap = isolate->heap(); 176 Heap* heap = isolate->heap();
174 { 177 {
175 HandleScope scope1(isolate); 178 HandleScope scope1(isolate);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 // page have already been migrated to a new one. Objects on the aborted page 246 // page have already been migrated to a new one. Objects on the aborted page
244 // are linked together and the very first object on the aborted page points 247 // are linked together and the very first object on the aborted page points
245 // into new space. The test verifies that the store buffer entries are 248 // into new space. The test verifies that the store buffer entries are
246 // properly cleared and rebuilt after aborting a page. Failing to do so can 249 // properly cleared and rebuilt after aborting a page. Failing to do so can
247 // result in other objects being allocated in the free space where their 250 // result in other objects being allocated in the free space where their
248 // payload looks like a valid new space pointer. 251 // payload looks like a valid new space pointer.
249 252
250 // Disable concurrent sweeping to ensure memory is in an expected state, i.e., 253 // Disable concurrent sweeping to ensure memory is in an expected state, i.e.,
251 // we can reach the state of a half aborted page. 254 // we can reach the state of a half aborted page.
252 FLAG_concurrent_sweeping = false; 255 FLAG_concurrent_sweeping = false;
256 FLAG_stress_incremental_marking = false;
253 FLAG_manual_evacuation_candidates_selection = true; 257 FLAG_manual_evacuation_candidates_selection = true;
254 258
255 const int objects_per_page = 10; 259 const int objects_per_page = 10;
256 const int object_size = Page::kAllocatableMemory / objects_per_page; 260 const int object_size = Page::kAllocatableMemory / objects_per_page;
257 261
258 CcTest::InitializeVM(); 262 CcTest::InitializeVM();
259 Isolate* isolate = CcTest::i_isolate(); 263 Isolate* isolate = CcTest::i_isolate();
260 Heap* heap = isolate->heap(); 264 Heap* heap = isolate->heap();
261 { 265 {
262 HandleScope scope1(isolate); 266 HandleScope scope1(isolate);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 // If store buffer entries are not properly filtered/reset for aborted 357 // If store buffer entries are not properly filtered/reset for aborted
354 // pages we have now a broken address at an object slot in old space and 358 // pages we have now a broken address at an object slot in old space and
355 // the following scavenge will crash. 359 // the following scavenge will crash.
356 CcTest::CollectGarbage(NEW_SPACE); 360 CcTest::CollectGarbage(NEW_SPACE);
357 } 361 }
358 } 362 }
359 } 363 }
360 364
361 } // namespace internal 365 } // namespace internal
362 } // namespace v8 366 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/heap/test-array-buffer-tracker.cc ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698