Commit 6697ae18 authored by JianxiaoLuIntel's avatar JianxiaoLuIntel Committed by V8 LUCI CQ

[serializer]: Fix DisableGCStats

This bug may lead to gc_stats tracing doesn't stop after chrome://tracing stop as expected.

Change-Id: Ibc2ece4c0ad536a99c4aece039ef546d152df10a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3709242Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Jianxiao Lu <jianxiao.lu@intel.com>
Cr-Commit-Position: refs/heads/main@{#81251}
parent b84c7dbd
......@@ -259,17 +259,13 @@ class Deserializer : public SerializerDeserializer {
class V8_NODISCARD DisableGCStats {
public:
explicit DisableGCStats() {
if (V8_LIKELY(!TracingFlags::is_gc_stats_enabled())) return;
was_enabled_ = true;
TracingFlags::gc_stats = false;
}
~DisableGCStats() {
if (V8_LIKELY(!was_enabled_)) return;
TracingFlags::gc_stats = true;
original_gc_stats_ = TracingFlags::gc_stats;
TracingFlags::gc_stats = 0;
}
~DisableGCStats() { TracingFlags::gc_stats = original_gc_stats_; }
private:
bool was_enabled_ = false;
unsigned int original_gc_stats_;
};
DisableGCStats no_gc_stats_;
......
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