OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/array-buffer-tracker.h" | 6 #include "src/heap/array-buffer-tracker.h" |
7 #include "src/heap/spaces-inl.h" | 7 #include "src/heap/spaces-inl.h" |
8 #include "src/isolate.h" | 8 #include "src/isolate.h" |
9 // FIXME(mstarzinger, marja): This is weird, but required because of the missing | 9 // FIXME(mstarzinger, marja): This is weird, but required because of the missing |
10 // (disallowed) include: src/factory.h -> src/objects-inl.h | 10 // (disallowed) include: src/factory.h -> src/objects-inl.h |
11 #include "src/objects-inl.h" | 11 #include "src/objects-inl.h" |
12 // FIXME(mstarzinger, marja): This is weird, but required because of the missing | 12 // FIXME(mstarzinger, marja): This is weird, but required because of the missing |
13 // (disallowed) include: src/feedback-vector.h -> | 13 // (disallowed) include: src/feedback-vector.h -> |
14 // src/feedback-vector-inl.h | 14 // src/feedback-vector-inl.h |
15 #include "src/feedback-vector-inl.h" | 15 #include "src/feedback-vector-inl.h" |
16 #include "test/cctest/cctest.h" | 16 #include "test/cctest/cctest.h" |
17 #include "test/cctest/heap/heap-tester.h" | 17 #include "test/cctest/heap/heap-tester.h" |
18 #include "test/cctest/heap/heap-utils.h" | 18 #include "test/cctest/heap/heap-utils.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 v8::Isolate* NewIsolateForPagePromotion(int min_semi_space_size = 8, | 22 v8::Isolate* NewIsolateForPagePromotion(int min_semi_space_size = 8, |
23 int max_semi_space_size = 8) { | 23 int max_semi_space_size = 8) { |
| 24 // Parallel evacuation messes with fragmentation in a way that objects that |
| 25 // should be copied in semi space are promoted to old space because of |
| 26 // fragmentation. |
| 27 i::FLAG_parallel_compaction = false; |
24 i::FLAG_page_promotion = true; | 28 i::FLAG_page_promotion = true; |
25 i::FLAG_page_promotion_threshold = 0; // % | 29 i::FLAG_page_promotion_threshold = 0; // % |
26 i::FLAG_min_semi_space_size = min_semi_space_size; | 30 i::FLAG_min_semi_space_size = min_semi_space_size; |
27 // We cannot optimize for size as we require a new space with more than one | 31 // We cannot optimize for size as we require a new space with more than one |
28 // page. | 32 // page. |
29 i::FLAG_optimize_for_size = false; | 33 i::FLAG_optimize_for_size = false; |
30 // Set max_semi_space_size because it could've been initialized by an | 34 // Set max_semi_space_size because it could've been initialized by an |
31 // implication of optimize_for_size. | 35 // implication of optimize_for_size. |
32 i::FLAG_max_semi_space_size = max_semi_space_size; | 36 i::FLAG_max_semi_space_size = max_semi_space_size; |
33 v8::Isolate::CreateParams create_params; | 37 v8::Isolate::CreateParams create_params; |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 heap->CollectGarbage(NEW_SPACE, i::GarbageCollectionReason::kTesting); | 183 heap->CollectGarbage(NEW_SPACE, i::GarbageCollectionReason::kTesting); |
180 heap->new_space()->Shrink(); | 184 heap->new_space()->Shrink(); |
181 heap->memory_allocator()->unmapper()->WaitUntilCompleted(); | 185 heap->memory_allocator()->unmapper()->WaitUntilCompleted(); |
182 heap->mark_compact_collector()->sweeper().StartSweeperTasks(); | 186 heap->mark_compact_collector()->sweeper().StartSweeperTasks(); |
183 heap->mark_compact_collector()->EnsureSweepingCompleted(); | 187 heap->mark_compact_collector()->EnsureSweepingCompleted(); |
184 } | 188 } |
185 } | 189 } |
186 | 190 |
187 } // namespace internal | 191 } // namespace internal |
188 } // namespace v8 | 192 } // namespace v8 |
OLD | NEW |