Skip to content

Commit ad69207

Browse files
targosgibfahn
authored andcommitted
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 <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> 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 Backport-PR-URL: #16569 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
1 parent 7bdb8db commit ad69207

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 6
1212
#define V8_MINOR_VERSION 1
1313
#define V8_BUILD_NUMBER 534
14-
#define V8_PATCH_LEVEL 44
14+
#define V8_PATCH_LEVEL 45
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/heap/gc-tracer.cc

+8
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,8 @@ void GCTracer::PrintNVP() const {
490490
"promotion_rate=%.1f%% "
491491
"semi_space_copy_rate=%.1f%% "
492492
"new_space_allocation_throughput=%.1f "
493+
"unmapper_chunks=%d "
494+
"unmapper_delayed_chunks=%d "
493495
"context_disposal_rate=%.1f\n",
494496
duration, spent_in_mutator, current_.TypeName(true),
495497
current_.reduce_memory, current_.scopes[Scope::HEAP_PROLOGUE],
@@ -517,6 +519,8 @@ void GCTracer::PrintNVP() const {
517519
AverageSurvivalRatio(), heap_->promotion_rate_,
518520
heap_->semi_space_copied_rate_,
519521
NewSpaceAllocationThroughputInBytesPerMillisecond(),
522+
heap_->memory_allocator()->unmapper()->NumberOfChunks(),
523+
heap_->memory_allocator()->unmapper()->NumberOfDelayedChunks(),
520524
ContextDisposalRateInMilliseconds());
521525
break;
522526
case Event::MINOR_MARK_COMPACTOR:
@@ -650,6 +654,8 @@ void GCTracer::PrintNVP() const {
650654
"promotion_rate=%.1f%% "
651655
"semi_space_copy_rate=%.1f%% "
652656
"new_space_allocation_throughput=%.1f "
657+
"unmapper_chunks=%d "
658+
"unmapper_delayed_chunks=%d "
653659
"context_disposal_rate=%.1f "
654660
"compaction_speed=%.f\n",
655661
duration, spent_in_mutator, current_.TypeName(true),
@@ -726,6 +732,8 @@ void GCTracer::PrintNVP() const {
726732
AverageSurvivalRatio(), heap_->promotion_rate_,
727733
heap_->semi_space_copied_rate_,
728734
NewSpaceAllocationThroughputInBytesPerMillisecond(),
735+
heap_->memory_allocator()->unmapper()->NumberOfChunks(),
736+
heap_->memory_allocator()->unmapper()->NumberOfDelayedChunks(),
729737
ContextDisposalRateInMilliseconds(),
730738
CompactionSpeedInBytesPerMillisecond());
731739
break;

deps/v8/src/heap/spaces.cc

+9
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,15 @@ void MemoryAllocator::Unmapper::ReconsiderDelayedChunks() {
418418
}
419419
}
420420

421+
int MemoryAllocator::Unmapper::NumberOfChunks() {
422+
base::LockGuard<base::Mutex> guard(&mutex_);
423+
size_t result = 0;
424+
for (int i = 0; i < kNumberOfChunkQueues; i++) {
425+
result += chunks_[i].size();
426+
}
427+
return static_cast<int>(result);
428+
}
429+
421430
bool MemoryAllocator::CanFreeMemoryChunk(MemoryChunk* chunk) {
422431
MarkCompactCollector* mc = isolate_->heap()->mark_compact_collector();
423432
// We cannot free a memory chunk in new space while the sweeper is running

deps/v8/src/heap/spaces.h

+2
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,8 @@ class V8_EXPORT_PRIVATE MemoryAllocator {
12311231
return static_cast<int>(delayed_regular_chunks_.size());
12321232
}
12331233

1234+
int NumberOfChunks();
1235+
12341236
private:
12351237
static const int kReservedQueueingSlots = 64;
12361238
static const int kMaxUnmapperTasks = 24;

0 commit comments

Comments
 (0)