Commit 80989b92 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.

Reland of https://crrev.com/c/2235539, the timeouts were unrelated to this CL.

Bug: v8:10315
Change-Id: I134b4f27ec666cf036c346b847d164255e0fe7d7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2237626Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68284}
parent e512da1e
......@@ -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;
......@@ -2097,6 +2100,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