v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
tracing-flags.h
Go to the documentation of this file.
1// Copyright 2020 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_LOGGING_TRACING_FLAGS_H_
6#define V8_LOGGING_TRACING_FLAGS_H_
7
8#include <atomic>
9
10#include "src/base/macros.h"
11
12namespace v8 {
13namespace internal {
14
15// This struct contains a set of flags that can be modified from multiple
16// threads at runtime unlike the normal v8_flags.-like flags which are not
17// modified after V8 instance is initialized.
18
20 static V8_EXPORT_PRIVATE std::atomic_uint runtime_stats;
21 static V8_EXPORT_PRIVATE std::atomic_uint gc;
22 static V8_EXPORT_PRIVATE std::atomic_uint gc_stats;
23 static V8_EXPORT_PRIVATE std::atomic_uint ic_stats;
24 static V8_EXPORT_PRIVATE std::atomic_uint zone_stats;
25
26#ifdef V8_RUNTIME_CALL_STATS
27 static bool is_runtime_stats_enabled() {
28 return runtime_stats.load(std::memory_order_relaxed) != 0;
29 }
30#endif
31
32 static bool is_gc_enabled() {
33 return gc.load(std::memory_order_relaxed) != 0;
34 }
35
36 static bool is_gc_stats_enabled() {
37 return gc_stats.load(std::memory_order_relaxed) != 0;
38 }
39
40 static bool is_ic_stats_enabled() {
41 return ic_stats.load(std::memory_order_relaxed) != 0;
42 }
43
44 static bool is_zone_stats_enabled() {
45 return zone_stats.load(std::memory_order_relaxed) != 0;
46 }
47};
48
49} // namespace internal
50} // namespace v8
51
52#endif // V8_LOGGING_TRACING_FLAGS_H_
#define V8_EXPORT_PRIVATE
Definition macros.h:460
static bool is_ic_stats_enabled()
static V8_EXPORT_PRIVATE std::atomic_uint gc
static V8_EXPORT_PRIVATE std::atomic_uint gc_stats
static bool is_zone_stats_enabled()
static bool is_gc_stats_enabled()
static V8_EXPORT_PRIVATE std::atomic_uint ic_stats
static V8_EXPORT_PRIVATE std::atomic_uint runtime_stats
static V8_EXPORT_PRIVATE std::atomic_uint zone_stats