Skip to content

Commit 3def577

Browse files
Archkonaduh95
authored andcommitted
v8: report minor mark-sweep in GCProfiler
Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com> PR-URL: #64688 Fixes: #64687 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 2970932 commit 3def577

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/node_v8.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@ static const char* GetGCTypeName(v8::GCType gc_type) {
336336
switch (gc_type) {
337337
case v8::GCType::kGCTypeScavenge:
338338
return "Scavenge";
339+
case v8::GCType::kGCTypeMinorMarkSweep:
340+
return "MinorMarkSweep";
339341
case v8::GCType::kGCTypeMarkSweepCompact:
340342
return "MarkSweepCompact";
341343
case v8::GCType::kGCTypeIncrementalMarking:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Flags: --expose-gc --minor-ms
2+
'use strict';
3+
4+
require('../common');
5+
const assert = require('assert');
6+
const { GCProfiler } = require('v8');
7+
8+
const profiler = new GCProfiler();
9+
profiler.start();
10+
global.gc({ type: 'minor', execution: 'sync' });
11+
12+
const profile = profiler.stop();
13+
assert.deepStrictEqual(
14+
profile.statistics.map(({ gcType }) => gcType),
15+
['MinorMarkSweep'],
16+
);

0 commit comments

Comments
 (0)