| OLD | NEW |
| 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 Loading... |
| 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_concurrent_marking = false; |
| 50 FLAG_stress_incremental_marking = false; | 51 FLAG_stress_incremental_marking = false; |
| 51 FLAG_manual_evacuation_candidates_selection = true; | 52 FLAG_manual_evacuation_candidates_selection = true; |
| 52 CcTest::InitializeVM(); | 53 CcTest::InitializeVM(); |
| 53 Isolate* isolate = CcTest::i_isolate(); | 54 Isolate* isolate = CcTest::i_isolate(); |
| 54 Heap* heap = isolate->heap(); | 55 Heap* heap = isolate->heap(); |
| 55 { | 56 { |
| 56 HandleScope scope1(isolate); | 57 HandleScope scope1(isolate); |
| 57 | 58 |
| 58 heap::SealCurrentObjects(heap); | 59 heap::SealCurrentObjects(heap); |
| 59 | 60 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 83 } | 84 } |
| 84 | 85 |
| 85 | 86 |
| 86 HEAP_TEST(CompactionPartiallyAbortedPage) { | 87 HEAP_TEST(CompactionPartiallyAbortedPage) { |
| 87 // Test the scenario where we reach OOM during compaction and parts of the | 88 // Test the scenario where we reach OOM during compaction and parts of the |
| 88 // page have already been migrated to a new one. | 89 // page have already been migrated to a new one. |
| 89 | 90 |
| 90 // Disable concurrent sweeping to ensure memory is in an expected state, i.e., | 91 // Disable concurrent sweeping to ensure memory is in an expected state, i.e., |
| 91 // we can reach the state of a half aborted page. | 92 // we can reach the state of a half aborted page. |
| 92 FLAG_concurrent_sweeping = false; | 93 FLAG_concurrent_sweeping = false; |
| 94 FLAG_concurrent_marking = false; |
| 93 FLAG_stress_incremental_marking = false; | 95 FLAG_stress_incremental_marking = false; |
| 94 FLAG_manual_evacuation_candidates_selection = true; | 96 FLAG_manual_evacuation_candidates_selection = true; |
| 95 | 97 |
| 96 const int objects_per_page = 10; | 98 const int objects_per_page = 10; |
| 97 const int object_size = Page::kAllocatableMemory / objects_per_page; | 99 const int object_size = Page::kAllocatableMemory / objects_per_page; |
| 98 | 100 |
| 99 CcTest::InitializeVM(); | 101 CcTest::InitializeVM(); |
| 100 Isolate* isolate = CcTest::i_isolate(); | 102 Isolate* isolate = CcTest::i_isolate(); |
| 101 Heap* heap = isolate->heap(); | 103 Heap* heap = isolate->heap(); |
| 102 { | 104 { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 160 |
| 159 HEAP_TEST(CompactionPartiallyAbortedPageIntraAbortedPointers) { | 161 HEAP_TEST(CompactionPartiallyAbortedPageIntraAbortedPointers) { |
| 160 // Test the scenario where we reach OOM during compaction and parts of the | 162 // Test the scenario where we reach OOM during compaction and parts of the |
| 161 // page have already been migrated to a new one. Objects on the aborted page | 163 // page have already been migrated to a new one. Objects on the aborted page |
| 162 // are linked together. This test makes sure that intra-aborted page pointers | 164 // are linked together. This test makes sure that intra-aborted page pointers |
| 163 // get properly updated. | 165 // get properly updated. |
| 164 | 166 |
| 165 // Disable concurrent sweeping to ensure memory is in an expected state, i.e., | 167 // Disable concurrent sweeping to ensure memory is in an expected state, i.e., |
| 166 // we can reach the state of a half aborted page. | 168 // we can reach the state of a half aborted page. |
| 167 FLAG_concurrent_sweeping = false; | 169 FLAG_concurrent_sweeping = false; |
| 170 FLAG_concurrent_marking = false; |
| 168 FLAG_stress_incremental_marking = false; | 171 FLAG_stress_incremental_marking = false; |
| 169 FLAG_manual_evacuation_candidates_selection = true; | 172 FLAG_manual_evacuation_candidates_selection = true; |
| 170 | 173 |
| 171 const int objects_per_page = 10; | 174 const int objects_per_page = 10; |
| 172 const int object_size = Page::kAllocatableMemory / objects_per_page; | 175 const int object_size = Page::kAllocatableMemory / objects_per_page; |
| 173 | 176 |
| 174 CcTest::InitializeVM(); | 177 CcTest::InitializeVM(); |
| 175 Isolate* isolate = CcTest::i_isolate(); | 178 Isolate* isolate = CcTest::i_isolate(); |
| 176 Heap* heap = isolate->heap(); | 179 Heap* heap = isolate->heap(); |
| 177 { | 180 { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 // page have already been migrated to a new one. Objects on the aborted page | 249 // page have already been migrated to a new one. Objects on the aborted page |
| 247 // are linked together and the very first object on the aborted page points | 250 // are linked together and the very first object on the aborted page points |
| 248 // into new space. The test verifies that the store buffer entries are | 251 // into new space. The test verifies that the store buffer entries are |
| 249 // properly cleared and rebuilt after aborting a page. Failing to do so can | 252 // properly cleared and rebuilt after aborting a page. Failing to do so can |
| 250 // result in other objects being allocated in the free space where their | 253 // result in other objects being allocated in the free space where their |
| 251 // payload looks like a valid new space pointer. | 254 // payload looks like a valid new space pointer. |
| 252 | 255 |
| 253 // Disable concurrent sweeping to ensure memory is in an expected state, i.e., | 256 // Disable concurrent sweeping to ensure memory is in an expected state, i.e., |
| 254 // we can reach the state of a half aborted page. | 257 // we can reach the state of a half aborted page. |
| 255 FLAG_concurrent_sweeping = false; | 258 FLAG_concurrent_sweeping = false; |
| 259 FLAG_concurrent_marking = false; |
| 256 FLAG_stress_incremental_marking = false; | 260 FLAG_stress_incremental_marking = false; |
| 257 FLAG_manual_evacuation_candidates_selection = true; | 261 FLAG_manual_evacuation_candidates_selection = true; |
| 258 | 262 |
| 259 const int objects_per_page = 10; | 263 const int objects_per_page = 10; |
| 260 const int object_size = Page::kAllocatableMemory / objects_per_page; | 264 const int object_size = Page::kAllocatableMemory / objects_per_page; |
| 261 | 265 |
| 262 CcTest::InitializeVM(); | 266 CcTest::InitializeVM(); |
| 263 Isolate* isolate = CcTest::i_isolate(); | 267 Isolate* isolate = CcTest::i_isolate(); |
| 264 Heap* heap = isolate->heap(); | 268 Heap* heap = isolate->heap(); |
| 265 { | 269 { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 // If store buffer entries are not properly filtered/reset for aborted | 361 // If store buffer entries are not properly filtered/reset for aborted |
| 358 // pages we have now a broken address at an object slot in old space and | 362 // pages we have now a broken address at an object slot in old space and |
| 359 // the following scavenge will crash. | 363 // the following scavenge will crash. |
| 360 CcTest::CollectGarbage(NEW_SPACE); | 364 CcTest::CollectGarbage(NEW_SPACE); |
| 361 } | 365 } |
| 362 } | 366 } |
| 363 } | 367 } |
| 364 | 368 |
| 365 } // namespace internal | 369 } // namespace internal |
| 366 } // namespace v8 | 370 } // namespace v8 |
| OLD | NEW |