Commit 10c15dbe authored by Nikolaos Papaspyrou's avatar Nikolaos Papaspyrou Committed by V8 LUCI CQ

heap: Explicitly clear moved-away struct

This struct is reused across various GC cycles. In the way that it's
used here, std::move does not clear the vector of events.

Change-Id: I21e3f74e3ce13fad063499bed19c287902cb90cf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3460408Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79078}
parent 18ced8a5
......@@ -1441,6 +1441,7 @@ void FlushBatchedIncrementalEvents(
DCHECK(!batched_events.events.empty());
isolate->metrics_recorder()->AddMainThreadEvent(std::move(batched_events),
GetContextId(isolate));
batched_events = {};
}
} // namespace
......@@ -1455,7 +1456,7 @@ void GCTracer::ReportFullCycleToRecorder() {
heap_->isolate()->metrics_recorder();
DCHECK_NOT_NULL(recorder);
if (!recorder->HasEmbedderRecorder()) {
incremental_mark_batched_events_.events.clear();
incremental_mark_batched_events_ = {};
if (cpp_heap) {
cpp_heap->GetMetricRecorder()->ClearCachedEvents();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment