Commit 31c66193 authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

[heap] Expand new space in safepoint

Move expansion of the new space into the safepoint. Otherwise background
threads race with the main thread when accessing the new space capacity.
This will most likely also be required to allow the allocation of new
space objects from background threads.

Bug: v8:10315
Change-Id: Ia8ac0c9f582876b655eaf4e35082aeadfbdb830e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2235532Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68226}
parent 1ea90d47
......@@ -862,7 +862,6 @@ void Heap::GarbageCollectionPrologue() {
} else {
maximum_size_scavenges_ = 0;
}
CheckNewSpaceExpansionCriteria();
UpdateNewSpaceAllocationCounter();
if (FLAG_track_retaining_path) {
retainer_.clear();
......@@ -872,6 +871,10 @@ void Heap::GarbageCollectionPrologue() {
memory_allocator()->unmapper()->PrepareForGC();
}
void Heap::GarbageCollectionPrologueInSafepoint() {
CheckNewSpaceExpansionCriteria();
}
size_t Heap::SizeOfObjects() {
size_t total = 0;
......@@ -2091,6 +2094,8 @@ size_t Heap::PerformGarbageCollection(
#endif
tracer()->StartInSafepoint();
GarbageCollectionPrologueInSafepoint();
EnsureFromSpaceIsCommitted();
size_t start_young_generation_size =
......
......@@ -1786,6 +1786,7 @@ class Heap {
// Code that should be run before and after each GC. Includes some
// reporting/verification activities when compiled with DEBUG set.
void GarbageCollectionPrologue();
void GarbageCollectionPrologueInSafepoint();
void GarbageCollectionEpilogue();
void GarbageCollectionEpilogueInSafepoint();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment