Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v8.x backport] deps: cherry-pick garbage collection fixes from upstream V8 #16569

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
deps: cherry-pick e0d64dc from upstream V8
Original commit message:

    [heap] Print the number of chunks in unmapper queue in --trace-gc-nvp

    Bug: chromium:771966
    Change-Id: I146b279c4713b7dd716c6d55ca5e6c6e23a3ad7e
    Reviewed-on: https://chromium-review.googlesource.com/704740
    Reviewed-by: Michael Lippautz <[email protected]>
    Commit-Queue: Ulan Degenbaev <[email protected]>
    Cr-Commit-Position: refs/heads/master@{#48338}

Refs: v8/v8@e0d64dc
Refs: nodejs/help#917 (comment)
Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966

PR-URL: #16490
Reviewed-By: Franziska Hinkelmann <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
targos committed Oct 28, 2017
commit 93fbda7c57d4c79ac2026f4205938060592262e4
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 6
#define V8_MINOR_VERSION 1
#define V8_BUILD_NUMBER 534
#define V8_PATCH_LEVEL 44
#define V8_PATCH_LEVEL 45

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
8 changes: 8 additions & 0 deletions deps/v8/src/heap/gc-tracer.cc
Original file line number Diff line number Diff line change
@@ -490,6 +490,8 @@ void GCTracer::PrintNVP() const {
"promotion_rate=%.1f%% "
"semi_space_copy_rate=%.1f%% "
"new_space_allocation_throughput=%.1f "
"unmapper_chunks=%d "
"unmapper_delayed_chunks=%d "
"context_disposal_rate=%.1f\n",
duration, spent_in_mutator, current_.TypeName(true),
current_.reduce_memory, current_.scopes[Scope::HEAP_PROLOGUE],
@@ -517,6 +519,8 @@ void GCTracer::PrintNVP() const {
AverageSurvivalRatio(), heap_->promotion_rate_,
heap_->semi_space_copied_rate_,
NewSpaceAllocationThroughputInBytesPerMillisecond(),
heap_->memory_allocator()->unmapper()->NumberOfChunks(),
heap_->memory_allocator()->unmapper()->NumberOfDelayedChunks(),
ContextDisposalRateInMilliseconds());
break;
case Event::MINOR_MARK_COMPACTOR:
@@ -650,6 +654,8 @@ void GCTracer::PrintNVP() const {
"promotion_rate=%.1f%% "
"semi_space_copy_rate=%.1f%% "
"new_space_allocation_throughput=%.1f "
"unmapper_chunks=%d "
"unmapper_delayed_chunks=%d "
"context_disposal_rate=%.1f "
"compaction_speed=%.f\n",
duration, spent_in_mutator, current_.TypeName(true),
@@ -726,6 +732,8 @@ void GCTracer::PrintNVP() const {
AverageSurvivalRatio(), heap_->promotion_rate_,
heap_->semi_space_copied_rate_,
NewSpaceAllocationThroughputInBytesPerMillisecond(),
heap_->memory_allocator()->unmapper()->NumberOfChunks(),
heap_->memory_allocator()->unmapper()->NumberOfDelayedChunks(),
ContextDisposalRateInMilliseconds(),
CompactionSpeedInBytesPerMillisecond());
break;
9 changes: 9 additions & 0 deletions deps/v8/src/heap/spaces.cc
Original file line number Diff line number Diff line change
@@ -418,6 +418,15 @@ void MemoryAllocator::Unmapper::ReconsiderDelayedChunks() {
}
}

int MemoryAllocator::Unmapper::NumberOfChunks() {
base::LockGuard<base::Mutex> guard(&mutex_);
size_t result = 0;
for (int i = 0; i < kNumberOfChunkQueues; i++) {
result += chunks_[i].size();
}
return static_cast<int>(result);
}

bool MemoryAllocator::CanFreeMemoryChunk(MemoryChunk* chunk) {
MarkCompactCollector* mc = isolate_->heap()->mark_compact_collector();
// We cannot free a memory chunk in new space while the sweeper is running
2 changes: 2 additions & 0 deletions deps/v8/src/heap/spaces.h
Original file line number Diff line number Diff line change
@@ -1231,6 +1231,8 @@ class V8_EXPORT_PRIVATE MemoryAllocator {
return static_cast<int>(delayed_regular_chunks_.size());
}

int NumberOfChunks();

private:
static const int kReservedQueueingSlots = 64;
static const int kMaxUnmapperTasks = 24;