Skip to content

Commit edd78f8

Browse files
committed
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]>
1 parent cf38d2f commit edd78f8

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
# Reset this number to 0 on major V8 upgrades.
2929
# Increment by one for each non-official patch applied to deps/v8.
30-
'v8_embedder_string': '-node.6',
30+
'v8_embedder_string': '-node.7',
3131

3232
# Enable disassembler for `--print-code` v8 options
3333
'v8_enable_disassembler': 1,

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

Lines changed: 8 additions & 0 deletions
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],
@@ -520,6 +522,8 @@ void GCTracer::PrintNVP() const {
520522
AverageSurvivalRatio(), heap_->promotion_rate_,
521523
heap_->semi_space_copied_rate_,
522524
NewSpaceAllocationThroughputInBytesPerMillisecond(),
525+
heap_->memory_allocator()->unmapper()->NumberOfChunks(),
526+
heap_->memory_allocator()->unmapper()->NumberOfDelayedChunks(),
523527
ContextDisposalRateInMilliseconds());
524528
break;
525529
case Event::MINOR_MARK_COMPACTOR:
@@ -654,6 +658,8 @@ void GCTracer::PrintNVP() const {
654658
"promotion_rate=%.1f%% "
655659
"semi_space_copy_rate=%.1f%% "
656660
"new_space_allocation_throughput=%.1f "
661+
"unmapper_chunks=%d "
662+
"unmapper_delayed_chunks=%d "
657663
"context_disposal_rate=%.1f "
658664
"compaction_speed=%.f\n",
659665
duration, spent_in_mutator, current_.TypeName(true),
@@ -731,6 +737,8 @@ void GCTracer::PrintNVP() const {
731737
AverageSurvivalRatio(), heap_->promotion_rate_,
732738
heap_->semi_space_copied_rate_,
733739
NewSpaceAllocationThroughputInBytesPerMillisecond(),
740+
heap_->memory_allocator()->unmapper()->NumberOfChunks(),
741+
heap_->memory_allocator()->unmapper()->NumberOfDelayedChunks(),
734742
ContextDisposalRateInMilliseconds(),
735743
CompactionSpeedInBytesPerMillisecond());
736744
break;

deps/v8/src/heap/spaces.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,15 @@ void MemoryAllocator::Unmapper::ReconsiderDelayedChunks() {
408408
}
409409
}
410410

411+
int MemoryAllocator::Unmapper::NumberOfChunks() {
412+
base::LockGuard<base::Mutex> guard(&mutex_);
413+
size_t result = 0;
414+
for (int i = 0; i < kNumberOfChunkQueues; i++) {
415+
result += chunks_[i].size();
416+
}
417+
return static_cast<int>(result);
418+
}
419+
411420
bool MemoryAllocator::CanFreeMemoryChunk(MemoryChunk* chunk) {
412421
MarkCompactCollector* mc = isolate_->heap()->mark_compact_collector();
413422
// We cannot free a memory chunk in new space while the sweeper is running

deps/v8/src/heap/spaces.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,8 @@ class V8_EXPORT_PRIVATE MemoryAllocator {
12041204
return static_cast<int>(delayed_regular_chunks_.size());
12051205
}
12061206

1207+
int NumberOfChunks();
1208+
12071209
private:
12081210
static const int kReservedQueueingSlots = 64;
12091211
static const int kMaxUnmapperTasks = 24;

0 commit comments

Comments
 (0)