Index: src/isolate.h |
diff --git a/src/isolate.h b/src/isolate.h |
index 2923af373133bd481a1024c7e468ccf7e37e8da7..c58f48b2a69799e54bb9cba7af860ba17ad39232 100644 |
--- a/src/isolate.h |
+++ b/src/isolate.h |
@@ -849,13 +849,14 @@ class Isolate { |
#undef NATIVE_CONTEXT_FIELD_ACCESSOR |
Bootstrapper* bootstrapper() { return bootstrapper_; } |
- Counters* counters() { |
- // Call InitializeLoggingAndCounters() if logging is needed before |
- // the isolate is fully initialized. |
- DCHECK_NOT_NULL(counters_shared_.get()); |
- return counters_shared_.get(); |
+ // Use for updating counters on a foreground thread. |
+ Counters* counters() { return async_counters().get(); } |
+ // Use for updating counters on a background thread. |
+ const std::shared_ptr<Counters>& async_counters() { |
+ // Make sure InitializeCounters() has been called. |
+ DCHECK_NOT_NULL(async_counters_.get()); |
+ return async_counters_; |
} |
- std::shared_ptr<Counters> counters_shared() { return counters_shared_; } |
RuntimeProfiler* runtime_profiler() { return runtime_profiler_; } |
CompilationCache* compilation_cache() { return compilation_cache_; } |
Logger* logger() { |
@@ -1421,7 +1422,7 @@ class Isolate { |
Bootstrapper* bootstrapper_; |
RuntimeProfiler* runtime_profiler_; |
CompilationCache* compilation_cache_; |
- std::shared_ptr<Counters> counters_shared_; |
+ std::shared_ptr<Counters> async_counters_; |
base::RecursiveMutex break_access_; |
Logger* logger_; |
StackGuard stack_guard_; |