Commit 63f7d83d authored by Nico Hartmann's avatar Nico Hartmann Committed by Commit Bot

Atomic accessor for Isolate::code_coverage_mode

Change Isolate::code_coverage_mode to an atomic such that access from
the background thread is safe.

Bug: v8:11378
Change-Id: I26d6915b1662ba022ea6a173a87d184d3ac7cd3b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2666691
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72530}
parent cf4ec5aa
......@@ -455,8 +455,6 @@ using DebugObjectCache = std::vector<Handle<HeapObject>>;
V(bool, formatting_stack_trace, false) \
/* Perform side effect checks on function call and API callbacks. */ \
V(DebugInfo::ExecutionMode, debug_execution_mode, DebugInfo::kBreakpoints) \
/* Current code coverage mode */ \
V(debug::CoverageMode, code_coverage_mode, debug::CoverageMode::kBestEffort) \
V(debug::TypeProfileMode, type_profile_mode, debug::TypeProfileMode::kNone) \
V(bool, disable_bytecode_flushing, false) \
V(int, last_console_context_id, 0) \
......@@ -1586,6 +1584,13 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory {
RAILMode rail_mode() { return rail_mode_.load(); }
void set_code_coverage_mode(debug::CoverageMode coverage_mode) {
code_coverage_mode_.store(coverage_mode, std::memory_order_relaxed);
}
debug::CoverageMode code_coverage_mode() const {
return code_coverage_mode_.load(std::memory_order_relaxed);
}
double LoadStartTimeMs();
void IsolateInForegroundNotification();
......@@ -1840,6 +1845,8 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory {
host_import_module_dynamically_callback_ = nullptr;
HostImportModuleDynamicallyWithImportAssertionsCallback
host_import_module_dynamically_with_import_assertions_callback_ = nullptr;
std::atomic<debug::CoverageMode> code_coverage_mode_{
debug::CoverageMode::kBestEffort};
// Helper function for RunHostImportModuleDynamicallyCallback.
// Unpacks import assertions, if present, from the second argument to dynamic
......
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