Skip to content

Commit

Permalink
src: add kGCTypeMinorMarkCompact gc type
Browse files Browse the repository at this point in the history
  • Loading branch information
theanarkh committed May 30, 2023
1 parent 8aa02e8 commit 7ba2375
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doc/api/perf_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ The value may be one of:
* `perf_hooks.constants.NODE_PERFORMANCE_GC_MINOR`
* `perf_hooks.constants.NODE_PERFORMANCE_GC_INCREMENTAL`
* `perf_hooks.constants.NODE_PERFORMANCE_GC_WEAKCB`
* `perf_hooks.constants.NODE_PERFORMANCE_GC_MINOR_MARK_COMPACT`

### Garbage Collection ('gc') Details

Expand All @@ -689,6 +690,7 @@ When `performanceEntry.type` is equal to `'gc'`, the
* `perf_hooks.constants.NODE_PERFORMANCE_GC_MINOR`
* `perf_hooks.constants.NODE_PERFORMANCE_GC_INCREMENTAL`
* `perf_hooks.constants.NODE_PERFORMANCE_GC_WEAKCB`
* `perf_hooks.constants.NODE_PERFORMANCE_GC_MINOR_MARK_COMPACT`
* `flags` {number} One of:
* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_NO`
* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED`
Expand Down
1 change: 1 addition & 0 deletions src/node_perf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ void CreatePerContextProperties(Local<Object> target,
NODE_DEFINE_CONSTANT(constants, NODE_PERFORMANCE_GC_MINOR);
NODE_DEFINE_CONSTANT(constants, NODE_PERFORMANCE_GC_INCREMENTAL);
NODE_DEFINE_CONSTANT(constants, NODE_PERFORMANCE_GC_WEAKCB);
NODE_DEFINE_CONSTANT(constants, NODE_PERFORMANCE_GC_MINOR_MARK_COMPACT);

NODE_DEFINE_CONSTANT(
constants, NODE_PERFORMANCE_GC_FLAGS_NO);
Expand Down
3 changes: 2 additions & 1 deletion src/node_perf.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ enum PerformanceGCKind {
NODE_PERFORMANCE_GC_MAJOR = v8::GCType::kGCTypeMarkSweepCompact,
NODE_PERFORMANCE_GC_MINOR = v8::GCType::kGCTypeScavenge,
NODE_PERFORMANCE_GC_INCREMENTAL = v8::GCType::kGCTypeIncrementalMarking,
NODE_PERFORMANCE_GC_WEAKCB = v8::GCType::kGCTypeProcessWeakCallbacks
NODE_PERFORMANCE_GC_WEAKCB = v8::GCType::kGCTypeProcessWeakCallbacks,
NODE_PERFORMANCE_GC_MINOR_MARK_COMPACT = v8::GCType::kGCTypeMinorMarkCompact
};

enum PerformanceGCFlags {
Expand Down
2 changes: 2 additions & 0 deletions src/node_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ static const char* GetGCTypeName(v8::GCType gc_type) {
return "IncrementalMarking";
case v8::GCType::kGCTypeProcessWeakCallbacks:
return "ProcessWeakCallbacks";
case v8::GCType::kGCTypeMinorMarkCompact:
return "MinorMarkCompact";
default:
return "Unknown";
}
Expand Down

0 comments on commit 7ba2375

Please sign in to comment.